Skip to content

Commit

Permalink
add 3 different Control switches
Browse files Browse the repository at this point in the history
  • Loading branch information
basnijholt committed Oct 25, 2023
1 parent 745bf8b commit 698003e
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions automations/control_switches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -475,3 +475,74 @@
sequence:
service: light.turn_off
entity_id: light.guest_room

- alias: "Control switches: Guest Room Light"
mode: parallel
trigger:
platform: mqtt
topic: "zigbee2mqtt/Smart Switch (Guest Room)"
variables:
action: "{{ trigger.payload_json.action }}"
action:
choose:
# Toggle
- conditions: "{{ action == 'single' }}"
sequence:
service: light.toggle
data:
entity_id: light.guest_room

- alias: "Control switches: Baby Room Light"
mode: parallel
trigger:
platform: mqtt
topic: "zigbee2mqtt/Smart Switch (Baby Room)"
variables:
action: "{{ trigger.payload_json.action }}"
action:
choose:
# Toggle light
- conditions: "{{ action == 'single' }}"
sequence:
service: light.toggle
data:
entity_id:
- light.baby_room_lights

# Toggle sleep mode
- conditions: "{{ action == 'double' }}"
sequence:
service: switch.toggle
entity_id: switch.adaptive_lighting_sleep_mode_baby_room

- alias: "Control switches: Mid Room Changing Table Light"
mode: parallel
trigger:
platform: mqtt
topic: "zigbee2mqtt/Smart Switch (Mid Room)"
variables:
action: "{{ trigger.payload_json.action }}"
action:
choose:
# Toggle
- conditions: "{{ action == 'single' }}"
sequence:
service: light.toggle
data:
entity_id: light.mid_room
brightness_pct: 100
rgb_color: [255, 15, 38]

# Change brightness
- conditions: "{{ action == 'double' }}"
sequence:
service: script.increase_brightness
data:
group: light.mid_room

# Next colors
- conditions: "{{ action == 'hold' }}"
sequence:
service: script.next_colors
data:
input_select: input_select.last_script_living_room

0 comments on commit 698003e

Please sign in to comment.