tuya-local
tuya-local copied to clipboard
[Feature]: add support for roller blinds (probably equal to curtain / cover) support through Gateways (sub-devices)
EDIT: I have this working using a fork of localtuya and shared my setup-details here
I'd like to ask for roller-blind support to be added to tuya-local.
The roller-blind-motors used are branded by enjoy Motors and connect wirelessly (RF 433) to a Gateway (GW03 / GWE) as sub-devices.
~~Currently I am having issues adding the Gateway with the following error:~~
~~Unable to connect to your device with those details. It could be an intermittent issue, or they may be incorrect. and a log entry like this~~
~~However I tried the pytuya_test.py which I found on another thread on Github (tuya local) script using host, device_id, local_key, cid and protocol 3.3 to receive the following results (so I guess it should work somehow):~~
Information on the devices:
Gateway:
{
"result": {
"active_time": 1652034750,
"category": "wg2",
"category_name": "Gateway",
"create_time": 1652034750,
"gateway_id": "",
"icon": "smart/icon/ay1521165954459sVl6M/5bd48aa970b762f6bf4687af1f52a2da.png",
"id": "bf4XXXXXXXXXXXXXXXX4vw",
"ip": "XXX.XXX.XXX.XXX",
"lat": "00.0000",
"local_key": "XXXXXXXXXXX",
"lon": "0.0000",
"model": "GW02,GW03",
"name": "Gateway ",
"online": true,
"owner_id": "XXXXXXXX",
"product_id": "q3rrd31ntit0m2fw",
"product_name": "Gateway.e ",
"sub": false,
"time_zone": "+02:00",
"update_time": 1652136529,
"uuid": "a96XXXXXXXXXX0f8"
},
}
Motor (subdevice => true, cid === node_id => 0CXXXX ):
{
"result": {
"active_time": 1652036263,
"category": "cl",
"category_name": "Curtain",
"create_time": 1652036263,
"gateway_id": "bf4XXXXXXXXXXXXXXXX4vw",
"icon": "smart/icon/ay1521165954459sVl6M/95ef6a9e597c0700f6898944e7132ed3.png",
"id": "bf7XXXXXXXXXXXXXXXXynd",
"ip": "",
"lat": "00.0000",
"local_key": "7c4ba6e0d1577749",
"lon": "0.0000",
"model": "GW Motor",
"name": "TESTROOM",
"node_id": "0CXXXX",
"online": true,
"owner_id": "XXXXXXXX",
"product_id": "slrxhmozdm3qq9cl",
"product_name": "Roller blind",
"sub": true,
"time_zone": "+02:00",
"update_time": 1652036305,
"uuid": "bf7XXXXXXXXXXXXXXXXynd"
},
}
Motor Device Specification:
{
"result": {
"category": "cl",
"functions": [
{
"code": "control",
"lang_config": {
"close": "DOWN",
"open": "UP",
"stop": "STOP"
},
"name": "Curtain control",
"type": "Enum",
"values": "{\"range\":[\"open\",\"stop\",\"close\",\"continue\"]}"
},
{
"code": "percent_control",
"lang_config": {
"unit": "percentage"
},
"name": "Favorite position",
"type": "Integer",
"values": "{\"unit\":\"%\",\"min\":0,\"max\":100,\"scale\":0,\"step\":1}"
}
],
"status": [
{
"code": "control",
"lang_config": {
"close": "DOWN",
"open": "UP",
"stop": "STOP"
},
"name": "Curtain control",
"type": "Enum",
"values": "{\"range\":[\"open\",\"stop\",\"close\",\"continue\"]}"
},
{
"code": "percent_control",
"lang_config": {
"unit": "percentage"
},
"name": "Favorite position",
"type": "Integer",
"values": "{\"unit\":\"%\",\"min\":0,\"max\":100,\"scale\":0,\"step\":1}"
}
]
},
}
...and from the debugger:
code: control, type enum, values:
{
"range": [
"open",
"stop",
"close",
"continue"
]
}
code: percent_control, type Integer, values:
{
"unit": "%",
"min": 0,
"max": 100,
"scale": 0,
"step": 1
}
Roller blinds should be cover devices, the same as curtains or garage doors that are already supported. However, the underlying tuya library does not currently support gateways and sub devices, so that will be a blocking point for this particular device for now.
The details given do not include any local protocol details, so this issue will be closed with the addition of general subdevice support.