Home-AssistantConfig/config/automation/master_bath_accents.yaml

42 lines
1.5 KiB
YAML
Raw Normal View History

2018-01-02 00:00:45 +00:00
#####################################################################################
### When we get out of bed at night, turn on the accent lights in the bathroom
## and then turn off the lights when we are back in bed.
## Also turn on the lights sunset comes. (but only if we are home)
### connected to [Etekcity Outlets](https://amzn.to/2efNoBP)
## [433Mhz Transmitter and receiver](https://amzn.to/2dceNY2)
2018-01-02 00:00:45 +00:00
#####################################################################################
- alias: Bedtime Accent Light
trigger:
- platform: state
entity_id:
- binary_sensor.sleepnumber_carlo_carlo_is_in_bed
- binary_sensor.sleepnumber_carlo_stacey_is_in_bed
to: 'off'
- platform: state
entity_id: sun.sun
to: 'below_horizon'
from: 'above_horizon'
- platform: state
entity_id: group.family
from: 'not_home'
to: 'home'
condition:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
- condition: state
entity_id: group.family
state: 'home'
action:
- service: switch.turn_on
entity_id: switch.master_bathroom_accent_1
2018-01-02 00:00:45 +00:00
- wait_template: >-
{{ not is_state('binary_sensor.sleepnumber_carlo_stacey_is_in_bed', 'off') or is_state('device_tracker.stacey', 'not_home')}}
2018-01-02 00:00:45 +00:00
- wait_template: >-
{{ not is_state('binary_sensor.sleepnumber_carlo_carlo_is_in_bed', 'off') or is_state('device_tracker.carlo', 'not_home') }}
2018-01-02 00:00:45 +00:00
- service: switch.turn_off
2019-08-17 19:18:36 +00:00
entity_id: group.master_bathroom_accents