I have a Xiaomi Aqara window/door sensor. This is
integrated in the Phoscon app without any problems and detects the status open/closed.
The detection is done within milliseconds in the
the Phoscon app. This is very good.
However, I am relatively new to Phoscon and deConz environment.
I am wondering though, how can I trigger an event,
as soon as a change in status is detected? One possibility is to send an REST API call to deConz every second, but this would cause higher cpu usage. Is there a way to trigger state changes from window / door sensors actively? For e.g. Phoscon App indentifies a status change and runs a python script or requests an url with params?
Do I need additional software? I used the deConz REST API to query the state. The query of the temperatures is done every minute. But a window/door sensor may be more time sensitive, because if I open a door, it is very likely that it will be closed again within a minute and thus no change is detected via the API.
I am using:
- Debian Linux (headless)
- Phoscon (web interface)