Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
- alias: Turn on main stairs and landing lights on stair sensor movement
trigger:
platform: state
entity_id: group.stairs_sensors
to: 'on'
action:
- service: light.turn_on
entity_id: light.main_stairs_light
data_template:
brightness: >-
{% if state_attr('sun.sun','elevation') > 3 %}
255
{% else %}
3
{% endif %}
- alias: Turn off downstairs landing lights 30 seconds after bottom sensor clear
trigger:
platform: state
entity_id: binary_sensor.main_stairs_bottom_sensor_occupancy
to: 'off'
for:
seconds: 30
action:
- service: light.turn_off
entity_id: light.downstairs_landing_light
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment