Files
Home-Assistant-Configs/packages/announcements.yaml

352 lines
9.9 KiB
YAML

###############################
# input_datetime - So the time report automation fires can be set in the UI
###############################
input_datetime:
morning_briefing:
name: Morning Briefing
has_date: false
has_time: true
icon: mdi:home-analytics
nightly_briefing:
name: Nightly Briefing
has_date: false
has_time: true
icon: mdi:home-analytics
daily_briefing:
name: Daily Briefing
has_date: false
has_time: true
icon: mdi:home-analytics
kallen_morning_briefing:
name: Kallen Morning Briefing
has_date: false
has_time: true
icon: mdi:weather-sunset-up
kallen_nightly_briefing:
name: Kallen Nightly Briefing
has_date: false
has_time: true
icon: mdi:weather-night
audible_notification_on:
name: Audible Notifications On
has_date: false
has_time: true
icon: mdi:volume-high
audible_notification_off:
name: Audible Notifications Off
has_date: false
has_time: true
icon: mdi:volume-off
announcement_delay:
name: Announcement Delay
has_date: false
has_time: true
icon: mdi:clock-edit
input_select:
kallen_morning_briefing_location:
name: Kallen Morning Briefing Location
options:
- Kallen Bedroom
- Common Areas
icon: mdi:map-marker
input_text:
briefing_extras:
name: Briefing Extras
icon: mdi:plus
max: 255
kallen_briefing_extras:
name: Kallen Briefing Extras
icon: mdi:plus
max: 255
kallen_morning_announcements:
name: Kallen Morning Announcements
icon: mdi:bullhorn
max: 255
input_boolean:
briefing_extras:
name: Briefing Extras
icon: mdi:plus
kallen_briefing_extras:
name: Kallen Briefing Extras
icon: mdi:plus
kallen_morning_announcements:
name: Kallen Morning Announcements
icon: mdi:bullhorn
good_morning:
name: Good Morning Ran
icon: mdi:home-analytics
daily_briefing:
name: Daily Briefing Ran
icon: mdi:home-analytics
nightly_briefing:
name: Nightly Briefing Ran
icon: mdi:home-analytics
kallen_morning_briefing:
name: Kallen Morning Briefing Ran
icon: mdi:home-analytics
kallen_nightly_briefing:
name: Kallen Nightly Briefing Ran
icon: mdi:home-analytics
basement_briefing:
name: Basement Briefing Ran
icon: mdi:home-analytics
weather_reports:
name: Weather Info
icon: mdi:weather-cloudy-alert
traffic_reports:
name: Traffic Reports
icon: mdi:traffic-light
sun_reports:
name: Sun Reports
icon: mdi:weather-sunny-alert
morning_briefing_allowed:
name: Morning Briefing Allowed
icon: mdi:bullhorn
daily_briefing_allowed:
name: Daily Briefing Allowed
icon: mdi:bullhorn
nightly_briefing_allowed:
name: Nightly Briefing Allowed
icon: mdi:bullhorn
intent_script:
PlayAnnouncement:
action:
service: "script.{{announcement}}"
data:
who: "{{ who|default('everywhere') }}"
speech:
text: "Okay"
################################
# Announcment Automation - fires at the time of the above input_datetimes
################################
script:
kallen_nightly_briefing:
alias: 'Kallen Nightly Briefing'
sequence:
- service: script.text_notify
data:
who: "kallen"
title: "Yo Doofus"
message: "Heads up, here comes your nightly briefing!"
type: normal
tag: kallen-nightly-briefing
- delay:
seconds: 3
- service: script.speech_engine
data:
who: common
message: !include ../templates/speech/kallen_nightly_briefing.yaml
voice: Joanna
- service: input_boolean.turn_on
target:
entity_id: input_boolean.kallen_nightly_briefing
kallen_morning_briefing:
alias: 'Kallen Morning Briefing'
sequence:
- service: script.speech_engine
data:
who: >
{% if is_state('input_select.kallen_morning_briefing_location','Kallen Bedroom') %}
kallen_bedroom
{% elif is_state('input_select.kallen_morning_briefing_location','Common Areas') %}
common
{% else %}
common
{% endif %}
message: !include ../templates/speech/kallen_morning_briefing.yaml
voice: Joanna
- service: input_boolean.turn_on
target:
entity_id: input_boolean.kallen_morning_briefing
kallen_school_status:
alias: 'Kallen School Status'
sequence:
- service: script.speech_engine
data:
who: "{{ who }}"
message: !include ../templates/speech/kallen_school_status.yaml
voice: Joanna
daily_briefing:
alias: 'Daily Briefing'
sequence:
- service: script.speech_engine
data:
who: "{{ who|default('common') }}"
message: !include ../templates/speech/daily_briefing.yaml
- service: input_boolean.turn_on
target:
entity_id: input_boolean.daily_briefing
nightly_briefing:
alias: 'Nightly Briefing'
sequence:
- service: script.speech_engine
data:
who: "{{ who|default('common') }}"
message: !include ../templates/speech/nightly_briefing.yaml
- service: input_boolean.turn_on
target:
entity_id: input_boolean.nightly_briefing
morning_briefing:
alias: 'Morning Briefing'
sequence:
- service: script.speech_engine
data:
who: "{{ who|default('common') }}"
message: !include ../templates/speech/morning_briefing.yaml
- service: input_boolean.turn_on
target:
entity_id: input_boolean.good_morning
basement_briefing:
alias: 'Basement Briefing'
sequence:
- service: script.speech_engine
data:
who: "{{ who|default('basement') }}"
message: !include ../templates/speech/basement_briefing.yaml
- service: input_boolean.turn_on
target:
entity_id: input_boolean.basement_briefing
dinner_is_ready:
alias: 'Dinner Is Ready'
sequence:
- service: script.status_annc
data:
who: "{{ who|default('everywhere') }}"
call_dinner_is_ready: 1
we_are_leaving:
alias: 'We Are Leaving'
sequence:
- service: script.status_annc
data:
who: "{{ who|default('everywhere') }}"
call_we_are_leaving: 1
server_maintenance_annc:
alias: Server Maintenance Announcement
sequence:
- service: script.status_annc
data:
who: "{{ who|default('everywhere') }}"
call_interruption: 1
call_server_maintenance: 1
server_maintenance_done_annc:
alias: Server Maintenance Done Announcement
sequence:
- service: script.status_annc
data:
who: "{{ who|default('everywhere') }}"
call_interruption: 1
call_server_maintenance_done: 1
welcome_home:
alias: 'Welcome Home'
sequence:
- condition: state
entity_id: input_boolean.welcome_home
state: 'on'
- wait_template: "{{ is_state('binary_sensor.front_door','on') }}"
timeout:
minutes: 10
continue_on_timeout: false
- delay:
seconds: 5
- service: script.speech_engine
data:
who: living_room
message: !include ../templates/speech/welcome_home.yaml
mode: restart
birthday_announcement:
alias: 'Birthday Announcement'
sequence:
- alias: "Save current light states"
service: scene.create
data:
scene_id: before_birthday_announcement
snapshot_entities:
- light.living_room_color_1
- light.living_room_color_2
- light.living_room_color_3
- light.tina_lamp_side
- light.tina_lamp_top
- light.mud_room_overhead
- light.basement_led_strip_1
- light.basement_tall_lamp
- light.basement_short_lamp
- light.basement_stairwell
- alias: "Save current adaptive states"
service: scene.create
data:
scene_id: before_birthday_announcement_adaptive
snapshot_entities:
- switch.adaptive_lighting_living_room
- switch.adaptive_lighting_tina_lamp
- switch.adaptive_lighting_basement_studio
- alias: "Give it time to make sure it saves"
delay:
seconds: 2
- alias: "Turn off adaptive lighting"
service: switch.turn_off
target:
entity_id:
- switch.adaptive_lighting_living_room
- switch.adaptive_lighting_tina_lamp
- switch.adaptive_lighting_basement_studio
- alias: "Turn off non-color lights"
service: light.turn_off
target:
entity_id:
- light.mud_room_overhead
- alias: "Set color lights to purple"
service: light.turn_on
target:
entity_id:
- light.living_room_lights
- light.tina_lamp
- light.basement_studio_lights
data:
color_name: >
{% if is_state('sensor.anniversary_tony_s_birthday','0') %}
purple
{% elif is_state('sensor.anniversary_tina_s_birthday','0') %}
purple
{% elif is_state('sensor.anniversary_kallen_s_birthday','0') %}
red
{% elif is_state('sensor.anniversary_emmalynn_s_birthday','0') %}
pink
{% endif %}
- alias: "Read the announcement"
service: script.speech_engine
data:
who: "{{ who|default('everywhere') }}"
message: !include ../templates/speech/birthdays.yaml
- alias: "Give time for the announcement to complete"
delay:
seconds: 20
- alias: "Restore previous light states"
service: scene.turn_on
target:
entity_id: scene.before_birthday_announcement
- alias: "Let the lights come up"
delay:
seconds: 3
- alias: "Restore previous adaptive states"
service: scene.turn_on
target:
entity_id: scene.before_birthday_announcement_adaptive