Open Tobboss opened 1 year ago
Hey there @runningman84, @stephan192, @andarotajo, mind taking a look at this feedback as it has been labeled with an integration (dwd_weather_warnings
) you are listed as a code owner for? Thanks!
I'm not sure, if such information is "wanted" in the integration documentation, someone else would have to answer that part. That said, I agree that the sensors are not really "Lovelace friendly". I'm sure it's possible to get the relevant information using templated sensors, e.g. using a helper.
I've searched for something usable in HACS and found https://github.com/MrBartusek/MeteoalarmCard. You could try that for a simpler solution, it seems to support the core DWD integration.
Thank you, I tried Meteoalarm but it's not working. My entities are not recognized as dwd entities (HA in German). Will have to file an issue there. I know it's uncommon to document more than just the integration in the wiki. But here I am stuck as never before and maybe it's suitable to give hints or a little best practice on how to get started with this integration in a stock HA way.
Ah my HA is in English, maybe thats why it worked for me in my test just now. My configuration for reference:
type: custom:meteoalarm-card
entities:
- entity: sensor.test_current_warning_level
- entity: sensor.test_advance_warning_level
integration: dwd
disable_swiper: false
override_headline: false
hide_when_no_warning: false
hide_caption: false
scaling_mode: headline_and_scale
Yes I will check why meteo is not working. I just used the proposed demo config and also tried with the GUI. Nevertheless, main goal would be not to be dependend on a HACS frontend element when using a core integration. So maybe someone comes up with a head start for simple usage or everything docu related stays as it is :)
Due to the nature of the integration, i.e. dynamically added attributes for the warning data, it's not easy to process the data in a satisfying way for the frontend. Personally, I'm using Appdaemon to send myself notifications, if any relevant weather warnings appear (like hail) because using Python is just way easier for this sort of stuff.
That said, I've played around a bit with templates and can offer a snippet you can experiment with
{% set warnings = int(states("sensor.test_current_warning_level", 0)) %}
{% if warnings == 1 %}
{% set data = state_attr("sensor.test_current_warning_level", "warning_1") %}
{{ data.event }}
{% endif %}
I'm not really good myself, though I can recommend going down this rabbit hole as you can do useful stuff with templating :) This snippet checks the sensor for the warning count and reads the event
attribute for the first warning. You could do it like this for every interesting attribute and create template sensors like sensor.test_current_warning_1_event
.
You could also concatenate multiple strings by replacing {{ data.event }}
with {{ data.event }}, {{ data.event_code }}
. But this would just be for 1 warning. The integration creates a block of information for each warning, so you'd have to create x sensors in case there's more than 1 warning.
Hope that helps a bit
@Tobboss there is thread about a markdown card existing in the community forum. https://community.home-assistant.io/t/dwd-warnwetter-markdown-card/180274/27
This is great. Will have to do some adaptions since entity names changed, but this is a good start. I will try to adapt the knowledge to a custom button card for using icons. Thanks for the hint
Feedback
While most of the integration documentation do not include how to visualize because they add entities of known and self explainable domains, this one is just creating a binary sensor and needs advanced knowledge to create a functional element.
My guess is one would need a Markdown Card or custom template card like Mushroom Template Card and dig into templating?
I would love a copy/paste example to start with, because getting started is a steep learning here for the average user compared to most other core integrations.
URL
https://www.home-assistant.io/integrations/dwd_weather_warnings/
Version
2023.10.3
Additional information
No response