input_boolean: lights_needed: name: Lights needed initial: false automation: - alias: lights_needed mode: single trigger: - platform: time_pattern minutes: "10" action: - if: - condition: or conditions: - condition: sun after: sunset - condition: sun before: sunrise then: - service: input_boolean.turn_on target: entity_id: input_boolean.lights_needed else: - service: input_boolean.turn_off target: entity_id: input_boolean.lights_needed