homebridge/homebridge-config-ui-x

Tuya/SmartLife Ceiling Fan Controller (FSD) Support

UberEclectic opened this issue · 2 comments

Feature Description

I added a new Tuya/SmartLife Ceiling Fan Controller (FSD) and was surprised that I am not getting a HomeKit accessory added.
I noticed that in the Homebridge UI -> Accessories screen, the fan doesn't show there either, so is it the case that this particular kind of fan + light combo is not yet supported?

To provide context w.r.t. the different types of controls on this composite device, here is a visual of the Smart Life app controls:
IMG_0327

Here are some logs from the homebridge-tuya-platform plugin, showing its sending device information and state change requests, which AFAICT are completely ignored by Homebridge:

TuyaOpenMQ onMessage: topic = cloud/token/in/**redacted**, message = {"protocol":4,"data":{"devId":"eb2347163b32527c6byj9n","dataId":"447833e2-41fd-4975-b565-dcfa6a3ddde0","productKey":"puj7wgpctcgpn70b","status":[{"60":true,"code":"fan_switch","t":1702687150,"value":true}]},"t":1702687150,"pv":"2.0","sign":"cd14ced7e9cb05bd595e6a2ff284a783"}
TuyaOpenMQ onMessage: topic = cloud/token/in/**redacted**, message = {"protocol":4,"data":{"devId":"eb2347163b32527c6byj9n","dataId":"7c5ef505-65a4-4920-8682-8539ba7cebc9","productKey":"puj7wgpctcgpn70b","status":[{"62":1,"code":"fan_speed","t":1702687155,"value":1}]},"t":1702687155,"pv":"2.0","sign":"c5d5c05f2c3739d725dcca9693f20933"}
TuyaOpenMQ onMessage: topic = cloud/token/in/**redacted**, message = {"protocol":4,"data":{"devId":"eb2347163b32527c6byj9n","dataId":"c0e28d3f-e774-49ed-b3e1-7548167736d9","productKey":"puj7wgpctcgpn70b","status":[{"62":2,"code":"fan_speed","t":1702687156,"value":2}]},"t":1702687156,"pv":"2.0","sign":"942f57e24c3cfd01485f504015fe5474"}
TuyaOpenMQ onMessage: topic = cloud/token/in/**redacted**, message = {"protocol":4,"data":{"devId":"eb2347163b32527c6byj9n","dataId":"58b5ada6-875f-43e1-9499-be7ac6af05b8","productKey":"puj7wgpctcgpn70b","status":[{"62":3,"code":"fan_speed","t":1702687157,"value":3}]},"t":1702687157,"pv":"2.0","sign":"e41758fb4bdd8c01cd416679556f0149"}
TuyaOpenMQ onMessage: topic = cloud/token/in/**redacted**, message = {"protocol":4,"data":{"devId":"eb2347163b32527c6byj9n","dataId":"1cd8c92f-0a87-41a7-9916-b40326b765ae","productKey":"puj7wgpctcgpn70b","status":[{"60":false,"code":"fan_switch","t":1702687159,"value":false}]},"t":1702687159,"pv":"2.0","sign":"9e31314995beadbb3e891c486a0076df"}
TuyaOpenMQ onMessage: topic = cloud/token/in/**redacted**, message = {"protocol":4,"data":{"devId":"eb2347163b32527c6byj9n","dataId":"30c1ef92-0058-4498-8ac1-6d16d96f9e1e","productKey":"puj7wgpctcgpn70b","status":[{"20":true,"code":"switch_led","t":1702687161,"value":true}]},"t":1702687161,"pv":"2.0","sign":"e0da152b6c30a2b864f13cc4e9036cf8"}
TuyaOpenMQ onMessage: topic = cloud/token/in/**redacted**, message = {"protocol":4,"data":{"devId":"eb2347163b32527c6byj9n","dataId":"89aa26b9-fcc4-428b-ad89-c573d950f998","productKey":"puj7wgpctcgpn70b","status":[{"22":43,"code":"bright_value","t":1702687166,"value":43}]},"t":1702687166,"pv":"2.0","sign":"4a79a48fbe6ca546cff9e08fd8d60c7e"}
TuyaOpenMQ onMessage: topic = cloud/token/in/**redacted**, message = {"protocol":4,"data":{"devId":"eb2347163b32527c6byj9n","dataId":"4bf6ad60-27d5-4a3d-a59b-f19cec1c1cee","productKey":"puj7wgpctcgpn70b","status":[{"22":100,"code":"bright_value","t":1702687169,"value":100}]},"t":1702687169,"pv":"2.0","sign":"613759e61eb59b1fc38d84afc7deda37"}
TuyaOpenMQ onMessage: topic = cloud/token/in/**redacted**, message = {"protocol":4,"data":{"devId":"eb2347163b32527c6byj9n","dataId":"c3390f71-6c4f-4ce3-8cd2-9181d7c4af01","productKey":"puj7wgpctcgpn70b","status":[{"23":2,"code":"temp_value","t":1702687171,"value":2}]},"t":1702687171,"pv":"2.0","sign":"01dbb3277aa11cf0926ca06c2cc7791d"}
TuyaOpenMQ onMessage: topic = cloud/token/in/**redacted**, message = {"protocol":4,"data":{"devId":"eb2347163b32527c6byj9n","dataId":"093543b4-e679-4a27-ac98-f5c5ef7cc24f","productKey":"puj7wgpctcgpn70b","status":[{"23":3,"code":"temp_value","t":1702687173,"value":3}]},"t":1702687173,"pv":"2.0","sign":"605be9a09f8d3c9d2c98f9e5af94914b"}
TuyaOpenMQ onMessage: topic = cloud/token/in/**redacted**, message = {"protocol":4,"data":{"devId":"eb2347163b32527c6byj9n","dataId":"ba931224-5ec4-4aba-ad87-bad28966386b","productKey":"puj7wgpctcgpn70b","status":[{"20":false,"code":"switch_led","t":1702687175,"value":false}]},"t":1702687175,"pv":"2.0","sign":"36c2a5f822d2d5fa834e60af3057de4a"}
TuyaOpenMQ onMessage: topic = cloud/token/in/**redacted**, message = {"protocol":4,"data":{"devId":"eb2347163b32527c6byj9n","dataId":"be2b9150-91c0-43b4-876a-34ab72412af9","productKey":"puj7wgpctcgpn70b","status":[{"60":true,"code":"fan_switch","t":1702687180,"value":true}]},"t":1702687180,"pv":"2.0","sign":"a5c87f903d1c70ca02929c108853d680"}
TuyaOpenMQ onMessage: topic = cloud/token/in/**redacted**, message = {"protocol":4,"data":{"devId":"eb2347163b32527c6byj9n","dataId":"1a37b573-de7c-4596-bce0-6739ab7ebf0b","productKey":"puj7wgpctcgpn70b","status":[{"62":2,"code":"fan_speed","t":1702687183,"value":2}]},"t":1702687183,"pv":"2.0","sign":"1f5c7d0b4753d20f26e7b08fc6bb0475"}
TuyaOpenMQ onMessage: topic = cloud/token/in/**redacted**, message = {"protocol":4,"data":{"devId":"eb2347163b32527c6byj9n","dataId":"0e1707c3-1986-4bd4-97c5-d6b3c0c88ad7","productKey":"puj7wgpctcgpn70b","status":[{"62":1,"code":"fan_speed","t":1702687184,"value":1}]},"t":1702687184,"pv":"2.0","sign":"d962e4e6a550a44844dbbe85d0daaba7"}
TuyaOpenMQ onMessage: topic = cloud/token/in/**redacted**, message = {"protocol":4,"data":{"devId":"eb2347163b32527c6byj9n","dataId":"76c39fc5-858c-477c-a2ea-79bc2a2fe200","productKey":"puj7wgpctcgpn70b","status":[{"63":"reverse","code":"fan_direction","t":1702687186,"value":"reverse"}]},"t":1702687186,"pv":"2.0","sign":"63f172dfd67a6f0ec235ad9e60217487"}
TuyaOpenMQ onMessage: topic = cloud/token/in/**redacted**, message = {"protocol":4,"data":{"devId":"eb2347163b32527c6byj9n","dataId":"34f3f7f8-1e3a-4454-8e79-6a3128cad6f1","productKey":"puj7wgpctcgpn70b","status":[{"63":"forward","code":"fan_direction","t":1702687188,"value":"forward"}]},"t":1702687188,"pv":"2.0","sign":"dfe57ab1d97cde1977f7e462f514c90b"}
TuyaOpenMQ onMessage: topic = cloud/token/in/**redacted**, message = {"protocol":4,"data":{"devId":"eb2347163b32527c6byj9n","dataId":"87b1fb65-7c02-4dd3-9e75-49bb896a9ca5","productKey":"puj7wgpctcgpn70b","status":[{"60":false,"code":"fan_switch","t":1702687189,"value":false}]},"t":1702687189,"pv":"2.0","sign":"9c26c0489cfda954f2224ebc6c4e520d"}

Here is a sample payload for the Tuya FSD device type. This is their API, but it gives good hints as to what "knobs" are available for the FSD device type:

[
    {
        "code": "switch_led",
        "value": false
    },
    {
        "code": "bright_value",
        "value": 100
    },
    {
        "code": "temp_value",
        "value": 3
    },
    {
        "code": "fan_switch",
        "value": false
    },
    {
        "code": "fan_speed",
        "value": 1
    },
    {
        "code": "fan_direction",
        "value": "forward"
    },
    {
        "code": "fan_countdown_set",
        "value": "cancel"
    }
]

Here are some further details on the values allowed in the payload:

| Code              | Type    | Values                                                                    |
|-------------------|---------|---------------------------------------------------------------------------|
| switch_led        | Boolean | "{true,false}"                                                            |
| bright_value      | Integer | {   "unit": "",   "min": 1,   "max": 100,   "scale": 0,   "step": 1 }     |
| temp_value        | Integer | {   "unit": "",   "min": 1,   "max": 3,   "scale": 0,   "step": 1 }       |
| fan_switch        | Boolean | "{true,false}"                                                            |
| fan_speed         | Integer | {   "unit": "",   "min": 1,   "max": 3,   "scale": 0,   "step": 1 }       |
| fan_direction     | Enum    | {   "range": [     "forward",     "reverse"   ] }                         |
| fan_countdown_set | Enum    | {   "range": [     "cancel",     "1h",     "2h",     "4h",     "8h"   ] } |

Is support for this type of composite fan + light controller a feature that's been requested before?
Could this be mapped to a standard HomeKit light dimmer, and separate HomeKit Fan or Fanv2 device?

@0x5e Is this issue on your radar?

Solved this by simply stopping (not disable!) my old homebridge-tuya-platform, installed this other version:

https://www.npmjs.com/package/@0x5e/homebridge-tuya-platform

Then checked that my configuration got copied over from the old plugin to the new one.
Then disabled the old version.

Couldn't be easier! Closing this issue!