wow, that is some weather alert… never seen that …
nice integration I hadn’t seen before. Since one of my children is moving to the German border I figurer it to be a good addition to my alerts system
had a bit of an initial struggle but got things going for a few relevant cities now. Because I always dislike to hardcode those, I use auto-entities (filter integration) a lot, but for starters use this for loop in Markdown directly:
- type: conditional
conditions:
- entity: binary_sensor.nina_warnings_active
state: 'on'
card:
type: markdown
content: >
<img src="/local/images/nina.png" width="24"/>
{% for w in expand(integration_entities('nina'))
if w.state == 'on' %}
## Be aware: {{w.attributes.friendly_name}}
> Headline: {{w.attributes.headline}}
> Description: {{w.attributes.description}}
<br>
> Severity: *{{w.attributes.severity}}*
> From *{{w.attributes.start}}* to *{{w.attributes.expires}}*
> Sender: {{w.attributes.sender}}
{% endfor %}
Given the fact the Nina integration does not provide a binary Ive made that quickly so we can use it as conditional in the frontend:
- binary_sensor:
- unique_id: nina_warnings_active
state: >
{{integration_entities('nina')
|reject('eq','')
|map('states')
|select('eq','on')
|list|count}}
device_class: problem
nothing fancy just yet, and coming here for inspiration.
most of all Id love to see if I can build that attributes list less verbosely in the loop, and maybe some extra formatting on the timings.
have to throw some warning first
update
after some Nina alerts ive moved to:
type: conditional
conditions:
- entity: binary_sensor.nina_warnings_active
state: 'on'
card:
type: entities
title: Nina waarschuwingen aktief
card_mod:
class: class-header-margin-no-color
style: |
.card-header {
color: rgb(231,92,9);
background: rgb(18,46,129);
}
entities:
- type: custom:hui-element
card_type: markdown
card_mod:
style: |
ha-card {
margin: 0px -16px -16px -16px;
box-shadow: none;
}
content: >
{% for w in expand(integration_entities('nina'))
if w.state == 'on' %}
{% set severity = w.attributes.severity %}
{% set colors = {'Extreme':'#ff0000','Moderate':'#F6BE00','Minor':'#55dd88','Severe':'#800000'} %}
{% set fontcolor = colors.get(severity,'grey') %}
<font color = {{fontcolor}}>**{{w.attributes.friendly_name}}**</font>
> **Headline:** <font color = {{fontcolor}}>{{w.attributes.headline}}</font>
> **Description:** {{w.attributes.description}}
> **Severity:** <font color = {{fontcolor}}>*{{severity}}*</font>
{% if w.attributes.start and w.attributes.expires -%}
> From: *{{as_timestamp(w.attributes.start)|timestamp_custom('%a %-d %b %H:%M')}}* to *{{as_timestamp(w.attributes.expires)|timestamp_custom('%a %-d %b %H:%M')}}*
{%- endif %}
{% if w.attributes.sender -%}
> Sender: {{w.attributes.sender}}
{%- endif %}
{% if not loop.last %} {{'___'}} {% endif %}
{% endfor %}
<img src="/local/images/mowas.png" width="35"> [Live Warnmeldungen übersicht](https://warnung.bund.de/meldungen)
cant get the icon to behave nicely with core Markdown ###, so had to fallback to using text and finally decided to have the one line with a bad line at the bottom…
might be able to align it a bit better , but havent have the time yet. for now this seems to be adequate
any vertical-along img html tag seems to not work…