This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
HomeyScript
Stateless virtual device
HomeyRun
Member
When a virtual device (light) is created both tags "Turned on" and "Dim level" have no value assigned.
As soon as I toggle the switch the virtual device has a state and the Turned on tag has a value.
I my case I need to get rid of the state. Is there a way with i.e. homeyscript to assign a NULL value to
a device tag or reset the virtual device to stateless again?
Tagged:
Comments
This was my use-case from the other topic:
Simple virtual device (switch) since Buttons are not supported by Alexa.
If switch is turned on - sent command to receiver to be switched on
If switch is turned off - sent command to receiver to be switched off
easy.
Now, the Hifi can be turned on/off manually. Which results in the switch being switched off manually and if set to off by Alexa, it doesn't trigger. It was already turned off and visa versa. The virtual switch and the state of the device are no longer in sync.
I thought, lets use my power meter to detect whether the device is actually on. But then I get into loops and all kind of issues.
How did you guys do it?
When do I make the device stateless(null). In what situation/flow.