Closed owl770 closed 2 years ago
Did you try setting the "autoUpdate=false" on the item? Then the item state should only change after a response from the device was received. But you are correct, a device that is not ONLINE should not accept a command either.
It's not possible to return a "failed" state if the device is not connected. The best we can do is log a warning.
Not sure of the implications of this suggestion but could you set the item state to NULL or UNDEFINED if the associated thing is offline (or can it only be ON or OFF)?
Hi. I am using version 3.2.12 of the SmartHome/J Tuya Binding and have a question about the relationship between a tuyaDevice THING and its linked switch ITEM. As far as I can tell, with a tuya smart switch there is normally a 1-to-1 relationship between the tuyaDevice THING and the switch ITEM but I know this is not always the case.
If the tuyaDevice THING is not ONLINE (so OFFLINE or UNINITIALIZED) you can still turn the switch ITEM ON and OFF - no error is raised (that I can see). Is this intentional? You can think you have turned the switch ON but because the underlying THING is not ONLINE, the switch is actually OFF. Hope that makes sense.
It would be good if there was an error of some kind so that the situation could be detected and handled in some way. I am using Rules DSL and from what I can see it is not possible to go from the ITEM UID to the THING UID to determine if the THING is ONLINE or not (no access to the ItemChannelLinkRegistry in Rules DSL).