dresden-elektronik / deconz-rest-plugin

deCONZ REST-API plugin to control ZigBee devices
BSD 3-Clause "New" or "Revised" License
1.9k stars 502 forks source link

[Alarms] Execute custom script when alarm starts or ends (with and w/o fading) #4173

Open Commifreak opened 3 years ago

Commifreak commented 3 years ago

Feature request type

Description

It would be nice to set a script path (sh file) which should be executed on the raspberry when an alarm finishes. Invl. support for fading events (start script at start or end of fading for scenes in alarms)

I want to start mplayer when the light ends fading in the morning.

Considered alternatives

Additional context

acid115 commented 3 years ago

Just use the integrated websocket server. https://dresden-elektronik.github.io/deconz-rest-doc/endpoints/websocket/

With that and a small python server script you can observe every state change or button press. And run commands ...

Commifreak commented 3 years ago

I tried that now - but - there are messages for nearly every event - except for alarms.

https://dresden-elektronik.github.io/deconz-rest-doc/endpoints/websocket/#message-fields

parameter r does not have any item for alarms. I tested it also by adding an alarm and let it trigger. I only see, that the brightness is raising/lowering but not why.

Commifreak commented 3 years ago

Any chance that the websocket announces that as well?

Commifreak commented 3 years ago

BTW: I wrote simple scrips for all of my wanted features: