I'd like to respond to events from a ZGP (Tap) switch. From what I read in the API documentation, I'll have to poll by routinely GETing the sensor and looking for a buttonevent
in the state description.
Certainly there's a better way. Has anyone found a way to add callbacks to a Hue bridge or any other technique to avoid constant polling?
There are local events now as part of the v2 Hue API (login required). The events are sent through server-sent events protocol under /eventstream endpoint.
curl --insecure -N -H 'hue-application-key: <appkey>' -H 'Accept: text/event-stream' https://<ipaddress>/eventstream/clip/v2