which also uses a template sensor.weer_alarm, (filtering the awareness_level, because this card won’t accept things like .split(’;’)[0] yet …) but you get the idea:
Ok, so you DID split the meteoalarm out in different sensors. That was what I was thinking was necessary as well.
You also make meteoalarm_brabant sensors as I can see it.
I guess that is the way forward then.
this url works: https://www.meteoalarm.eu/en_UK/0/0/UK013-London+South+East.html as does this: https://www.meteoalarm.eu/en_UK/0/0/UK013-London-South-East.html
I have a feeling there might be a bug in the code that doesn’t allow for the ‘&’.
Unfortunately my Python skill level is nowhere near high enough to check…
sorry to hear it doesn’t work. maybe the dev can help out, file an issue?
must say I had high expectations of this component, but it seems rather slow. Still showing the alarm code it did yesterday, and we had 2 serious weather changes in the past 24 hours… So either the meteoalarm is useless for actual and short term warnings (as many people complain all the time) or the card should be updated more frequently. Suspect the former, since checking the national weather authority shows the exact same code…
yes, that’s how I understood it also. Had been looking for a open api to the dutch KNMI weeralarm for a longer time, which seems to not be available. That why I welcomed the meteoalarm initiative and component integration.
Maybe its use is specifically longer term, and we should complement that with current weather sensors/integrations
today, the meteoalarm integration and sensor finally changed state. It is Off. However, the markdown card I made, based on its attributes is useless now:
the binary_sensor has no attributes in the Off state, which I would classify as an issue, maybe even a bug?
the integration should/could easily be made aware of the ‘safe’ situation, and replace the attributes with some default ‘Nothing to report’ text, rather then no attributes at all…
also, since it is off, the device_class: safety should take care of the icon being mdi:shield-check, which it obviously doesn’t.
Nevermind the icon_color template I made myself, which is based on the attribute awareness_level. This faults now too, since that attribute is no longer populated, and the template is still in the last state…
So I got the meteoalarm thing to show up properly now, by adding the custom card mod, I was able to get the attributes showing the way I wanted to in a card.
The ‘event’ attribute holds a colour and a type, like ‘yellow rain’.
I would like extract the first word, and use that as some sort of colour, and then keep the second word for the type of alert.
But how do I extract a single word from an attribute?
Hahaaaa, got it:
{{ state_attr(‘binary_sensor.meteoalarm’,‘event’).split(’ ‘)[0] }}
That will extract the first word
{{ state_attr(‘binary_sensor.meteoalarm’,‘event’).split(’ ')[1] }}
the second.
And the result is looking good:
I had to pull out the colour and type via two new sensors, as I couldn’t get the jinja split to work directly in the lovelace ui.
I couldn’t make it change the background with the sensor value, but it looks great with just changing the text.
Now I need to improve the automation, as we went from yellow to orange here in denmark, with a new warning, and the warning was never sent out via the automation, as that checks for ‘off’.
So I will store the ‘description’ in a variable, and have the automation check against that instead I think, if I can make it work.
It isn’t as pretty, but now it’s invisible when no alert is active.
I’ve also changed the automation to simply react on ‘state change’, and not just from off to something else. I did add a condition that it shouldn’t change to off, but that doesn’t seem to work for me yet (I got a ‘none’ alert when the latest alert timed out).
I really like the way you configured the Meteoalarm sensor to show in a card and like to do it myself
I’m very new to all this and don’t now how you made those template_sensors?
How did you extract those attributes into a new sensor?
Could one of you show me how to start?