-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a7932c2
commit 22f828c
Showing
1 changed file
with
151 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
######################################################################################### | ||
title: "Alerts" | ||
|
||
type: custom:vertical-layout | ||
layout: | ||
max_cols: 4 | ||
cards: | ||
- type: custom:stack-in-card | ||
cards: | ||
- type: entities | ||
title: Severe Weather Alerts | ||
show_header_toggle: false | ||
entities: sensor.nws_alerts | ||
- type: conditional | ||
conditions: | ||
- entity: sensor.nws_alerts | ||
state_not: '0' | ||
card: | ||
type: markdown | ||
content: > | ||
--- | ||
|
||
# NWS First Active Alert | ||
{% if state_attr('sensor.nws_alerts', 'title') != None and state_attr('sensor.nws_alerts', 'title').split(' - ')[0] is defined %} | ||
|
||
## {{ states.sensor.nws_alerts.attributes.title.split(' - ')[0] }} | ||
|
||
{{ state_attr('sensor.nws_alerts', 'display_desc').split('\n\n-\n\n')[0] }} | ||
|
||
{% else %} | ||
none | ||
{% endif %} | ||
- type: conditional | ||
conditions: | ||
- entity: sensor.nws_alerts | ||
state_not: "0" | ||
- entity: sensor.nws_alerts | ||
state_not: "1" | ||
card: | ||
type: markdown | ||
content: > | ||
--- | ||
|
||
# NWS Second Active Alert | ||
{% if state_attr('sensor.nws_alerts', 'title').split(' - ')[1] is defined %} | ||
|
||
## {{ states.sensor.nws_alerts.attributes.title.split(' - ')[1] }} | ||
|
||
{{ state_attr('sensor.nws_alerts', 'display_desc').split('\n\n-\n\n')[1] }} | ||
|
||
{% else %} | ||
none | ||
{% endif %} | ||
- type: conditional | ||
conditions: | ||
- entity: sensor.nws_alerts | ||
state_not: "0" | ||
- entity: sensor.nws_alerts | ||
state_not: "1" | ||
- entity: sensor.nws_alerts | ||
state_not: "2" | ||
card: | ||
type: markdown | ||
content: > | ||
--- | ||
|
||
# NWS Third Active Alert | ||
{% if state_attr('sensor.nws_alerts', 'title').split(' - ')[2] is defined %} | ||
|
||
## {{ states.sensor.nws_alerts.attributes.title.split(' - ')[2] }} | ||
|
||
{{ state_attr('sensor.nws_alerts', 'display_desc').split('\n\n-\n\n')[2] }} | ||
|
||
{% else %} | ||
none | ||
{% endif %} | ||
- type: conditional | ||
conditions: | ||
- entity: sensor.nws_alerts | ||
state_not: "0" | ||
- entity: sensor.nws_alerts | ||
state_not: "1" | ||
- entity: sensor.nws_alerts | ||
state_not: "2" | ||
- entity: sensor.nws_alerts | ||
state_not: "3" | ||
card: | ||
type: markdown | ||
content: > | ||
--- | ||
|
||
# NWS Fourth Active Alert | ||
{% if state_attr('sensor.nws_alerts', 'title').split(' - ')[3] is defined %} | ||
|
||
## {{ states.sensor.nws_alerts.attributes.title.split(' - ')[3] }} | ||
|
||
{{ state_attr('sensor.nws_alerts', 'display_desc').split('\n\n-\n\n')[3] }} | ||
|
||
{% else %} | ||
none | ||
{% endif %} | ||
- type: conditional | ||
conditions: | ||
- entity: sensor.nws_alerts | ||
state_not: "0" | ||
- entity: sensor.nws_alerts | ||
state_not: "1" | ||
- entity: sensor.nws_alerts | ||
state_not: "2" | ||
- entity: sensor.nws_alerts | ||
state_not: "3" | ||
- entity: sensor.nws_alerts | ||
state_not: "4" | ||
card: | ||
type: markdown | ||
content: > | ||
--- | ||
|
||
# NWS Fifth Active Alert | ||
{% if state_attr('sensor.nws_alerts', 'title').split(' - ')[4] is defined %} | ||
|
||
## {{ states.sensor.nws_alerts.attributes.title.split(' - ')[4] }} | ||
|
||
{{ state_attr('sensor.nws_alerts', 'display_desc').split('\n\n-\n\n')[4] }} | ||
|
||
{% else %} | ||
none | ||
{% endif %} | ||
|
||
- type: entities | ||
title: NWS Alerts History | ||
show_header_toggle: false | ||
state_color: true | ||
entities: | ||
- variable.nws_alerts_event_ids | ||
- type: custom:entity-attributes-card | ||
heading_name: Name | ||
heading_state: State | ||
entity: variable.nws_alerts_event_ids | ||
filter: | ||
include: | ||
- variable.nws_alerts_event_ids.history_1 | ||
- variable.nws_alerts_event_ids.history_2 | ||
- variable.nws_alerts_event_ids.history_3 | ||
- variable.nws_alerts_event_ids.history_4 | ||
- variable.nws_alerts_event_ids.history_5 | ||
- variable.nws_alerts_event_ids.history_6 | ||
- variable.nws_alerts_event_ids.history_7 | ||
- variable.nws_alerts_event_ids.history_8 | ||
- variable.nws_alerts_event_ids.history_9 | ||
- variable.nws_alerts_event_ids.history_10 |
22f828c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried adding this - says does not exist - went to add as a Manual card