New speech engine message type for weather alerts #89

This commit is contained in:
2023-07-06 02:25:15 -04:00
parent 3bff90891b
commit fd21e00650
3 changed files with 39 additions and 26 deletions

View File

@ -131,6 +131,18 @@ template:
device_class: safety device_class: safety
attributes: attributes:
current_strikes: "{{ states('sensor.blitzortung_lightning_counter') | int }}" current_strikes: "{{ states('sensor.blitzortung_lightning_counter') | int }}"
- name: "Audible Weather Alerts Allowed"
unique_id: 03851823-32d5-44c1-af42-256fcd922069
state: >
{% if is_state('input_boolean.audible_notifications','on') %}
true
{% elif states('sensor.people_sleeping_total') | int == 3 %}
false
{% elif is_state('input_boolean.kallen_overnight','on') and (states('sensor.people_sleeping_total') | int == 2) %}
false
{% else %}
true
{% endif %}
sensor: sensor:
- platform: weatheralerts - platform: weatheralerts

View File

@ -951,14 +951,15 @@ script:
- Salli - Salli
type: type:
name: 'Type' name: 'Type'
description: 'What type of message is this? Can override some settings depending on the option selected. Alert bypasses time restrictions but respects volume settings and sleep mode. Critical bypasses all restrictions, and sets all volumes to max.' description: 'What type of message is this? Can override some settings depending on the option selected. Alert bypasses time restrictions but respects volume settings and sleep mode. Weather is similar to alert, but will not play at all if everyone is asleep. Critical bypasses all restrictions, and sets all volumes to max.'
required: false required: false
example: 'normal, alert, critical' example: 'normal, alert, weather, critical'
selector: selector:
select: select:
options: options:
- normal - normal
- alert - alert
- weather
- critical - critical
variables: variables:
voice: "{{ states('input_select.jarvis_voice') }}" voice: "{{ states('input_select.jarvis_voice') }}"
@ -998,6 +999,8 @@ script:
state: 'on' state: 'on'
- condition: template - condition: template
value_template: "{{ type in ['critical','Critical','alert','Alert'] }}" value_template: "{{ type in ['critical','Critical','alert','Alert'] }}"
- condition: template
value_template: "{{ type in ['weather','Weather'] and is_state('binary_sensor.audible_weather_alerts_allowed','on') }}"
- condition: state - condition: state
entity_id: group.adults entity_id: group.adults
state: 'home' state: 'home'

View File

@ -1523,6 +1523,7 @@ automation:
- service: script.status_annc - service: script.status_annc
data: data:
who: everywhere who: everywhere
type: weather
call_interruption: 1 call_interruption: 1
call_thunderstorm_warning: 1 call_thunderstorm_warning: 1
- conditions: - conditions:
@ -1532,6 +1533,7 @@ automation:
- service: script.status_annc - service: script.status_annc
data: data:
who: everywhere who: everywhere
type: weather
call_interruption: 1 call_interruption: 1
call_tornado_watch: 1 call_tornado_watch: 1
- conditions: - conditions:
@ -1541,6 +1543,7 @@ automation:
- service: script.status_annc - service: script.status_annc
data: data:
who: everywhere who: everywhere
type: weather
call_interruption: 1 call_interruption: 1
call_thunderstorm_watch: 1 call_thunderstorm_watch: 1
- conditions: - conditions:
@ -1550,6 +1553,7 @@ automation:
- service: script.status_annc - service: script.status_annc
data: data:
who: everywhere who: everywhere
type: weather
call_interruption: 1 call_interruption: 1
call_freeze_warning: 1 call_freeze_warning: 1
- service: input_text.set_value - service: input_text.set_value
@ -1614,6 +1618,7 @@ automation:
- service: script.speech_engine - service: script.speech_engine
data: data:
who: everywhere who: everywhere
type: weather
message: "It is raining and there are windows open in the house. Please close them!" message: "It is raining and there are windows open in the house. Please close them!"
- wait_template: "{{ is_state('binary_sensor.windows','off') or is_state('sensor.pirateweather_precip','none') }}" - wait_template: "{{ is_state('binary_sensor.windows','off') or is_state('sensor.pirateweather_precip','none') }}"
timeout: "00:15:00" timeout: "00:15:00"
@ -1632,6 +1637,7 @@ automation:
- service: script.speech_engine - service: script.speech_engine
data: data:
who: common who: common
type: weather
message: "Windows are now closed. Thank you, and enjoy your dry house." message: "Windows are now closed. Thank you, and enjoy your dry house."
- conditions: - conditions:
- condition: template - condition: template
@ -1646,11 +1652,13 @@ automation:
- service: script.speech_engine - service: script.speech_engine
data: data:
who: common who: common
type: weather
message: "Nevermind, it has stopped raining. Feel free to do whatever you'd like with the windows." message: "Nevermind, it has stopped raining. Feel free to do whatever you'd like with the windows."
default: default:
- service: script.speech_engine - service: script.speech_engine
data: data:
who: common who: common
type: weather
message: "Well, I guess no one cares if the house floods. Suit yourself, but do not say I didn't warn you." message: "Well, I guess no one cares if the house floods. Suit yourself, but do not say I didn't warn you."
@ -1673,8 +1681,8 @@ script:
tag: lightning-warning tag: lightning-warning
- if: - if:
- condition: state - condition: state
entity_id: input_boolean.master_bedroom_sleeping entity_id: binary_sensor.audible_weather_alerts_allowed
state: 'off' state: 'on'
then: then:
- service: scene.create - service: scene.create
data: data:
@ -1706,15 +1714,10 @@ script:
- light.tina_desk_strip - light.tina_desk_strip
data: data:
color_name: red color_name: red
- if:
- condition: state
entity_id: input_boolean.master_bedroom_sleeping
state: 'off'
then:
- service: script.status_annc - service: script.status_annc
data: data:
who: 'common' who: common
type: alert type: weather
call_interruption: 1 call_interruption: 1
call_lightning_alert: 1 call_lightning_alert: 1
- delay: - delay:
@ -1732,15 +1735,10 @@ script:
who: all who: all
message: clear_notification message: clear_notification
tag: lightning-warning tag: lightning-warning
- if:
- condition: state
entity_id: input_boolean.master_bedroom_sleeping
state: 'off'
then:
- service: script.status_annc - service: script.status_annc
data: data:
who: 'common' who: common
type: alert type: weather
call_interruption: 1 call_interruption: 1
call_lightning_clear: 1 call_lightning_clear: 1
- service: script.text_notify - service: script.text_notify