tuya-local icon indicating copy to clipboard operation
tuya-local copied to clipboard

Request support for Zemismart Electric Curtain Motor (Wifi), model BCM500DS-TYW

Open MBarti opened this issue 1 year ago • 5 comments
trafficstars

Log Message

"Device matches graywind_shades with quality of 100%. DPS: {"updated_at": 1714075988.0670383, "1": "stop", "2": 100, "5": "back"}"

In the HA user interface I'm offered the following device types to select from:

  • co2_box
  • graywind_shades
  • illumanance_sensor
  • loratap_curtain_switch

Information about DPS mappings

{ "result": { "model": "{"modelId":"000003ghx7","services":[{"actions":[],"code":"","description":"","events":[],"name":"默认服务","properties":[{"abilityId":1,"accessMode":"rw","code":"control","description":"【必选项】该DP点用于控制电机的开启、暂停、关闭。该DP点枚举值参数不允许修改,不允许增减。其中,continue功能在APP面板无呈现,用于第三方(Google home)开通使用,下发指令后,需要MCU记住上一次的状态,并执行动作,注意,无该功能,无法通过WWGA认证。","extensions":{"iconName":"icon-dp_power2","attribute":"1024"},"name":"设备控制","typeSpec":{"type":"enum","range":["open","stop","close","continue"]}},{"abilityId":2,"accessMode":"rw","code":"percent_control","description":"如果窗帘电机可以监控窗帘目前的所处位置,例如窗帘现在开了一半,也就是50%,那么可以通过该DP点进行窗帘位置的自定义控制。控制使用该DP点,如果选择了该DP点,必选选择“开启百分比状态显示”,该DP点数值范围值参数不允许修改,不允许增减。","extensions":{"iconName":"icon-icon-percent","attribute":"1024"},"name":"开启百分比控制","typeSpec":{"type":"value","max":100,"min":0,"scale":0,"step":1,"unit":"%"}},{"abilityId":3,"accessMode":"ro","code":"percent_state","description":"该DP点与“开启百分比状态控制”配套使用。该DP点用于显示实际窗帘所处位置。该DP点数值范围值参数不允许修改,不允许增减。","extensions":{"iconName":"icon-icon-percent","attribute":"1024"},"name":"开启百分比状态","typeSpec":{"type":"value","max":100,"min":0,"scale":0,"step":1,"unit":"%"}},{"abilityId":5,"accessMode":"rw","code":"control_back","description":"用于设置电机转向,顺时针,或者逆时针,forward代表顺时针,back代表逆时针","extensions":{"iconName":"icon-dp_mode","attribute":"1024"},"name":"电机反转","typeSpec":{"type":"enum","range":["forward","back"]}},{"abilityId":12,"accessMode":"ro","code":"fault","description":"【必选】设备上报故障值,该DP点枚举值可增减,但不可修改枚举值名称,例如可以删除motor_fault,可以增加其他值,未选则不展示该功能。 如需要修改在APP面板中显示的内容,可以前往第四步的拓展中心,多语言管理修改代表值,新增的枚举值所代表的的内容也是在多语言中修改代表值。","extensions":{"iconName":"icon-baojing","attribute":"1024"},"name":"故障告警","typeSpec":{"type":"bitmap","label":["motor_fault"],"maxlen":1}}]}]}" }, "success": true, "t": 1714073577986, "tid": "9ecdf5ae033a11efa95c2ed630a352ef" }

The codes extracted using the provided console script are: {1: "Control", 2: "Curtain position setting", 3: "Current curtain position", 5: "Motor Direction", 12: "Fault"}

I can see in the logs that "Control" can be at least "Stop", "Close", "Start" The "curtain position setting" is a & value from "0%" to "100%"

Product ID

"product_id": "f6jujmx0is5td50x",
"product_name": "Zemismart Smart Electric Curtain Motor"
"model": "BCM500DS-TYW",

Information about how the device functions

https://www.zemismart.com/products/-bcm500ds-tyw

It's a curtain controller with track. It can open/stop/close curtains and also set percentage opening (e.g. open to 50%). In the tuya app one can also reverse the motor direction, if a such a set up for one's installation is needed.

Warning: currently the devices is detected by the tuya local plugin as "graywind shades", which doesnt work! It can't set up % opening, does not read the current "open percentage" status properly, so I don't know the current state of the curtains.

MBarti avatar Apr 25 '24 20:04 MBarti

The Graywind shades are an exact match for the dps that are being reported.

make-all avatar Jun 01 '24 13:06 make-all

The Graywind shades are an exact match for the dps that are being reported.

That’s awkward. I’m sure about the Zemismart data - have the product and extracted the data myself.

In that case I’d suggest showing both options to the user and letting them choose which product they have.

MBarti avatar Jun 01 '24 14:06 MBarti

This is not fixed in the latest version. Now I can control the percentage of opening, but 2 problems remain:

  1. I cannot properly see the status of the curtain - it says "unknown" at the top. Also the percentages are inverted - see below.
  2. As I have the motor direction permanently set to "back", the buttons in HA are inverted - i.e. If the curtain is open, the available button to press should be "close", and now it's grayed out, while the "open" button is available to press. Instead of 92% open, it shows 8% open.

See enclosed screenshot. The HA view (incorrect) vs the correct Apple Home app view (where I added it directly without HA)

Zrzut ekranu 2024-06-14 o 19 29 06

MBarti avatar Jun 14 '24 17:06 MBarti

@make-all Buggy implementation of issue #1852 - please reopen; "[Request support for Zemismart Electric Curtain Motor (Wifi), model BCM500DS-TYW]"

MBarti avatar Jun 22 '24 12:06 MBarti

This seems to be closer to the Loonas curtain than Graywind - the position appears to be inverted the same as Loonas, but the current_position does not seem to be reported, even though it appears in the tuya portal info. I have made the Loonas current_position optional so that it matches also. Regarding the status of Unknown, this is due to the current_position (dp id 3) not being reported locally.

make-all avatar Aug 29 '24 12:08 make-all

  1. I checked again in the Tuya portal and the The CURRENT position is reported, but in the other variable - in '2: "Curtain position setting'; It's correct even if I change the position in another way (by pulling the curtain or through Homekit - outside of Home Assist.)

    1. The inverted position is probably due to the "Motor direction" setting that I have set in the Tuya app to "back" (as opposed to "forward"); This would need to be corrected in this plugin; I.e. when my shades are closed they are reported as "open" in HA;

So: If "motor direction" == "back" then actual_position = (1 - Curtain_Position_Setting), else actual_position = Curtain_Position_Setting [same for reporting open vs closed)

image

MBarti avatar Sep 05 '24 07:09 MBarti