Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Light off at sunrise
blueprint:
name: Lights Off At Sunrise
description: Turn off the following lights shortly after sunrise
domain: automation
input:
# Create a variable for identifying the light to act upon
target_light:
name: Lights
description: This is the light (or lights) that will be activated at sunset
# Use a selector, to pick the light(s)
selector:
target:
entity:
domain: light
# Prevent the automation from running concurrently
mode: single
# Define the variables used in the action section
variables:
target_light: !input target_light
# Define the trigger for the automation
trigger:
# Using the state of the sun to act as the trigger
platform: state
entity_id: sun.sun
# We only need to act once the sun drops fully below the horizon, so looking for it to change to this state
to: above_horizon
# This section will take action on the lights, and turn them off
action:
# A very simple structure of turning off the selected light(s)
- service: light.turn_off
target: !input target_light
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment