Created
July 1, 2026 12:42
-
-
Save Gr8z/2421456145ce7c03d44942b5375aa2d0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| blueprint: | |
| name: Aqara H2 Wireless Switch (2 gang) — 2 Lights (Z2M MQTT) | |
| description: > | |
| Two lights via Aqara H2 wireless 2-gang switch over Zigbee2MQTT (raw MQTT trigger). | |
| Left rocker → Light 1, Right rocker → Light 2. | |
| • Single click → toggle on/off | |
| • Double click → step brightness up 25% (clamps at 100%) | |
| Setup: enter topic zigbee2mqtt/<friendly name>; set click_mode = "multi" in Z2M. | |
| domain: automation | |
| input: | |
| mqtt_topic: | |
| name: MQTT topic | |
| description: "e.g. zigbee2mqtt/H2 Switch Living Room" | |
| selector: | |
| text: | |
| light_left: | |
| name: Light 1 (Left rocker) | |
| selector: | |
| target: | |
| entity: | |
| domain: light | |
| light_right: | |
| name: Light 2 (Right rocker) | |
| selector: | |
| target: | |
| entity: | |
| domain: light | |
| dim_step: | |
| name: Brightness step per double-click (%) | |
| default: 25 | |
| selector: | |
| number: | |
| min: 5 | |
| max: 50 | |
| step: 5 | |
| unit_of_measurement: "%" | |
| mode: queued | |
| max: 10 | |
| max_exceeded: silent | |
| trigger: | |
| - platform: mqtt | |
| topic: !input mqtt_topic | |
| variables: | |
| action: "{{ trigger.payload_json.action }}" | |
| dim_step: !input dim_step | |
| condition: | |
| - "{{ trigger.payload_json.action is defined and trigger.payload_json.action not in [None, ''] }}" | |
| action: | |
| - choose: | |
| # ---------------- LEFT ROCKER → Light 1 ---------------- | |
| - conditions: "{{ action == 'single_left' }}" | |
| sequence: | |
| - service: light.toggle | |
| target: !input light_left | |
| - conditions: "{{ action == 'double_left' }}" | |
| sequence: | |
| - service: light.turn_on | |
| target: !input light_left | |
| data: | |
| brightness_step_pct: "{{ dim_step }}" | |
| transition: 0.4 | |
| # ---------------- RIGHT ROCKER → Light 2 ---------------- | |
| - conditions: "{{ action == 'single_right' }}" | |
| sequence: | |
| - service: light.toggle | |
| target: !input light_right | |
| - conditions: "{{ action == 'double_right' }}" | |
| sequence: | |
| - service: light.turn_on | |
| target: !input light_right | |
| data: | |
| brightness_step_pct: "{{ dim_step }}" | |
| transition: 0.4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment