Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
11.34k stars 1.62k forks source link

Enable/disable devices using automation script #22773

Open E30M20B20 opened 1 month ago

E30M20B20 commented 1 month ago

Is your feature request related to a problem? Please describe

If I switch some devices on in a pair times a year, I can do this manually using checkbox in device's settings page. But if I have several losses of power supply a day (like I have it now in Kiev), it would be very useful to disable/enable devices automatically when 220V lost/reconnects

Describe the solution you'd like

So I need an instrument to check/uncheck "disable" checkbox at device's settings using automation script, and next is restart z2m using existing feature, and here we go!

Describe alternatives you've considered

Any kind of automatic switch on/off pings to router devices using automation script

Additional context

изображение

ghoz commented 3 weeks ago

Hi Not tested but it might already be possible by sending an mqtt message to zigbee2mqtt/bridge/request/device/options with disabled: true as option

See: https://www.zigbee2mqtt.io/guide/usage/mqtt_topics_and_messages.html#zigbee2mqtt-bridge-request