Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 106189

Can I have one automation for switch schedule with both on and off parameters?

$
0
0

I have a turtle tank with basking lights plugged into a smart outlet plug. I would like to lights to turn on at sunrise and turn off at sunset. My current automation will turn lights on but not off :frowning:

Is it possible to get this one automation to do both on and off?

- id: '1634102183865'
  alias: Action - Switch - Schedule - Lucy Tank
  description: ''
  trigger:
  - platform: sun
    event: sunrise
  condition: []
  action:
  - service: switch.turn_on
    target:
      entity_id: switch.lucy_tank
  - wait_for_trigger:
    - platform: sun
      event: sunset
  - service: switch.turn_off
    target:
      entity_id: switch.lucy_tank
  mode: single

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 106189

Trending Articles