Twweaking audible notifications for video coming out on 6-26-21

This commit is contained in:
Jeffrey Stone 2021-06-16 21:11:07 -04:00
parent b6f7c073c6
commit f321395ce6
3 changed files with 172 additions and 61 deletions

View File

@ -261,12 +261,18 @@
trigger: trigger:
- platform: numeric_state - platform: numeric_state
entity_id: sensor.master_bath_humidity entity_id: sensor.master_bath_humidity
above: '62' above: '68'
for: 00:03:00 for: 00:03:00
condition: condition:
- condition: state - condition: state
entity_id: switch.master_bath_fan entity_id: switch.master_bath_fan
state: 'off' state: 'off'
- condition: state
entity_id: binary_sensor.quiet_time
state: 'off'
- condition: state
entity_id: group.family
state: 'home'
action: action:
- service: switch.turn_on - service: switch.turn_on
data: {} data: {}
@ -278,7 +284,7 @@
trigger: trigger:
- platform: numeric_state - platform: numeric_state
entity_id: sensor.master_bath_humidity entity_id: sensor.master_bath_humidity
below: '62' below: '69'
condition: condition:
- condition: state - condition: state
entity_id: switch.master_bath_fan entity_id: switch.master_bath_fan
@ -299,3 +305,127 @@
- event: test_complete - event: test_complete
event_data: {} event_data: {}
mode: single mode: single
- id: '1622313738769'
alias: Room Presence Detection
description: ''
trigger:
- platform: state
entity_id:
- binary_sensor.master_bedroom_motion_occupancy
- binary_sensor.kitchen_motion_occupancy
- binary_sensor.living_room_motion_occupancy
- binary_sensor.skylar_bedroom_motion_occupancy
- binary_sensor.croft_occupancy
- binary_sensor.back_door_motion
from: 'off'
to: 'on'
- platform: state
entity_id:
- media_player.kitchen_echo
- media_player.living_room_echo
- media_player.skylar_s_bedroom
attribute: last_called
to: 'true'
- platform: state
entity_id: media_player.theater_tv
from: 'off'
to: 'on'
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: media_player.theater_tv
state: 'on'
sequence:
- service: input_text.set_value
data:
entity_id: input_text.room_presence
value: theater
- conditions:
- condition: template
value_template: '{{ "Kitchen" in trigger.to_state.attributes.friendly_name
or "Back Door" in trigger.to_state.attributes.friendly_name }}'
sequence:
- service: input_text.set_value
data:
entity_id: input_text.room_presence
value: kitchen
- conditions:
- condition: template
value_template: '{{ "Living" in trigger.to_state.attributes.friendly_name }}'
sequence:
- service: input_text.set_value
data:
entity_id: input_text.room_presence
value: main
- conditions:
- condition: template
value_template: '{{ "Master" in trigger.to_state.attributes.friendly_name }}'
sequence:
- service: input_text.set_value
data:
entity_id: input_text.room_presence
value: master_bedroom
- conditions:
- condition: template
value_template: '{{ "Croft" in trigger.to_state.attributes.friendly_name }}'
sequence:
- service: input_text.set_value
data:
entity_id: input_text.room_presence
value: croft
- conditions:
- condition: template
value_template: '{{ "Skylar" in trigger.to_state.attributes.friendly_name }}'
sequence:
- service: input_text.set_value
data:
entity_id: input_text.room_presence
value: skylar_bedroom
default: []
mode: restart
- id: '1622731659354'
alias: Tornado Alarm
description: Sound the Tornado Alarm!
trigger:
- platform: state
entity_id: input_boolean.tornado_alarm
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: input_boolean.tornado_alarm
state: 'on'
sequence:
- delay:
seconds: 15
- service: media_player.volume_set
data:
entity_id: media_player.ha_speaker
volume_level: 0.99
- service: media_player.play_media
target:
entity_id: media_player.ha_speaker
data:
media_content_id: /media/sounds/tornado_alarm.mp3
media_content_type: music
- delay:
seconds: 110
- service: media_player.play_media
target:
entity_id: media_player.ha_speaker
data:
media_content_id: /media/sounds/tornado_alarm.mp3
media_content_type: music
- conditions:
- condition: state
entity_id: input_boolean.tornado_alarm
state: 'off'
sequence:
- service: media_player.media_stop
target:
entity_id: media_player.ha_speaker
default: []
mode: restart

View File

@ -131,6 +131,32 @@ automation:
attribute: last_called attribute: last_called
to: True to: True
action: action:
- service: input_text.set_value
data_template:
entity_id: input_text.room_presence
value: >
{% set room = trigger.to_state.attributes.friendly_name %}
{% if room == 'Kitchen Echo' %}
kitchen
{% elif room == 'Living Room Echo' %}
main
{% elif room == 'Skylar\'s Bedroom' %}
skylar_bedroom
{%- elif is_state('media_player.theater_tv', 'on') %}
theater
{% elif room == 'Kitchen Motion occupancy' or room == 'Back Door Motion'%}
kitchen
{% elif room == 'Master Bedroom Motion occupancy' %}
master_bedroom
{% elif room == 'Living Room Motion occupancy' or room == 'Living Room Echo' %}
main
{% elif room == 'Croft Occupancy' %}
croft
{% elif room == 'Skylar Bedroom Motion occupancy' or room == 'Skylar\'s Bedroom' %}
skylar_bedroom
{% else %}
main
{% endif %}
- service: mqtt.publish - service: mqtt.publish
data: data:
topic: house/presence/current_room topic: house/presence/current_room

View File

@ -150,51 +150,6 @@ notify:
- platform: alexa_media - platform: alexa_media
name: alexa_media name: alexa_media
# automation:
# - id: audio_isssue
# alias: Audio Issue
# initial_state: true
# trigger:
# - platform: state
# entity_id: media_player.ha_speaker
# to: 'unavailable'
# condition:
# - condition: state
# entity_id: binary_sensor.day
# state: 'on'
# action:
# - service: input_boolean.turn_off
# entity_id: input_boolean.audible_notifications
# - service: script.text_notify
# data_template:
# who: "jeff"
# title: "Audio Issue"
# message: "HA Audible Notifications turning off due to Chromecast Issue"
# - id: audio_isssue_cleared
# alias: Audio Issue Cleared
# initial_state: true
# trigger:
# - platform: state
# entity_id: media_player.ha_speaker
# from: 'unavailable'
# to: 'off'
# condition:
# - condition: state
# entity_id: binary_sensor.day
# state: 'on'
# action:
# - service: script.text_notify
# data_template:
# who: "jeff"
# title: "Audio Issue Cleared"
# message: "Main hromecast is back on"
# - service: script.turn_on_ha_speaker
script: script:
@ -381,7 +336,7 @@ script:
entity_id: > entity_id: >
{% if who == 'kitchen' %} {% if who == 'kitchen' %}
media_player.kitchen_display media_player.kitchen_display
{% elif who == 'croft' %} {% elif who == 'theater' %}
media_player.upstairs_speaker media_player.upstairs_speaker
{% elif who == 'master_bedroom' %} {% elif who == 'master_bedroom' %}
media_player.master_bedroom_speaker media_player.master_bedroom_speaker
@ -403,7 +358,7 @@ script:
entity_id: > entity_id: >
{% if who == 'kitchen' %} {% if who == 'kitchen' %}
media_player.kitchen_display media_player.kitchen_display
{% elif who == 'croft' %} {% elif who == 'theater' %}
media_player.upstairs_speaker media_player.upstairs_speaker
{% elif who == 'master_bedroom' %} {% elif who == 'master_bedroom' %}
media_player.master_bedroom_speaker media_player.master_bedroom_speaker
@ -626,11 +581,11 @@ script:
entity_id: > entity_id: >
{% if who == 'kitchen' %} {% if who == 'kitchen' %}
media_player.kitchen_display media_player.kitchen_display
{% elif who == 'croft' %} {% elif who == 'theater' %}
media_player.upstairs_speaker media_player.upstairs_speaker
{% elif who == 'master_bedroom' %} {% elif who == 'master_bedroom' %}
media_player.master_bedroom_speaker media_player.master_bedroom_speaker
{% elif who == 'theater' %} {% elif who == 'studio' %}
media_player.theater media_player.theater
{% elif who == 'all_google' %} {% elif who == 'all_google' %}
media_player.house media_player.house
@ -648,11 +603,11 @@ script:
entity_id: > entity_id: >
{% if who == 'kitchen' %} {% if who == 'kitchen' %}
media_player.kitchen_display media_player.kitchen_display
{% elif who == 'croft' %} {% elif who == 'theater' %}
media_player.upstairs_speaker media_player.upstairs_speaker
{% elif who == 'master_bedroom' %} {% elif who == 'master_bedroom' %}
media_player.master_bedroom_speaker media_player.master_bedroom_speaker
{% elif who == 'theater' %} {% elif who == 'studio' %}
media_player.theater media_player.theater
{% elif who == 'all_google' %} {% elif who == 'all_google' %}
media_player.house media_player.house
@ -680,11 +635,11 @@ script:
entity_id: > entity_id: >
{% if who == 'kitchen' %} {% if who == 'kitchen' %}
media_player.kitchen_display media_player.kitchen_display
{% elif who == 'croft' %} {% elif who == 'theater' %}
media_player.upstairs_speaker media_player.upstairs_speaker
{% elif who == 'master_bedroom' %} {% elif who == 'master_bedroom' %}
media_player.master_bedroom_speaker media_player.master_bedroom_speaker
{% elif who == 'theater' %} {% elif who == 'studio' %}
media_player.theater media_player.theater
{% elif who == 'all_google' %} {% elif who == 'all_google' %}
media_player.house media_player.house
@ -711,11 +666,11 @@ script:
entity_id: > entity_id: >
{% if who == 'kitchen' %} {% if who == 'kitchen' %}
media_player.kitchen_display media_player.kitchen_display
{% elif who == 'croft' %} {% elif who == 'theater' %}
media_player.upstairs_speaker media_player.upstairs_speaker
{% elif who == 'master_bedroom' %} {% elif who == 'master_bedroom' %}
media_player.master_bedroom_speaker media_player.master_bedroom_speaker
{% elif who == 'theater' %} {% elif who == 'studio' %}
media_player.theater media_player.theater
{% elif who == 'all_google' %} {% elif who == 'all_google' %}
media_player.house media_player.house
@ -733,11 +688,11 @@ script:
entity_id: > entity_id: >
{% if who == 'kitchen' %} {% if who == 'kitchen' %}
media_player.kitchen_display media_player.kitchen_display
{% elif who == 'croft' %} {% elif who == 'theater' %}
media_player.upstairs_speaker media_player.upstairs_speaker
{% elif who == 'master_bedroom' %} {% elif who == 'master_bedroom' %}
media_player.master_bedroom_speaker media_player.master_bedroom_speaker
{% elif who == 'theater' %} {% elif who == 'studio' %}
media_player.theater media_player.theater
{% elif who == 'all_google' %} {% elif who == 'all_google' %}
media_player.house media_player.house
@ -761,11 +716,11 @@ script:
entity_id: > entity_id: >
{% if who == 'kitchen' %} {% if who == 'kitchen' %}
media_player.kitchen_display media_player.kitchen_display
{% elif who == 'croft' %} {% elif who == 'theater' %}
media_player.upstairs_speaker media_player.upstairs_speaker
{% elif who == 'master_bedroom' %} {% elif who == 'master_bedroom' %}
media_player.master_bedroom_speaker media_player.master_bedroom_speaker
{% elif who == 'theater' %} {% elif who == 'studio' %}
media_player.theater media_player.theater
{% elif who == 'all_google' %} {% elif who == 'all_google' %}
media_player.house media_player.house