Guest User

Untitled

a guest
Jun 1st, 2025
1,262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. type: vertical-stack
  2. cards:
  3. - type: custom:mushroom-template-card
  4. entity: sensor.nws_alerts_alerts
  5. primary: đŸŒŠī¸ National Weather Service Alerts
  6. icon: mdi:alert
  7. icon_color: amber
  8. multiline_secondary: false
  9. tap_action:
  10. action: more-info
  11. secondary: |-
  12. {% if (states('sensor.nws_alerts_alerts') | int) > 0 %}
  13. {{ states('sensor.nws_alerts_alerts') }} active alert{{ 's' if (states('sensor.nws_alerts_alerts') | int) > 1 else '' }}
  14. {% else %}
  15. No active alerts
  16. {% endif %}
  17. badge_color: ""
  18. fill_container: false
  19. - type: conditional
  20. conditions:
  21. - condition: numeric_state
  22. entity: sensor.nws_alerts_alerts
  23. above: 0
  24. card:
  25. type: markdown
  26. content: >
  27. {% set alerts = state_attr('sensor.nws_alerts_alerts', 'Alerts') %} {%
  28. if alerts %}
  29. {% for alert in alerts %}
  30. âš ī¸ **{{ alert.Event }}**
  31.  
  32. 📰 {{ alert.Headline }}
  33.  
  34. 🕒 Issued: {{ as_local(strptime(alert.Sent,
  35. '%Y-%m-%dT%H:%M:%S%z')).strftime('%B %-d, %Y at %-I:%M %p') }}
  36.  
  37. ⏰ Expires: {{ as_local(strptime(alert.Expires,
  38. '%Y-%m-%dT%H:%M:%S%z')).strftime('%B %-d, %Y at %-I:%M %p') }} {% if
  39. alert.Severity != 'Unknown' %}
  40.  
  41. 📊 Severity: {{ alert.Severity }} {% endif %}
  42.  
  43. {% if alert.Certainty != 'Unknown' %} 📡 Certainty: {{ alert.Certainty
  44. }} {% endif %}
  45.  
  46. <details> <summary>📝 <strong>Description</strong></summary>
  47. {% set desc = alert.Description.replace('\n', ' ') %}
  48. {% set parts = desc.split('* ') %}
  49. {% for part in parts if part %}
  50. <strong>{{ part.split('...')[0] | trim }}:</strong> {{ part.split('...', 1)[1] | trim }}
  51. {% endfor %}
  52. </details>
  53.  
  54. <details>
  55. <summary>đŸ“ĸ <strong>Instructions</strong></summary>
  56. {% set instruction = alert.Instruction.replace('\n', ' ') %}
  57. {{ instruction | trim }}
  58. </details>
  59.  
  60. {% endfor %}
  61. {% else %} No active alerts. {% endif %}
  62. grid_options:
  63. columns: 12
  64. rows: auto
Advertisement
Add Comment
Please, Sign In to add comment