I need to somehow record, when the light is unplugged. The bridge seems to return the 'last recorded' value. If the light was 'on' before unplugging, it still returns 'on', even after it is unplugged. Absolutely nothing seems to be changing in the output, if the light is unplugged. Any ideas?
Asked
Active
Viewed 534 times
1 Answers
3
Yes, you can check the light's state variable named "reachable". This is set to false when the bridge fails to connect to the light, such as when it is unplugged or when a physical switch cuts the power to the light. As you noted, the other attributes just tell you what the various values were the LAST time the bridge was able to reach the light.
{
"state": {
"on": true,
...
"reachable": false
},
...
}
Additionally, you can use a rule or sensor to monitor the value of that attribute and take some action when it switches from true to false or vice versa.

Ron Reuter
- 1,287
- 1
- 8
- 14
-
Indeed, that is what I was looking for. I noticed that parameter before, but it does not change immediately after the light is unplugged, it does so with a short delay(some 2-3 seconds), that's why I didn't notice the difference firstly – May 08 '16 at 10:34
-
And in 2019, Hue updated its products so that now lights can return to previous state when they are turned back on. This is an optional behavior configurable with the official Hue app. On the bridge, this will show up as "startup": { "mode": "powerfail", "configured": true } – Ron Reuter Feb 21 '20 at 15:44