Reference the Level value to determine state when state is "unknown"
New user here, - just started the trial, will likely buy a license in a few days... :-)
You have a KB article referring to why some tiles show a question mark instead of the correct state of a switch device. Following that article, I have established that just as you suggested, the device handler for the device in question is not updating the state value, but is only updating the level value... - I've logged this with the dev's for the device handler in question, and hopefully they'll update it to write the state as well as the level. However, it occurred to me that you could probably handle this condition in a smarter way... - if state in ST is "unknown" for a switch device, then why not check the level value as well, and deduce the state from that - it's easy enough: if $level=0 then $state=off, if $level>0 then $state=on.
Then you won't have to deal with users asking "why the question mark" again... :-)
Cheers
Paul G.
Answer
Hi Paul,
There could be several reasons for the question mark to appear in the tile. For switch in particular, the value could be known, but unexpected or nonconforming to the API (f.e. "turning on", "mostly on"). This value is not necessarily linked with Switch Level value and we can't make any assumption about Switch state based on the Level.
If the switch is unreachable, but reports a switch level of 80%, we can't assume that the switch is "on".
Thanks
Alex
Customer support service by UserEcho
Hi Paul,
There could be several reasons for the question mark to appear in the tile. For switch in particular, the value could be known, but unexpected or nonconforming to the API (f.e. "turning on", "mostly on"). This value is not necessarily linked with Switch Level value and we can't make any assumption about Switch state based on the Level.
If the switch is unreachable, but reports a switch level of 80%, we can't assume that the switch is "on".
Thanks
Alex