iRayanKhan / homebridge-tuya

A Homebridge plugin to control Tuya devices locally.
MIT License
394 stars 164 forks source link

Getting wrong status on master power button for power strip #29

Closed explorador closed 4 years ago

explorador commented 5 years ago

master switch (dps: 6) is getting a value of 0 and homekit always says it's off when I close/reopen the app. This is the output when master switch is on: { devId: 'xxxxxxxxxxxxxxxxxxxxx', dps: { '1': true, '2': true, '3': true, '4': true, '5': true, '6': 0 } } Output when master switch is off: { devId: 'xxxxxxxxxxxxxxxxxxxxx', dps: { '1': false, '2': false, '3': false, '4': false, '5': false, '6': 0 } }

codetheweb commented 5 years ago

What does your config.json look like?

explorador commented 5 years ago
"platforms": [
    {
        "platform": "TuyaPlatform",
        "name": "TuyaPlatform",
        "devices": [
            {
                "name": "Power Strip",
                "id": "xxxxxxxxxxxxxxxxxxxxx",
                "key": "xxxxxxxxxxxxxxxxxxxxx",
                "ip": "xxxxxxxxxxxxxxxxxxxxx",
                "options": {
                    "dps": 6
                }
            }
        ]
    }
]
explorador commented 5 years ago

Power strip turns on/off fine, the status is just wrong

codetheweb commented 5 years ago

It doesn't look to me like DPS 6 actually controls anything... have you tried other DPS indices?

explorador commented 5 years ago

Other DPS are fine. I just tested them out and their status are accurate. DPS 1 - 4 are outlets, DPS 5 is USB, DP6 is master (All-ON/OFF according to the Tuya app). it works fine but status is wrong cause it returns 0 instead of true/false

codetheweb commented 5 years ago

Oh, I see the issue.

There's no single status property for the master switch, it's just whether or not all other properties are set to true.

Unfortunately, in its current state, homebridge-tuya can't really work with devices like this. My recommendation would be to make a scene that turns all properties on and off.

I'll look into adding support for this whenever I next have my one-day hackathon of updating my NPM modules. 😛

codetheweb commented 5 years ago

(I'm copy/pasting this into every open issue and PR.)

This plugin is now deprecated, as I don't have enough time to maintain it along with other TuyAPI related projects. Please use AMoo-Miki's homebridge-tuya-lan plugin instead. (Or, you can continue to use this plugin, but I will not be giving support or adding any new devices.)

I'm sorry about this, but this plugin is taking a disproportionate amount of my time that I believe is better spent making TuyAPI more stable and adding more tools to the ecosystem.

iRayanKhan commented 4 years ago

Closing; inactive thread. If you need support please re-open this issue.