Created
February 16, 2021 00:50
-
-
Save thoraxe/61d1cc27a790ede1ac1e2172114f7f1d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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