Monitoring UV radiation is crucial for protecting your skin from harmful sun exposure. This card helps you stay informed about the current UV Index and provides actionable recommendations to minimize risks. Whether you're planning outdoor activities or just want to stay safe, this card is an essential addition to your Home Assistant setup.
- Displays real-time UV Index from
sensor.outdoor_uv_index - Color-coded risk level (Green, Yellow, Orange, Red, Purple)
- Shows WHO protection recommendations
- Simple and professional Lovelace design
- Home Assistant OS (HAOS)
- HACS installed
- Mushroom Cards (via HACS → Frontend → "Mushroom Cards")
- Install Mushroom Cards in HACS
- Add the following Lovelace YAML to your Dashboard
type: custom:mushroom-template-card
primary: "UV Index: {{ states('sensor.outdoor_uv_index') }}"
secondary: >
{% set uv = states('sensor.outdoor_uv_index') | float(0) %}
{% if uv < 3 %} 🟢 Low - No protection needed
{% elif uv < 6 %} 🟡 Moderate - Stay in shade, use SPF 30
{% elif uv < 8 %} 🟠 High - SPF 30+, wear a hat and sunglasses
{% elif uv < 11 %} 🔴 Very High - SPF 50+, protective clothing
{% else %} 🟣 Extreme - Avoid sun exposure, SPF 50+
{% endif %}
icon: mdi:white-balance-sunny
icon_color: >
{% set uv = states('sensor.outdoor_uv_index') | float(0) %}
{% if uv < 3 %} green
{% elif uv < 6 %} yellow
{% elif uv < 8 %} orange
{% elif uv < 11 %} red
{% else %} purple
{% endif %}
layout: vertical
multiline_secondary: true
fill_container: trueThe World Health Organization (WHO) has published comprehensive guidelines for protection against UV radiation. These guidelines include measures that vary depending on the UV index, helping to minimize the risks of skin damage and sunburn.
For more information and detailed recommendations, refer to the official WHO guidelines: WHO UV Protection Guidelines
Optionally, you can enable notifications to receive alerts when the UV Index reaches certain thresholds. An example automation file, automation-notification.yml, is provided in the root of this repository. This automation can be imported into Home Assistant and customized to send notifications (e.g., to your mobile device) when the UV Index becomes high or extreme.
How to use:
- Copy
automation-notification.ymlto your Home Assistant configuration directory. - In Home Assistant, go to Settings → Automations & Scenes → Automations.
- Click ⋮ → Import Blueprint and select the
automation-notification.ymlfile. - Adjust the notification targets and thresholds as needed.
Contributions to enhance this project are welcome! If you have suggestions, improvements, or bug fixes, please open an issue or submit a pull request.
This project is licensed under the terms of the BSD 3-Clause License. See the LICENSE file for more details.
