Is there a way to listen for when the state changes on a light?
I’m wondering if there’s a WebHook or some LAN protocol method of listening to a light for when that light’s state changes.
I thought about this for a while, and I believe; when the light’s state changes, it actually sends a web request to LIFX telling it the latest state. That’s how the LIFX HTTP API quickly knows the state of each light.
I would like this functionality myself because there’s no official way to turn on and off a scene. Because of this, I’m pinging the lights over the LAN protocol, grabbing their state, and then telling them to change their state.
This process isn’t immediate. It’d be better to have my own data store of light states and calculate scene states based on that data. Pretty sure that’s how LIFX does it, so I’d like the same solution myself.
Is this something people have done before? Is there an official solution?