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

With a single Automation, how do you turn lights on between two set times and then the lights off?

$
0
0

@HellfireZA wrote:

Hey guys, so for about a year I’ve been running 2 separate automations below to turn my lights on and off between times and I’d very much like to simply that into a single automation. Can someone point me in the right direction as I can’t seem to find what I need by simply searching?

 - alias: Turn Downstairs Lights on Between 11:00 and 19:00 
    hide_entity: true
    trigger:
      - platform: homeassistant
        event: start
      - platform: time
        at: '11:00:00'
    condition:
    - condition: time
      after: '11:00:00'
      before: '19:00:00'
    action:
      - service: switch.turn_on
        entity_id: switch.lights_ds 
        
  - alias: Turn Downstairs Lights off Between 19:00 and 11:00
    hide_entity: true
    trigger:
      - platform: homeassistant
        event: start
      - platform: time
        at: '19:00:08'
    condition:
      condition: time
      before: '10:59:55'
      after: '19:00:05'
    action:
      - service: switch.turn_off
        entity_id: switch.lights_ds

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 96121

Trending Articles