Advertisement
chadbaldwin

Home Assistant: Sample schedule on/off automation

Jan 31st, 2023 (edited)
1,146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.34 KB | None | 0 0
  1. alias: Cancer Lamp
  2. description: ""
  3. trigger:
  4.   - platform: state
  5.     entity_id:
  6.      - schedule.cancer_lamp
  7. condition:
  8.   - condition: template
  9.     value_template: "{{ trigger.to_state.state in ['on', 'off'] }}"
  10. action:
  11.   - service: switch.turn_{{ trigger.to_state.state }}
  12.     target:
  13.       entity_id: switch.outlet_13_switch
  14. mode: single
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement