Schedule switch

Only if you set the time_pattern trigger to that small. You could set it to 1 minute and be fine.


Also, Any of this could all be avoided with a template binary_sensor. It will handle start ups and shutdowns properly and always turn the lights on between that range.

sensor:
- platform: time_date
  display_options:
    - 'time'

binary_sensor:
- platform: template
  sensors:
    light_helper:
      entity_id: sensor.time
      value_template: >
        {{ not ('06:00' <= states('sensor.time') <= '21:00') }}

automation:
- alias: Turn on/off light
  trigger:
  - platform: state
    entity_id: binary_sensor.light_helper
  action:
  - service_template: light.turn_{{ trigger.to_state.state }}
    entity_id: light.xxxx
1 Like