Open gridlockjoe opened 2 years ago
That is the full set of alert types available.
Now color the alerts with what NWS uses - https://www.weather.gov/help-map
Thanks for sharing that! I'll incorporate the icon enhancement into the next update. I'll try to get an option for alert colors when I get around to refactoring the coding of the template.
This is now integrated into the default yaml packages. I'm still working on a more comprehensive release and will integrate this feature directly in the sensor python code to eliminate the need for all of the extra yaml coding.
I believe a color code attribute in a sensor could be used in the UI to color the alert text. If it works as I think it will, then I'll also add a color code attribute for each alert and include that directly in the sensor python code as well.
I have updated the yaml packages with some fixes for the icon code to prevent template errors and a potential fix for the *_most_recent_active_alert sensors to ensure they get the correct icon.
Please report any alert icon related errors or unexpected behavior here.
FYI. When I copied your updated icon snippet to be included for my Android HA app notifications, I needed to replace hass:.... to mdi:...., otherwise it was just giving the general Home Assistant status bar icon. https://companion.home-assistant.io/docs/notifications/notifications-basic/#notification-status-bar-icon
I also made that change to the 5 alert icon sections for being displayed on the Lovelace Cards. Both hass:... or mdi:... rendered the same.
Eventually, I would love to get my Android notifications colors into the Lovelace cards text display alerts - lines 2985 - 3121 of my modified weatheralerts yaml file.
Here is a demo of the notification alerts.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Is your feature request related to a problem? Please describe. Not a problem, an enhancement
Describe the solution you'd like I have manually edited the weatheralerts_1.yaml file to provide distinct icons for the different alert types. Hope you'll be able to include these in the default code.
Under each of the alerts I replaced
icon_template: hass:alert-rhombus
with:
repeating the same code in each alert block, substituting the alert number.
Describe alternatives you've considered I'm sure there's a more elegant way to do this.