I'm using the node-red-contrib-homebridge-automation since month. in the last days I can switch with the hb-control node the lights on and off, but if someone switches the light at the switch, over home bridge or HomeKit, the status change does not arrive node red. the status is the whole time "0".
in former times I could read the status with the hb-status node.
how can I make it work again or even better, how can I directly read the status of Tuya web platform devices? in home bridge it works without problems, but I couldn't find a palette, which does the same in node red, so I chose last year the home bridge automation palette
I use the node-red-contrib-tuya-smart-device to control my Tuya devices. There are a few hoops to jump through to get it working but once going works well.
MQTT would be so nice, but these Tuya device I couldn’t change to tasmota. So I need a solution over Homebridge or node red to get the power status. With that I will bring it into mqtt and can use my light steering again.
Depends on the device but this is a short section of an old function node that does that does the trick;
// Get device current status (Normally only at STARTUP). Note operation === "SET" is default
if (operation === "GET") {
msg.payload = {dps: command_dps, operation: 'get'};
} else {
msg.payload = {dps: command_dps, set: command_value};
}
So to turn on my light the inject node msg.payload would be set to JSON and {"dps": 20, "set": true}
To get the status of a device, in this case a power socket, the payload should be set to {"dps":1,"operation": "get"}. The dps can vary dependant on the device (for the status of a light for example the dps is 20)
If you have been using the device previously then presumably you have the dps codes for the various attributes of the device.