Support for Zemismart BCM500DS-TYW curtain motor
Describe the problem you have/What new integration you would like I would like to get support for my Zemismart curtain motor BCM500DS-TYW
Please describe your use case for this integration and alternatives you've tried:
I've tried the current tuya/cover component but it doesn't work 100% for my motor
Additional context
I've got Zemismart curtain motor BCM500DS-TYW, it comes with TYWE1S and I was able to flash ESPHome to it.
Then I tried to configure it using tuya/cover component, however it seems to communicate somehow differently than the already verified motor.
First thing is, it gets stuck on init_state 3:
[00:39:51][C][logger:275]: Logger:
[00:39:51][C][logger:276]: Level: VERY_VERBOSE
[00:39:51][C][logger:277]: Log Baud Rate: 0
[00:39:51][C][logger:278]: Hardware UART: UART0
[00:39:51][C][uart.arduino_esp8266:102]: UART Bus:
[00:39:51][C][uart.arduino_esp8266:103]: TX Pin: GPIO15
[00:39:51][C][uart.arduino_esp8266:104]: RX Pin: GPIO13
[00:39:51][C][uart.arduino_esp8266:106]: RX Buffer Size: 256
[00:39:51][C][uart.arduino_esp8266:108]: Baud Rate: 9600 baud
[00:39:51][C][uart.arduino_esp8266:109]: Data Bits: 8
[00:39:51][C][uart.arduino_esp8266:110]: Parity: NONE
[00:39:51][C][uart.arduino_esp8266:111]: Stop bits: 1
[00:39:51][C][uart.arduino_esp8266:113]: Using hardware serial interface.
[00:39:51][C][tuya.cover:107]: Tuya Cover:
[00:39:51][C][tuya.cover:116]: Control has datapoint ID 102
[00:39:51][C][tuya.cover:118]: Direction has datapoint ID 103
[00:39:51][C][tuya.cover:120]: Position has datapoint ID 101
[00:39:51][C][tuya:033]: Tuya:
[00:39:51][C][tuya:038]: Configuration will be reported when setup is complete. Current init_state: 3
[00:39:51][C][tuya:041]: If no further output is received, confirm that this is a supported Tuya device.
[00:40:02][V][tuya:383]: Sending Tuya: CMD=0x00 VERSION=0 DATA=[] INIT_STATE=3
[00:40:02][D][uart_debug:114]: >>> 55:AA:00:00:00:00:FF
[00:40:02][V][tuya:120]: Received Tuya: CMD=0x00 VERSION=0 DATA=[01] INIT_STATE=3
[00:40:02][V][tuya:148]: MCU Heartbeat (0x01)
[00:40:02][D][uart_debug:114]: <<< 55:AA:00:00:00:01:01:01
[00:40:17][V][tuya:383]: Sending Tuya: CMD=0x00 VERSION=0 DATA=[] INIT_STATE=3
[00:40:17][D][uart_debug:114]: >>> 55:AA:00:00:00:00:FF
[00:40:17][V][tuya:120]: Received Tuya: CMD=0x00 VERSION=0 DATA=[01] INIT_STATE=3
[00:40:17][V][tuya:148]: MCU Heartbeat (0x01)
[00:40:17][D][uart_debug:114]: <<< 55:AA:00:00:00:01:01:01
and the heartbeat response is 55:AA:00:00:00:01:01:01 - found in the docs here.
It looks like they are for some reason using Bluetooth protocol for WiFi module?
But ESPHome seems to work even with incomplete init state. What could happen if I keep it running like this? Won't ESPHome complain after some time or something? Would it be possible to implement this too?
However the main problem is, my motor has ~~swapped close and stop command~~ completely swapped commands. It should be:
close: 0
open: 1
stop: 2
I was able to find this - it says legacy only, so maybe my TuyaMCU uses some kind of legacy protocol?
And here I was able to query my datapoints using Tuya API, which is great, after finding many posts about how people do it by trial / error:
{
"result": {
"category": "cl",
"functions": [
{
"code": "mach_operate",
"dp_id": 102,
"type": "Enum",
"values": "{\"range\":[\"ZZ\",\"FZ\",\"STOP\"]}"
},
{
"code": "opposite",
"dp_id": 103,
"type": "Boolean",
"values": "{}"
},
{
"code": "position",
"dp_id": 101,
"type": "Integer",
"values": "{\"unit\":\"%\",\"min\":0,\"max\":100,\"scale\":0,\"step\":1}"
}
],
"status": [
{
"code": "opposite",
"dp_id": 103,
"type": "Boolean",
"values": "{}"
},
{
"code": "mach_operate",
"dp_id": 102,
"type": "Enum",
"values": "{\"range\":[\"ZZ\",\"FZ\",\"STOP\"]}"
},
{
"code": "position",
"dp_id": 101,
"type": "Integer",
"values": "{\"unit\":\"%\",\"min\":0,\"max\":100,\"scale\":0,\"step\":1}"
}
]
},
"success": true,
"t": 1664316569647
}
Let me know if you need anything else. Thank you!