I want to be able to have a Markdown card of some sort displaying ha-alerts, I want to be able to actiate alerts using scripts or automations. How can I accomplish this? ( https://design.home-assistant.io/#components/ha-alert , https://www.home-assistant.io/dashboards/markdown/ )
#Displaying Alert on Dashboard
1 messages · Page 1 of 1 (latest)
You could create boolean helpers and turn those on and off by an automation. And then you can use the markdown card with ha-alert and some templating.
Details depend on the specific usecase.
Yeah but that would not work togerther well when wanting to display rt information/states of entities right?
We don't know, what you actually are trying to do.
Once of the use cases I would like is that when the temperature reaches X in a room there is a alert saying, 'In Roon Y it is X degrees, you should open a window'.
That can be done in the Markdown card with templating.
Okay and then I have to use like booleans to activate or deactive?
No. You can just use the temperature value as an if condition.
Something like this?:
{% set temp = states('sensor.temp_lucaskamer_temperature') | float %}
{% if temp > 28 %}
<ha-alert alert-type="warning">
🔥 It is too hot! Current temperature: <b>{{ temp }}°C</b>
</ha-alert>
{% endif %}
Yes.
Okay then that's it, Thanks a lot ❤️
If you don't want to show the Markdown card, if there is nothing to show, you can set according conditions in the visibility settings for example.
One last thing, the hassio docs sya that when adding dismissable after altert type it becomes.. dismissable 😂 . But when I try it there is no X appearing