Rearrange reboot handling automation, add reset of night modes
This commit is contained in:
196
automations.yaml
196
automations.yaml
@ -311,102 +311,118 @@
|
|||||||
- id: '1651787468337'
|
- id: '1651787468337'
|
||||||
alias: Reboot handling
|
alias: Reboot handling
|
||||||
description: ''
|
description: ''
|
||||||
trigger:
|
triggers:
|
||||||
- platform: homeassistant
|
- event: start
|
||||||
event: start
|
|
||||||
id: hass_start
|
id: hass_start
|
||||||
- platform: homeassistant
|
trigger: homeassistant
|
||||||
event: shutdown
|
- event: shutdown
|
||||||
id: hass_stop
|
id: hass_stop
|
||||||
condition: []
|
trigger: homeassistant
|
||||||
action:
|
conditions: []
|
||||||
- if:
|
actions:
|
||||||
- condition: trigger
|
- alias: Routing
|
||||||
id: hass_start
|
choose:
|
||||||
alias: Startup
|
- conditions:
|
||||||
then:
|
- condition: trigger
|
||||||
- delay:
|
id: hass_start
|
||||||
hours: 0
|
alias: Startup
|
||||||
minutes: 1
|
sequence:
|
||||||
seconds: 0
|
- delay:
|
||||||
milliseconds: 0
|
hours: 0
|
||||||
- service: automation.turn_on
|
minutes: 1
|
||||||
data: {}
|
seconds: 0
|
||||||
target:
|
milliseconds: 0
|
||||||
entity_id:
|
- data: {}
|
||||||
- automation.family_has_arrived
|
target:
|
||||||
- automation.family_has_left
|
entity_id:
|
||||||
- automation.scheduled_alarm_rearm
|
- automation.family_has_arrived
|
||||||
- automation.scheduled_alarm_disarm
|
- automation.family_has_left
|
||||||
- service: switch.turn_off
|
- automation.scheduled_alarm_rearm
|
||||||
target:
|
- automation.scheduled_alarm_disarm
|
||||||
entity_id:
|
action: automation.turn_on
|
||||||
- switch.presence_simulation
|
- if:
|
||||||
data: {}
|
|
||||||
- if:
|
|
||||||
- condition: and
|
|
||||||
conditions:
|
|
||||||
- condition: state
|
|
||||||
entity_id: input_boolean.holiday_mode
|
|
||||||
state: 'on'
|
|
||||||
alias: Is holiday mode on?
|
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: binary_sensor.early_night_mode
|
entity_id: binary_sensor.early_night_mode
|
||||||
state: 'on'
|
state: 'off'
|
||||||
alias: Is early night mode on?
|
then:
|
||||||
alias: Test conditions
|
- action: input_boolean.turn_off
|
||||||
then:
|
metadata: {}
|
||||||
- service: switch.turn_on
|
data: {}
|
||||||
|
target:
|
||||||
|
entity_id:
|
||||||
|
- input_boolean.give_me_darkness
|
||||||
|
- input_boolean.night_mode
|
||||||
|
- input_boolean.goodnight
|
||||||
|
alias: If early night mode is off, turn off other night-related modes
|
||||||
|
- target:
|
||||||
|
entity_id:
|
||||||
|
- switch.presence_simulation
|
||||||
data: {}
|
data: {}
|
||||||
|
action: switch.turn_off
|
||||||
|
- if:
|
||||||
|
- condition: and
|
||||||
|
conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: input_boolean.holiday_mode
|
||||||
|
state: 'on'
|
||||||
|
alias: Is holiday mode on?
|
||||||
|
- condition: state
|
||||||
|
entity_id: binary_sensor.early_night_mode
|
||||||
|
state: 'on'
|
||||||
|
alias: Is early night mode on?
|
||||||
|
alias: Test conditions
|
||||||
|
then:
|
||||||
|
- data: {}
|
||||||
|
target:
|
||||||
|
entity_id: switch.animated_scene_{{ states('input_select.holiday_animation')
|
||||||
|
| lower }}
|
||||||
|
alias: Turn on the appropriate animated holiday scene
|
||||||
|
action: switch.turn_on
|
||||||
|
alias: Turn on animated holiday scene if night time and holiday mode is on
|
||||||
|
- data: {}
|
||||||
|
action: script.tony_desktop_refresh
|
||||||
|
- data: {}
|
||||||
|
action: script.tina_desktop_refresh
|
||||||
|
- data: {}
|
||||||
|
action: script.asus_laptop_refresh
|
||||||
|
- data: {}
|
||||||
|
action: script.kallen_desktop_refresh
|
||||||
|
- data: {}
|
||||||
|
action: script.win10vm_refresh
|
||||||
|
- data:
|
||||||
|
topic: house/basement/server/glances
|
||||||
|
payload: restart
|
||||||
|
qos: 0
|
||||||
|
retain: false
|
||||||
|
alias: Restart Glances via MQTT
|
||||||
|
action: mqtt.publish
|
||||||
|
- data: {}
|
||||||
|
alias: Reset all speaker volumes
|
||||||
|
action: script.volume_reset
|
||||||
|
- if:
|
||||||
|
- condition: state
|
||||||
|
entity_id: input_boolean.studio_quiet
|
||||||
|
state: 'off'
|
||||||
|
then:
|
||||||
|
- data:
|
||||||
|
who: basement
|
||||||
|
call_ha_started: 1
|
||||||
|
action: script.status_annc
|
||||||
|
else:
|
||||||
|
- stop: Studio has requested quiet, and Jarvis respects this
|
||||||
|
alias: Announce back online, unless studio has requested quiet
|
||||||
|
- conditions:
|
||||||
|
- condition: trigger
|
||||||
|
id: hass_stop
|
||||||
|
alias: Shutdown
|
||||||
|
sequence:
|
||||||
|
- data:
|
||||||
|
stop_actions: true
|
||||||
target:
|
target:
|
||||||
entity_id: switch.animated_scene_{{ states('input_select.holiday_animation')
|
entity_id:
|
||||||
| lower }}
|
- automation.family_has_arrived
|
||||||
alias: Turn on the appropriate animated holiday scene
|
- automation.family_has_left
|
||||||
alias: Turn on animated holiday scene if night time and holiday mode is on
|
action: automation.turn_off
|
||||||
- service: script.tony_desktop_refresh
|
|
||||||
data: {}
|
|
||||||
- service: script.tina_desktop_refresh
|
|
||||||
data: {}
|
|
||||||
- service: script.asus_laptop_refresh
|
|
||||||
data: {}
|
|
||||||
- service: script.kallen_desktop_refresh
|
|
||||||
data: {}
|
|
||||||
- service: script.win10vm_refresh
|
|
||||||
data: {}
|
|
||||||
- service: mqtt.publish
|
|
||||||
data:
|
|
||||||
topic: house/basement/server/glances
|
|
||||||
payload: restart
|
|
||||||
qos: 0
|
|
||||||
retain: false
|
|
||||||
alias: Restart Glances via MQTT
|
|
||||||
- service: script.volume_reset
|
|
||||||
data: {}
|
|
||||||
alias: Reset all speaker volumes
|
|
||||||
- if:
|
|
||||||
- condition: state
|
|
||||||
entity_id: input_boolean.studio_quiet
|
|
||||||
state: 'off'
|
|
||||||
then:
|
|
||||||
- service: script.status_annc
|
|
||||||
data:
|
|
||||||
who: basement
|
|
||||||
call_ha_started: 1
|
|
||||||
else:
|
|
||||||
- stop: Studio has requested quiet, and Jarvis respects this
|
|
||||||
alias: Announce back online, unless studio has requested quiet
|
|
||||||
- if:
|
|
||||||
- condition: trigger
|
|
||||||
id: hass_stop
|
|
||||||
alias: Shutdown
|
|
||||||
then:
|
|
||||||
- service: automation.turn_off
|
|
||||||
data:
|
|
||||||
stop_actions: true
|
|
||||||
target:
|
|
||||||
entity_id:
|
|
||||||
- automation.family_has_arrived
|
|
||||||
- automation.family_has_left
|
|
||||||
mode: queued
|
mode: queued
|
||||||
- id: '1654547257475'
|
- id: '1654547257475'
|
||||||
alias: Battery Monitoring
|
alias: Battery Monitoring
|
||||||
|
Reference in New Issue
Block a user