Compare commits

..

3 Commits

8 changed files with 432 additions and 1765 deletions

View File

@@ -1 +1 @@
2026.3.4
2026.4.0

View File

@@ -1,33 +1,35 @@
- id: '1640833273099'
alias: NWS Announce Weather Alert for Tornado
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.weatheralerts_active_alerts
attribute: tornado_warning_count
above: '0'
condition:
triggers:
- trigger: state
entity_id:
- binary_sensor.tornado_warning
from:
- 'off'
to:
- 'on'
conditions:
- condition: state
entity_id: input_boolean.vacation_mode
state: 'off'
action:
- service: input_boolean.turn_on
data: {}
actions:
- data: {}
target:
entity_id: input_boolean.tornado_alarm
- service: input_boolean.turn_off
data: {}
action: input_boolean.turn_on
- data: {}
target:
entity_id:
- input_boolean.white_noise_kallen_bedroom
- input_boolean.white_noise_basement
- input_boolean.white_noise_emma_bedroom
alias: Turn off white noise
- service: script.turn_on
target:
action: input_boolean.turn_off
- target:
entity_id: script.max_brightness
- service: script.text_notify
data:
action: script.turn_on
- data:
type: critical
title: Tornado Warning - TAKE COVER!
message: The National Weather Service has issued a Tornado Warning for our area.
@@ -35,34 +37,35 @@
who: all
tag: tornado-warning
alias: CRITICAL PHONE ALERT
- service: script.tv_notify
data:
action: script.text_notify
- data:
who: all
title: Tornado Warning - TAKE COVER!
message: The National Weather Service has issued a Tornado Warning for our area.
Take Cover NOW!!!!
alias: TV Alert
- service: script.speech_engine
data:
action: script.tv_notify
- data:
who: everywhere
message: A tornado warning has been issued, please take cover immediately! A
tornado warning has been issued, please take cover immediately! A tornado
warning has been issued, please take cover immediately!
type: alert
alias: Elevated TTS alert
action: script.speech_engine
- delay:
hours: 0
minutes: 1
seconds: 0
milliseconds: 0
- service: script.speech_engine
data:
- data:
who: everywhere
message: A tornado warning has been issued, please take cover immediately! A
tornado warning has been issued, please take cover immediately! A tornado
warning has been issued, please take cover immediately!
type: critical
alias: CRITICAL TTS ALERT
action: script.speech_engine
- delay:
hours: 0
minutes: 1
@@ -437,52 +440,55 @@
- id: '1655493590791'
alias: NWS Announce Weather Alert for Tornado (CLEAR)
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.weatheralerts_active_alerts
attribute: tornado_warning_count
below: '1'
condition:
triggers:
- trigger: state
entity_id:
- binary_sensor.tornado_warning
from:
- 'on'
to:
- 'off'
conditions:
- condition: state
entity_id: input_boolean.vacation_mode
state: 'off'
- condition: state
entity_id: input_boolean.tornado_alarm
state: 'on'
action:
- service: script.text_notify
data:
actions:
- data:
type: alert
who: all
message: clear_notification
tag: tornado-warning
alias: Clear critical notification
- service: input_boolean.turn_off
data: {}
action: script.text_notify
- data: {}
target:
entity_id: input_boolean.tornado_alarm
- service: script.volume_reset
data: {}
- service: script.max_brightness_cleanup
data: {}
- service: script.text_notify
data:
action: input_boolean.turn_off
- data: {}
action: script.volume_reset
- data: {}
action: script.max_brightness_cleanup
- data:
title: Tornado Warning is cleared
message: Check your surroundings and make sure it is safe to leave cover
who: all
type: alert
tag: tornado-cleared
- service: script.tv_notify
data:
action: script.text_notify
- data:
title: Tornado Warning is cleared
message: Check your surroundings and make sure it is safe to leave cover
who: all
- service: script.speech_engine
data:
action: script.tv_notify
- data:
who: everywhere
message: Tornado warning has been cleared. Check your surroundings and make
sure it is safe to leave cover.
type: alert
action: script.speech_engine
- wait_template: '{{ is_state(''input_boolean.tornado_alarm'',''on'') }}'
continue_on_timeout: true
timeout: 00:05:00
@@ -503,15 +509,15 @@
alias: After audible notifications off
alias: Should audible notifications be off
then:
- service: input_boolean.turn_off
data: {}
- data: {}
target:
entity_id: input_boolean.audible_notifications
action: input_boolean.turn_off
else:
- service: input_boolean.turn_on
data: {}
- data: {}
target:
entity_id: input_boolean.audible_notifications
action: input_boolean.turn_on
else:
- stop: Tornado alert re-activated
mode: single
@@ -985,38 +991,44 @@
alias: Tornado Watch Handling
description: Controls the input boolean for tornado watches, for use in briefings
or automations
trigger:
- platform: numeric_state
entity_id: sensor.weatheralerts_active_alerts
attribute: tornado_watch_count
above: 0
triggers:
- alias: Watch Issued
entity_id:
- binary_sensor.tornado_watch
id: watch_issued
alias: Watch Issued
- platform: numeric_state
entity_id: sensor.weatheralerts_active_alerts
attribute: tornado_watch_count
below: 1
id: watch_cleared
alias: Watch Cleared
condition: []
action:
trigger: state
from:
- 'off'
to:
- 'on'
- alias: Watch Issued
entity_id:
- binary_sensor.tornado_watch
id: watch_issued
trigger: state
from:
- 'on'
to:
- 'off'
conditions: []
actions:
- choose:
- conditions:
- condition: trigger
id: watch_issued
sequence:
- service: input_boolean.turn_on
data: {}
- data: {}
target:
entity_id: input_boolean.tornado_watch
action: input_boolean.turn_on
- conditions:
- condition: trigger
id: watch_cleared
sequence:
- service: input_boolean.turn_off
data: {}
- data: {}
target:
entity_id: input_boolean.tornado_watch
action: input_boolean.turn_off
alias: Control input boolean
mode: restart
- id: '1679104710155'
@@ -6583,3 +6595,10 @@
ready if you haven't already.
type: alert
mode: restart
- id: '1775084267580'
alias: WeatherAlerts Persistent Notification - Defiance
description: ''
use_blueprint:
path: github.com/weatheralerts_persistent_notification_original.yaml
input:
sensor: sensor.weatheralerts_defiance_ohz004_ohc039

View File

@@ -0,0 +1,156 @@
blueprint:
name: WeatherAlerts Persistent Notification and Cleanup
description: 'Persistent notification for Weather Alerts from a weatheralerts integration sensor,
plus automatic cleanup when no active alerts remain for 30 minutes. New alerts
and alerts less than 30 minutes old will display as a full alert message in the
psrsistent notification. Alerts older than 30 minutes will only display as a
short alert event title in the persistent notification.
'
domain: automation
input:
sensor:
name: WeatherAlerts Sensor
description: The weatheralerts sensor to monitor
selector:
entity:
domain:
- sensor
integration: weatheralerts
multiple: false
reorder: false
source_url: https://github.com/custom-components/weatheralerts/raw/refs/heads/master/blueprints/weatheralerts_persistent_notification_original.yaml
trigger:
- platform: homeassistant
event: start
- platform: event
event_type: component reload
event_data:
domain: weatheralerts
- platform: state
entity_id: !input sensor
attribute: alert_tracking
variables:
sensor: !input sensor
integration: '{{ state_attr(sensor, ''integration'') or ''weatheralerts'' }}'
zone: '{{ state_attr(sensor, ''zone'') or ''unknown'' }}'
zone_name: '{{ state_attr(sensor, ''zone_name'') or ''unknown'' }}'
notif_id: '{{ integration }}_{{ zone | replace('','',''_'') | lower }}'
alert_ids: '{{ state_attr(sensor, ''alert_tracking'') or [] }}'
alerts: '{{ state_attr(sensor, ''alerts'') or [] }}'
now_ts: '{{ now().timestamp() | float }}'
action:
- choose:
- conditions:
- condition: template
value_template: "{% set new_ids = alert_ids | selectattr('status','eq','new')
| map(attribute='id') | list %} {% set new_alerts_full = alerts | selectattr('id','in',
new_ids) | list %} {% set ids = namespace(valid=[]) %} {% for item in alert_ids
%}\n {% if item.status == 'old'\n and item.sent is defined and item.sent
not in ['null','',none]\n and item.expires is defined and item.expires
not in ['null','',none] %}\n {% set sent_ts = as_timestamp(item.sent, default=0)
%}\n {% set exp_ts = as_timestamp(item.expires, default=0) %}\n {% if
exp_ts > now().timestamp() and (now().timestamp() - sent_ts) < 1800 %}\n {%
set ids.valid = ids.valid + [item.id] %}\n {% endif %}\n {% endif %}\n{%
endfor %} {% set old_alerts_full = alerts | selectattr('id','in', ids.valid)
| list %} {% set ids2 = namespace(valid=[]) %} {% for item in alert_ids %}\n
\ {% if item.status == 'old'\n and item.sent is defined and item.sent
not in ['null','',none]\n and item.expires is defined and item.expires
not in ['null','',none] %}\n {% set sent_ts = as_timestamp(item.sent, default=0)
%}\n {% set exp_ts = as_timestamp(item.expires, default=0) %}\n {% if
exp_ts > now().timestamp() and (now().timestamp() - sent_ts) >= 1800 %}\n
\ {% set ids2.valid = ids2.valid + [item.id] %}\n {% endif %}\n {%
endif %}\n{% endfor %} {% set old_alerts_title = alerts | selectattr('id','in',
ids2.valid) | list %} {{ new_alerts_full | length > 0 or old_alerts_full |
length > 0 or old_alerts_title | length > 0 }}"
sequence:
- service: persistent_notification.create
data:
notification_id: '{{ notif_id }}'
title: Weather Alerts for {{ zone_name }}
message: "{% set new_ids = alert_ids | selectattr('status','eq','new') | map(attribute='id')
| list %}\n{% set new_alerts_full = alerts | selectattr('id','in', new_ids)
| list %}\n{% set ids = namespace(valid=[]) %}\n{% for item in alert_ids
%}\n {% if item.status == 'old'\n and item.sent is defined and item.sent
not in ['null','',none]\n and item.expires is defined and item.expires
not in ['null','',none] %}\n {% set sent_ts = as_timestamp(item.sent,
default=0) %}\n {% set exp_ts = as_timestamp(item.expires, default=0)
%}\n {% if exp_ts > now().timestamp() and (now().timestamp() - sent_ts)
< 1800 %}\n {% set ids.valid = ids.valid + [item.id] %}\n {% endif
%}\n {% endif %}\n{% endfor %}\n{% set old_alerts_full = alerts | selectattr('id','in',
ids.valid) | list %}\n{% set ids2 = namespace(valid=[]) %}\n{% for item
in alert_ids %}\n {% if item.status == 'old'\n and item.sent is defined
and item.sent not in ['null','',none]\n and item.expires is defined
and item.expires not in ['null','',none] %}\n {% set sent_ts = as_timestamp(item.sent,
default=0) %}\n {% set exp_ts = as_timestamp(item.expires, default=0)
%}\n {% if exp_ts > now().timestamp() and (now().timestamp() - sent_ts)
>= 1800 %}\n {% set ids2.valid = ids2.valid + [item.id] %}\n {%
endif %}\n {% endif %}\n{% endfor %}\n{% set old_alerts_title = alerts
| selectattr('id','in', ids2.valid) | list %}\n{% for alert in new_alerts_full
%}\n{# — Clean up title — #}\n{% set clean_title = alert.title\n | replace('\\n\\n','<br>')\n
\ | replace('\\n',' ')\n | trim %}\n{# — Clean up headline — #}\n{% if
alert.NWSheadline and alert.NWSheadline != 'null' %}\n {% set clean_headline
= alert.NWSheadline\n | replace('\\n\\n','<br>')\n | replace('\\n','
')\n | trim %}\n{% else %}\n {% set clean_headline = \"\" %}\n{% endif
%}\n{# — Clean up description — #}\n{% set clean_description = alert.description\n
\ | replace('\\n\\n','<br>')\n | replace('\\n',' ')\n | replace('<br>','<br>\\n')\n
\ | regex_replace('([A-Z ]+?\\\\.\\\\.\\\\.)', '* <strong>\\\\1</strong>')\n
\ | replace('**','*')\n | trim %}\n{# — Optional instruction — #}\n{%
if alert.instruction and alert.instruction != 'null' %}\n {% set clean_instruction
= alert.instruction\n | replace('\\n\\n','<br>')\n | replace('\\n','
')\n | trim %}\n{% else %}\n {% set clean_instruction = \"\" %}\n{%
endif %}\n{# — Area — #}\n{% set clean_area = alert.area\n | replace('\\n\\n','<br>')\n
\ | replace('\\n',' ')\n | trim %}\n<font color=\"orange\">\n <ha-icon
icon=\"{{ alert.icon }}\"></ha-icon>\n</font>\n<strong>\n <font color=\"red\">{{
clean_title }}</font>\n</strong><br>\n{% if clean_headline and clean_headline
!= 'null' %}\n {{ clean_headline }}<br>\n{% endif %}\n{{ clean_description
}}<br>\n* <strong> AREA…</strong> {{ clean_area }}<br><br>\n{% if clean_instruction
and clean_instruction != 'null' %}\n{{ clean_instruction }}<br><br>\n{%
endif %}\n{% if alert.sent and alert.sent != 'null' %}\n<strong>Alert Sent:</strong>
{{ alert.sent }}<br>\n{% endif %}\n{% if alert.effective and alert.effective
!= 'null' %}\n<strong>Effective:</strong> {{ alert.effective }}<br>\n{%
endif %}\n{% if alert.expires and alert.expires != 'null' %}\n<strong>Expires:</strong>
{{ alert.expires }}<br>\n{% endif %}\n{% if alert.onset and alert.onset
!= 'null' %}\n<strong>Onset:</strong> {{ alert.onset }}<br>\n{% endif %}\n{%
if alert.ends and alert.ends != 'null' %}\n<strong>Ends:</strong> {{ alert.ends
}}<br>\n{% endif %}\n{% if not loop.last %}\n <hr>\n{% endif %}\n{% endfor
%}\n\n{% if old_alerts_full %}\n <hr>\n{% for alert in old_alerts_full
%}\n{# — Clean up title — #}\n{% set clean_title = alert.title\n | replace('\\n\\n','<br>')\n
\ | replace('\\n',' ')\n | trim %}\n{# — Clean up headline — #}\n{% if
alert.NWSheadline and alert.NWSheadline != 'null' %}\n {% set clean_headline
= alert.NWSheadline\n | replace('\\n\\n','<br>')\n | replace('\\n','
')\n | trim %}\n{% else %}\n {% set clean_headline = \"\" %}\n{% endif
%}\n{# — Clean up description — #}\n{% set clean_description = alert.description\n
\ | replace('\\n\\n','<br>')\n | replace('\\n',' ')\n | replace('<br>','<br>\\n')\n
\ | regex_replace('([A-Z ]+?\\\\.\\\\.\\\\.)', '* <strong>\\\\1</strong>')\n
\ | replace('**','*')\n | trim %}\n{# — Optional instruction — #}\n{%
if alert.instruction and alert.instruction != 'null' %}\n {% set clean_instruction
= alert.instruction\n | replace('\\n\\n','<br>')\n | replace('\\n','
')\n | trim %}\n{% else %}\n {% set clean_instruction = \"\" %}\n{%
endif %}\n{# — Area — #}\n{% set clean_area = alert.area\n | replace('\\n\\n','<br>')\n
\ | replace('\\n',' ')\n | trim %}\n<font color=\"orange\">\n <ha-icon
icon=\"{{ alert.icon }}\"></ha-icon>\n</font>\n<strong>\n <font color=\"red\">{{
clean_title }}</font>\n</strong><br>\n{% if clean_headline and clean_headline
!= 'null' %}\n {{ clean_headline }}<br>\n{% endif %}\n{{ clean_description
}}<br>\n* <strong>AREA…</strong> {{ clean_area }}<br>\n{% if clean_instruction
and clean_instruction != 'null' %}\n{{ clean_instruction }}<br>\n{% endif
%}\n{% if alert.sent and alert.sent != 'null' %}\n<strong>Alert Sent:</strong>
{{ alert.sent }}<br>\n{% endif %}\n{% if alert.effective and alert.effective
!= 'null' %}\n<strong>Effective:</strong> {{ alert.effective }}<br>\n{%
endif %}\n{% if alert.expires and alert.expires != 'null' %}\n<strong>Expires:</strong>
{{ alert.expires }}<br>\n{% endif %}\n{% if alert.onset and alert.onset
!= 'null' %}\n<strong>Onset:</strong> {{ alert.onset }}<br>\n{% endif %}\n{%
if alert.ends and alert.ends != 'null' %}\n<strong>Ends:</strong> {{ alert.ends
}}<br>\n{% endif %}\n{% if not loop.last %}\n <hr>\n{% endif %}\n{% endfor
%}\n{% endif %}\n\n{% if old_alerts_title %}\n<hr>\n{% if new_alerts_full
%}\n<strong>Other Active Alerts:</strong><br>\n{% else %}\n<strong>Active
Alerts:</strong><br>\n{% endif %}\n{% for alert in old_alerts_title %}\n*
<font color=\"orange\">\n <ha-icon icon=\"{{ alert.icon }}\"></ha-icon>\n
\ </font>\n <strong>{{ alert.title }}<strong><br>\n{% endfor %}\n{% endif
%}\n"
default:
- delay: 00:30:00
- service: persistent_notification.dismiss
data:
notification_id: '{{ notif_id }}'
mode: restart

View File

@@ -291,6 +291,7 @@ influxdb:
- sensor.*_status
- sensor.adguard*
- sensor.*response_time*
- sensor.weatheralerts*
entities:
- media_player.living_room_tv
- media_player.basement_tv
@@ -471,6 +472,7 @@ prometheus:
- sensor.*_status
- sensor.adguard*
- sensor.*response_time*
- sensor.weatheralerts*
include_entities:
- media_player.living_room_tv
- media_player.basement_tv

View File

@@ -30,7 +30,7 @@
{% if state_attr('binary_sensor.severe_thunderstorm_warning','considerable_destructive') == true %}
This storm has the potential to cause considerable damage. Please take shelter and stay safe!
{% endif %}
{% elif states('sensor.weatheralerts_active_alerts') > '0' and method != 'dashboard' %}
{% elif states('sensor.weatheralerts_defiance_ohz004_ohc039') > '0' and method != 'dashboard' %}
Current weather alerts: {{ states('sensor.weather_alert_string') }}.
{% endif %}
{% if method != 'dashboard' %}
@@ -69,7 +69,7 @@
{% else %}
{% set alertStrings = ['are','alerts','They are'] %}
{% endif %}
{% if states('sensor.weatheralerts_active_alerts') > '0' %}
{% if states('sensor.weatheralerts_defiance_ohz004_ohc039') > '0' %}
"There {{ alertStrings[0] }} {{ alerts }} weather {{ alertStrings[1] }} active. {{ alertStrings[2] }}, "
{{ states('sensor.weather_alert_string') }}.
{% endif %}

View File

@@ -1442,7 +1442,7 @@ template:
# previous_rainfall:
# - name: "Past 48h Rainfall"
# state: "{{ states('sensor.daily_rainfall_in') | float + state_attr('sensor.daily_rainfall_in', 'last_period') | float }}"
- name: Weather Alert String
- name: Weather Alert String #! REPAIRS NEEDED
unique_id: 66b5f020-0b5e-48ed-92a2-740d2d708b30
state: >
{% from 'formatting.jinja' import cleanup %}
@@ -1468,14 +1468,14 @@ template:
{% endmacro %}
{{ cleanup(getReport()) }}
attributes:
active_alerts: "{{ states('sensor.weatheralerts_active_alerts') }}"
active_alerts: "{{ states('sensor.weatheralerts_defiance_ohz004_ohc039') }}"
icon: >
{% if (states('sensor.weatheralerts_active_alerts') | int ) > 0 %}
{% if (states('sensor.weatheralerts_defiance_ohz004_ohc039') | int ) > 0 %}
mdi:alert
{% else %}
mdi:alert-remove
{% endif %}
- name: 'Weather Alerts Active - Corrected'
- name: 'Weather Alerts Active - Corrected' #! REPAIRS NEEDED
unique_id: e2f51da4-2271-4719-8edf-a28f76ac1e3f
state: >
{% from 'formatting.jinja' import cleanup %}
@@ -1494,7 +1494,7 @@ template:
{% endmacro %}
{{ cleanup(getReport()) }}
icon: >
{% if (states('sensor.weatheralerts_active_alerts') | int ) > 0 %}
{% if (states('sensor.weatheralerts_defiance_ohz004_ohc039') | int ) > 0 %}
mdi:alert
{% else %}
mdi:alert-remove
@@ -1613,6 +1613,9 @@ sensor:
# above: 0
input_boolean:
tornado_watch:
name: Tornado Watch
icon: mdi:message-alert
freeze_warning:
name: Freeze Warning
icon: mdi:snowflake-alert
@@ -1677,6 +1680,185 @@ input_boolean:
# - service: input_boolean.turn_off
# entity_id: input_boolean.freeze_warning
automation:
- id: 80465d92-2e06-4cf0-ba92-33376b28b9db
alias: WeatherAlerts - Notify on WeatherAlerts Error
description: ""
triggers:
- entity_id:
- sensor.weatheralerts_defiance_ohz004_ohc039
trigger: state
conditions:
- condition: template
value_template: >
{% set errs =
state_attr('sensor.weatheralerts_defiance_ohz004_ohc039','error') %}
{% if errs is not iterable or errs is string or errs is none %}
false
{% else %}
{% set e0 = errs[0] if errs|length > 0 else none %}
{{ e0 is mapping and e0.get('type') not in ['success'] }}
{% endif %}
actions:
- data:
title: Weather Alerts Error
message: >
{% set errs =
state_attr('sensor.weatheralerts_defiance_ohz004_ohc039','error') %}
{% set e0 = errs[0] if errs|length > 0 else {} %}
**Type:** {{ e0.get('type', 'unknown') }}
**Status:** {{ e0.get('status', 'unknown') }}
**Message:** {{ e0.get('message', 'unknown') }}
**Time:** {{ e0.get('timestamp', 'unknown') }}
notification_id: weatheralerts_error_notification_defiance
action: persistent_notification.create
mode: single
- id: 3ef6edbc-b24c-4032-a423-5fd3fee64c57
alias: WeatherAlerts - Notify on Recovery
description: ""
triggers:
- entity_id: sensor.weatheralerts_defiance_ohz004_ohc039
trigger: state
conditions:
- condition: template
value_template: >
{% set cur =
state_attr('sensor.weatheralerts_defiance_ohz004_ohc039','error')
%}
{% set prev = trigger.from_state.attributes.get('error') if
trigger.from_state else none %}
{% if cur is not iterable or cur is string or cur is none or cur|length ==
0 %}
false
{% else %}
{% set cur0 = cur[0] %}
{% set prev0 = prev[0] if prev is iterable and prev is not string and prev is not none and prev|length > 0 else none %}
{{ cur0.get('type') == 'success' and prev0.get('type') in ['http_error', 'exception'] }}
{% endif %}
actions:
- data:
title: Weather Alerts Recovered From Error
message: >
The Weather Alerts integration has successfully updated after an error.
{% set errs =
state_attr('sensor.weatheralerts_defiance_ohz004_ohc039','error') %}
{% set e0 = errs[0] if errs|length > 0 else {} %}
**Type:** {{ e0.get('type', 'unknown') }}
**Status:** {{ e0.get('status', 'unknown') }}
**Message:** {{ e0.get('message', 'unknown') }}
**Time:** {{ e0.get('timestamp', 'unknown') }}
notification_id: weatheralerts_notify_on_recovery_defiance
action: persistent_notification.create
mode: single
- id: 7b11243f-2154-45f8-bceb-71b83dac5b03
alias: WeatherAlerts - All Clear Notification
description: ""
triggers:
- entity_id: sensor.weatheralerts_defiance_ohz004_ohc039
trigger: state
conditions:
- condition: template
value_template: |-
{% set prev = trigger.from_state.state if trigger.from_state else '0' %}
{% set cur = trigger.to_state.state if trigger.to_state else '0' %}
{{ (prev | int(0)) > 0 and (cur | int(0)) == 0 }}
actions:
- data:
title: Weather alerts cleared
message: No active weather alerts remain.
notification_id: weatheralerts_all_clear_defiance
action: persistent_notification.create
mode: single
# Announce Severe Weather
- id: b1bdfbf9-d82e-436f-bc60-77c3abfb077b
alias: NWS Announce Weather Alert
trigger:
- trigger: state
entity_id: binary_sensor.severe_thunderstorm_warning
from:
- "off"
to:
- "on"
id: tstorm-warning
- trigger: state
entity_id: binary_sensor.tornado_watch
from:
- "off"
to:
- "on"
id: tornado-watch
- trigger: state
entity_id: binary_sensor.severe_thunderstorm_watch
from:
- "off"
to:
- "on"
id: tstorm-watch
# - platform: numeric_state
# entity_id: sensor.weatheralerts_defiance_ohz004_ohc039
# attribute: freeze_warning_count
# above: 0
# id: freeze-warning
action:
- choose:
- conditions:
- condition: trigger
id: tstorm-warning
sequence:
- service: script.status_annc
data:
who: everywhere
type: weather
call_interruption: 1
call_thunderstorm_warning: 1
- conditions:
- condition: trigger
id: tornado-watch
sequence:
- service: script.status_annc
data:
who: everywhere
type: weather
call_interruption: 1
call_tornado_watch: 1
- conditions:
- condition: trigger
id: tstorm-watch
sequence:
- service: script.status_annc
data:
who: everywhere
type: weather
call_interruption: 1
call_thunderstorm_watch: 1
- conditions:
- condition: trigger
id: freeze-warning
sequence:
- service: script.status_annc
data:
who: everywhere
type: weather
call_interruption: 1
call_freeze_warning: 1
script:
# refresh_weather_alert_sensors:

File diff suppressed because it is too large Load Diff

View File

@@ -38,7 +38,7 @@
<p>
{% set alerts = states('weather_alerts_active_corrected') %}
{% if states('sensor.weatheralerts_active_alerts') > '0' %}
{% if states('sensor.weatheralerts_defiance_ohz004_ohc039') > '0' %}
"There {% if alerts == '1' %}is{% else %}are{% endif %} {{ states('sensor.weather_alerts_active_corrected') }} weather {% if alerts == '1' %}alert{% else %}alerts{% endif %} active. "
"{% if alerts == '1' %}It is{% else %}They are{% endif %}, "
{{ states('sensor.weather_alert_string') }}.