Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type: vertical-stack
- cards:
- - type: custom:mushroom-template-card
- entity: sensor.nws_alerts_alerts
- primary: đŠī¸ National Weather Service Alerts
- icon: mdi:alert
- icon_color: amber
- multiline_secondary: false
- tap_action:
- action: more-info
- secondary: |-
- {% if (states('sensor.nws_alerts_alerts') | int) > 0 %}
- {{ states('sensor.nws_alerts_alerts') }} active alert{{ 's' if (states('sensor.nws_alerts_alerts') | int) > 1 else '' }}
- {% else %}
- No active alerts
- {% endif %}
- badge_color: ""
- fill_container: false
- - type: conditional
- conditions:
- - condition: numeric_state
- entity: sensor.nws_alerts_alerts
- above: 0
- card:
- type: markdown
- content: >
- {% set alerts = state_attr('sensor.nws_alerts_alerts', 'Alerts') %} {%
- if alerts %}
- {% for alert in alerts %}
- â ī¸ **{{ alert.Event }}**
- đ° {{ alert.Headline }}
- đ Issued: {{ as_local(strptime(alert.Sent,
- '%Y-%m-%dT%H:%M:%S%z')).strftime('%B %-d, %Y at %-I:%M %p') }}
- â° Expires: {{ as_local(strptime(alert.Expires,
- '%Y-%m-%dT%H:%M:%S%z')).strftime('%B %-d, %Y at %-I:%M %p') }} {% if
- alert.Severity != 'Unknown' %}
- đ Severity: {{ alert.Severity }} {% endif %}
- {% if alert.Certainty != 'Unknown' %} đĄ Certainty: {{ alert.Certainty
- }} {% endif %}
- <details> <summary>đ <strong>Description</strong></summary>
- {% set desc = alert.Description.replace('\n', ' ') %}
- {% set parts = desc.split('* ') %}
- {% for part in parts if part %}
- <strong>{{ part.split('...')[0] | trim }}:</strong> {{ part.split('...', 1)[1] | trim }}
- {% endfor %}
- </details>
- <details>
- <summary>đĸ <strong>Instructions</strong></summary>
- {% set instruction = alert.Instruction.replace('\n', ' ') %}
- {{ instruction | trim }}
- </details>
- {% endfor %}
- {% else %} No active alerts. {% endif %}
- grid_options:
- columns: 12
- rows: auto
Advertisement
Add Comment
Please, Sign In to add comment