Created
April 3, 2016 22:12
-
-
Save fearoffish/9a5274ed8c1e48c75eeb67058729a087 to your computer and use it in GitHub Desktop.
Home Assistant Config Example - Motion detected lights (for 10 mins) with a 'manual mode' toggle that stops them turning off
This file contains hidden or 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
# Input boolean for deactivating the script that turns off the lights after no movement for 10 mins | |
input_boolean: | |
living_room_light_manual_mode: | |
name: Living Room Lights Manual Mode | |
initial: off | |
# Automation: When there is motion in the living room, activate a script to turn on the lights (shown next) | |
- alias: Turn on living room lights when there is movement | |
trigger: | |
- platform: state | |
entity_id: binary_sensor.living_room_sensor_12 | |
to: 'on' | |
action: | |
service: homeassistant.turn_on | |
entity_id: script.timed_living_room_light | |
# Script: Turn on the lights, and activate a timer that will fire an event after ten minutes | |
# The event is a custom string that we will use in the next automation | |
living_room_light_timer: | |
alias: "Turn off living room light after 10 minutes" | |
sequence: | |
- delay: | |
minutes: 10 | |
- event: living_room_motion.false | |
# Automation: Pick up the event 'living_room_motion.false' | |
# Unless the input boolean for manual living room lights mode is on | |
# Turn off the lights | |
- alias: "Turn off the living room light if manual mode is not on" | |
trigger: | |
platform: event | |
event_type: living_room_motion.false | |
condition: | |
- platform: state | |
entity_id: input_boolean.living_room_light_manual_mode | |
state: 'off' | |
action: | |
service: homeassistant.turn_off | |
entity_id: light.living_room |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment