Skip to content

Instantly share code, notes, and snippets.

@devjourney
Created February 13, 2025 15:41
Show Gist options
  • Save devjourney/eec376f86b5947cc9650132792403ab6 to your computer and use it in GitHub Desktop.
Save devjourney/eec376f86b5947cc9650132792403ab6 to your computer and use it in GitHub Desktop.
A Home Assistant automation to have several switches follow the on-off state of another switch.
alias: Office Lights - Follow Moulding Lights
triggers:
- entity_id:
- switch.ofc_moulding_lights
from: "on"
to: "off"
trigger: state
- entity_id:
- switch.ofc_moulding_lights
from: "off"
to: "on"
trigger: state
actions:
- target:
entity_id:
- switch.ofc_power_strip_ofc_floor_lamp
- switch.ofc_power_strip_ofc_led_switch
- switch.ofc_desk_leds
action: switch.turn_{{ trigger.to_state.state }}
mode: single
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment