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?
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.