Hook directly into "events"?

Apologies if a stupid question, I tried searching but maybe I used the wrong words. :slight_smile:

Is there a deCONZ/raw Linux way to directly fire “something” (command line software) on a status change, or every time a sensor device publishes data? Is there a place to hook into, or something to spy on?

I am running headless Pies with both Conbee II and Raspbee II, and I want to gather sensor data and process them with my own code. In a previous world I did this with a 433 MHz system, and there the decoded data from the listening hardware was exposed as some /dev/ resource, so I could just loop and snoop on that. Right now I am polling the deCONZ API, but this seems inefficient and is not near-realtime and loses stuff if status changes on/off between polling, and to detect changes I will have to keep track of status locally. While API polling is certainly doable, I’m wondering if there is a smarter way to do this.

I am not really interested in using HASS, or anything that requires a GUI on the Pies.

You can build something out of GitHub - Kane610/deconz: Python library wrapping deconz rest api for home-assistant or use home assistant

Using the websocket connexion is not enought ? But more “raw” than the python lib ^^

1 Like

Thanks. I had completely missed the websockets API. Also, researching that, I found the rules mechanism and that it seemingly could trigger any URL, which potentially also can solve this problem. Will research and hopefully report back some other day. Again, thanks! :slight_smile: