I have a few Hue dimmer switches that I removed from the Hue bridge and paired directly do Zigbee2MQTT via a Sonoff USB receiver. For now I just want simple on/off/increase/decrease functionality. However, after implementing my Automation, it seems to be very intermittent as to whether it works or not. Here is one of the automations:
alias: Alex Dimmer Switch Actions
description: ""
trigger:
- platform: state
entity_id:
- sensor.alex_dimmer_switch_action
condition: []
action:
- choose:
- conditions:
- condition: template
value_template: "{{trigger.from_state.state == 'up_press_release'}}"
sequence:
- device_id: c46994fbaf2ee3f0c6573aca5e27da85
domain: light
entity_id: light.alex_night_stand
type: brightness_increase
- device_id: 627ae3f2a53547bf1922d188339d9fcb
domain: light
entity_id: light.alex_shelf
type: brightness_increase
- conditions:
- condition: template
value_template: "{{trigger.from_state.state == 'down_press_release'}}"
sequence:
- device_id: c46994fbaf2ee3f0c6573aca5e27da85
domain: light
entity_id: light.alex_night_stand
type: brightness_decrease
- device_id: 627ae3f2a53547bf1922d188339d9fcb
domain: light
entity_id: light.alex_shelf
type: brightness_decrease
- conditions:
- condition: template
value_template: "{{trigger.from_state.state == 'off_press_release'}}"
sequence:
- type: turn_off
device_id: c46994fbaf2ee3f0c6573aca5e27da85
entity_id: light.alex_night_stand
domain: light
- type: turn_off
device_id: 627ae3f2a53547bf1922d188339d9fcb
entity_id: light.alex_shelf
domain: light
- conditions:
- condition: template
value_template: "{{trigger.from_state.state == 'on_press_release'}}"
sequence:
- type: turn_on
device_id: c46994fbaf2ee3f0c6573aca5e27da85
entity_id: light.alex_night_stand
domain: light
- type: turn_on
device_id: 627ae3f2a53547bf1922d188339d9fcb
entity_id: light.alex_shelf
domain: light
mode: single
This room has two Sengled bulbs and the automation just needs to control those two lights.