Updated config from video on trigger ids

This commit is contained in:
Jeffrey Stone 2021-08-15 16:47:35 -04:00
parent 07a7a8c616
commit 5773d65279
2 changed files with 189 additions and 90 deletions

View File

@ -86,46 +86,95 @@ automation:
# 1. You can test the haunted house piece without kicking having to be on Halloween
# 2. It gives you the ability to kill the show if things go horribly wrong...
#
- id: operation_haunted_house_on
alias: Operation Haunted House On
initial_state: true
# If this_is_halloween switch is turned on then we start the show.
# - id: operation_haunted_house_on
# alias: Operation Haunted House On
# initial_state: true
# # If this_is_halloween switch is turned on then we start the show.
# trigger:
# - platform: state
# entity_id: input_boolean.this_is_halloween
# to: 'on'
# action:
# # First up we play This is Halloween from Nightmare Before Christmas. Change this to what ever audio you want, or comment this one out.
# - service: script.local_audio
# data:
# media: "/media/disney/This_is_Halloween.mp3"
# volume: .5
# # And turn on the haunted House script.
# - service: script.turn_on
# entity_id: script.haunted_house
# # Haunted House Kill Switch. If the this_is_halloween switch is turned off, the stop everything.
# - id: operation_haunted_house_off
# alias: Operation Haunted House Off
# initial_state: true
# trigger:
# - platform: state
# entity_id: input_boolean.this_is_halloween
# to: 'off'
# action:
# # This stops the media player. Besure to change it to match your music player
# - service: media_player.media_stop
# entity_id: media_player.ha_speaker
# # this kills the local_audio script if its running.
# - service: script.turn_off
# entity_id: script.local_audio
# # This kills the youtube audio script if it is running.
# - service: script.turn_off
# entity_id: script.youtube_audio
# # And finally we turn off the haunted house script so no more sounds play.
# - service: script.turn_off
# entity_id: script.haunted_house
- id: operation haunted house
alias: Operation Haunted House
trigger:
# If this_is_halloween switch is turned on then we start the show.
- platform: state
entity_id: input_boolean.this_is_halloween
to: 'on'
from: 'off'
id: start
# If this_is_halloween switch is turned off then we stop the show.
- platform: state
entity_id: input_boolean.this_is_halloween
id: stop
from: 'on'
to: 'off'
action:
# Choose provides decision logic
- choose:
# Start the show
- conditions:
- condition: trigger
id: start
sequence:
# First up we play This is Halloween from Nightmare Before Christmas. Change this to what ever audio you want, or comment this one out.
- service: script.local_audio
data_template:
data:
media: "/media/disney/This_is_Halloween.mp3"
volume: .5
# And turn on the haunted House script.
- service: script.turn_on
target:
entity_id: script.haunted_house
# Haunted House Kill Switch. If the this_is_halloween siwtch is turned off, the stop everything.
- id: operation_haunted_house_off
alias: Operation Haunted House Off
initial_state: true
trigger:
- platform: state
entity_id: input_boolean.this_is_halloween
to: 'off'
action:
# This stops the media player. Besure to change it to match your mecia player
- service: media_player.media_stop
entity_id: media_player.ha_speaker
# this kills the local_audio script if its running.
- service: script.turn_off
entity_id: script.local_audio
# This kills the youtube audio script if it is running.
- service: script.turn_off
entity_id: script.youtube_audio
# Stop the show
- conditions:
- condition: trigger
id: stop
sequence:
# And finally we turn off the haunted house script so no more sounds play.
- service: script.turn_off
target:
entity_id: script.haunted_house
# This stops the media player. Besure to change it to match your music player
- service: media_player.media_stop
target:
entity_id: media_player.ha_speaker
default: []
initial_state: true
mode: single
script:

View File

@ -393,8 +393,8 @@ automation:
#############################################
# Normal Notifications
# Door chime when doors are open to make sure we know when people are coming/going
- id: door_chime
alias: Door Chine
- id: door_notifications
alias: Door Notifications
trigger:
- platform: state
entity_id:
@ -403,6 +403,17 @@ automation:
- binary_sensor.attic_door
- binary_sensor.back_door
to: 'on'
id: chime
- platform: state
entity_id:
- binary_sensor.front_door
- binary_sensor.laundry_room_door
- binary_sensor.attic_door
- binary_sensor.back_door
from: 'off'
to: 'on'
for: '00:01:00'
id: door_still_open
condition:
condition: and
conditions:
@ -421,29 +432,28 @@ automation:
entity_id: media_player.ha_speaker
state: 'off'
action:
- service: script.door_chime
initial_state: true
# If door is open too long play message and identify open door.
- id: door_opened_long
alias: Door Opened Too Long
trigger:
- platform: state
entity_id:
- binary_sensor.front_door
- binary_sensor.laundry_room_door
- binary_sensor.attic_door
- binary_sensor.back_door
from: 'off'
to: 'on'
for: '00:01:00'
condition:
- condition: state
entity_id: input_boolean.audible_notifications
state: 'on'
action:
- service: script.speech_engine
- choose:
- conditions:
- condition: trigger
id: chime
sequence:
- service: media_player.turn_on
entity_id: media_player.ha_speaker
- service: media_player.volume_set
data_template:
entity_id: media_player.ha_speaker
volume_level: .5
- service: media_player.play_media
entity_id: media_player.ha_speaker
data:
media_content_id: /media/sounds/door_open.wav
media_content_type: "music"
- conditions:
- condition: trigger
id: door_still_open
sequence:
- service: script.speech_engine
data:
who: '{{ states.sensor.room_audio.state }}'
message: >
The {{ trigger.to_state.attributes.friendly_name }}
@ -464,6 +474,46 @@ automation:
] | random }}
initial_state: true
# # If door is open too long play message and identify open door.
# - id: door_opened_long
# alias: Door Opened Too Long
# trigger:
# - platform: state
# entity_id:
# - binary_sensor.front_door
# - binary_sensor.laundry_room_door
# - binary_sensor.attic_door
# - binary_sensor.back_door
# from: 'off'
# to: 'on'
# for: '00:01:00'
# condition:
# - condition: state
# entity_id: input_boolean.audible_notifications
# state: 'on'
# action:
# - service: script.speech_engine
# data_template:
# who: '{{ states.sensor.room_audio.state }}'
# message: >
# The {{ trigger.to_state.attributes.friendly_name }}
# {{ [
# ' is standing open.',
# ' is open.',
# ' does not close on its own.',
# ' was left standing open.'
# ] | random }}
# {{ [
# 'Can a human be so kind and close it?',
# 'The air quality in this house has actually improved.',
# 'Closing the door would improve the internal climate of the house.',
# 'Hey. The door was just opened and this is crazy. But now you know. So close it maybe.',
# 'If at first you do not succeed in closing the door, please try again. Like, Right now seems like a good time to try again.',
# 'And the automatic door closer appears to be broken. So, you know what to do. Time to get physical.',
# 'I would close it for you. But I lack legs. And Arms.'
# ] | random }}
# initial_state: true
# If guest mode is enabled, notify the house
- id: guest_mode_feedback
alias: Guest Mode Audio Feedback
@ -872,22 +922,22 @@ script:
# door chime script, just plays sound anytime called.
door_chime:
sequence:
- condition: state
entity_id: input_boolean.audible_notifications
state: 'on'
- service: media_player.turn_on
entity_id: media_player.ha_speaker
- service: media_player.volume_set
data_template:
entity_id: media_player.ha_speaker
volume_level: .5
- service: media_player.play_media
entity_id: media_player.ha_speaker
data:
media_content_id: /media/sounds/door_open.wav
media_content_type: "music"
# door_chime:
# sequence:
# - condition: state
# entity_id: input_boolean.audible_notifications
# state: 'on'
# - service: media_player.turn_on
# entity_id: media_player.ha_speaker
# - service: media_player.volume_set
# data_template:
# entity_id: media_player.ha_speaker
# volume_level: .5
# - service: media_player.play_media
# entity_id: media_player.ha_speaker
# data:
# media_content_id: /media/sounds/door_open.wav
# media_content_type: "music"
# Play Fire alarm Siren
# fire_alarm: