Home-AssistantConfig/config/automation/good_night.yaml

93 lines
2.5 KiB
YAML
Raw Normal View History

2018-01-02 00:00:45 +00:00
######################################################################
## Good night Routine
######################################################################
- alias: 'Good Night Trigger'
2020-07-20 18:33:03 +00:00
id: 26846f7b-bc76-43d2-99be-af552da7700f
2018-01-02 00:00:45 +00:00
trigger:
- platform: state
entity_id: input_boolean.good_night
to: 'on'
from: 'off'
- platform: state
entity_id:
- binary_sensor.sleepnumber_carlo_carlo_is_in_bed
- binary_sensor.sleepnumber_carlo_stacey_is_in_bed
to: 'on'
condition:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
- condition: time
after: "15:00:00"
before: "04:00:00"
2018-01-02 00:00:45 +00:00
- condition: state
entity_id: input_boolean.guest_mode
state: 'off'
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.sleepnumber_carlo_carlo_is_in_bed
state: 'on'
- condition: state
entity_id: person.carlo
state: 'not_home'
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.sleepnumber_carlo_stacey_is_in_bed
state: 'on'
- condition: state
entity_id: person.stacey
state: 'not_home'
2018-01-02 00:00:45 +00:00
action:
- service: input_boolean.turn_off
entity_id: input_boolean.good_night
- service: homeassistant.turn_off
2020-10-03 20:07:29 +00:00
entity_id: group.outdoor_seasonal
- service: homeassistant.turn_off
entity_id: switch.kitchen_accent_2
- service: homeassistant.turn_off
entity_id: group.master_bathroom_accents
2018-01-02 00:00:45 +00:00
- service: script.interior_off
- wait_template: "{{ states.media_player.master_bedroom.state == 'standby' }}"
timeout: '00:30:00'
- service: homeassistant.turn_off
entity_id: group.landscaping
2021-07-26 20:16:49 +00:00
- alias: 'Bed Presence AMP Trigger'
id: 26846f7b-bc76-43d2-99be-af552d2300f
trigger:
- platform: state
entity_id:
- binary_sensor.sleepnumber_carlo_carlo_is_in_bed
- binary_sensor.sleepnumber_carlo_stacey_is_in_bed
to: 'on'
id: "in_bed"
- platform: state
2021-07-27 14:17:30 +00:00
entity_id: group.bed
2021-07-26 20:16:49 +00:00
to: 'off'
id: "out_of_bed"
action:
choose:
- alias: "SomeOne in Bed"
2021-07-27 14:17:30 +00:00
conditions:
- condition: trigger
id: in_bed
2021-07-26 20:16:49 +00:00
sequence:
- service: homeassistant.turn_off
target:
entity_id: switch.lr_amp
default:
- service: homeassistant.turn_on
target:
entity_id: switch.lr_amp