jurgen-kluft / go-conbee

deconz conbee REST API client in golang
5 stars 7 forks source link

Event based communication #1

Open fasmide opened 4 years ago

fasmide commented 4 years ago

Hi

First off I think this is some really great work and I have been looking for something like this regularly as I also use the Deconz gateway at home. I always end up doing HTTP requests by hand :)

Have your thought about providing an API for event-based sensor data? - Deconz does provide a Websocket endpoint which provides apps with a stream of JSON objects when things change. An issue which I believe will come up is filtering of events, as far as I know, there is no way to have Deconz filter events on the WebSocket endpoint. The go code will have to provide a way of describing which kind of events one would like to receive and then do the filtering...

jurgen-kluft commented 4 years ago

All the credit should go to 'heatxsink', he implemented 'go-hue'. The HUE API and the Conbee API are very similar.

As for filtering, i do plan to write another go package ('go-conbee-state') that uses this package. The goal of 'go-conbee-state' is to provide me with an actual representation of lights, sensors and switches and will thus interact with the Deconz gateway using 'go-conbee'. I agree that it would need user definable configuration so that you can tell the package to look at certain sensors, lights and switches. Is that something that you had in mind, otherwise could you describe in more detail what you are after.