https://github.com/filipnet/haos-uv-index
Home Assistant UV Index Card – A professional Lovelace card displaying the real-time UV Index with WHO-based protection recommendations. Uses Mushroom Cards for a clean, modern look.
https://github.com/filipnet/haos-uv-index
cards dashboard guidelines haos home-assistant index lovelace mushroom mushroom-cards protection smart-home sun uv uv-index who
Last synced: 2 months ago
JSON representation
Home Assistant UV Index Card – A professional Lovelace card displaying the real-time UV Index with WHO-based protection recommendations. Uses Mushroom Cards for a clean, modern look.
- Host: GitHub
- URL: https://github.com/filipnet/haos-uv-index
- Owner: filipnet
- License: bsd-3-clause
- Created: 2025-03-14T19:21:29.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-03-14T19:55:27.000Z (7 months ago)
- Last Synced: 2025-03-14T20:32:27.398Z (7 months ago)
- Topics: cards, dashboard, guidelines, haos, home-assistant, index, lovelace, mushroom, mushroom-cards, protection, smart-home, sun, uv, uv-index, who
- Homepage: http://www.filipnet.de
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README


# Home Assistant UV Index
![]()
HAOS UV Index is a professional Lovelace UI card for Home Assistant that displays the real-time UV Index based on data from sensor.outdoor_uv_index. The card provides color-coded risk levels and protection recommendations according to WHO guidelines. It uses Mushroom Cards for a modern and clean design, making it easy to assess UV exposure at a glance.- [Home Assistant UV Index](#home-assistant-uv-index)
- [Why Use This Card?](#why-use-this-card)
- [Features](#features)
- [Requirements](#requirements)
- [Installation](#installation)
- [Lovelace YAML](#lovelace-yaml)
- [WHO UV Protection Guidelines](#who-uv-protection-guidelines)
- [Contribution](#contribution)
- [License](#license)## Why Use This Card?
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.
## Features
- 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## Requirements
- **Home Assistant OS (HAOS)**
- **HACS installed**
- **Mushroom Cards** (via HACS → Frontend → "Mushroom Cards")## Installation
1. Install **Mushroom Cards** in HACS
2. Add the following Lovelace YAML to your **Dashboard**## Lovelace YAML
```yaml
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: true
```
## WHO UV Protection GuidelinesThe 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](https://www.who.int/news-room/questions-and-answers/item/radiation-the-ultraviolet-(uv)-index)## Notification Automation
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:**
1. Copy `automation-notification.yml` to your Home Assistant configuration directory.
2. In Home Assistant, go to **Settings → Automations & Scenes → Automations**.
3. Click **⋮ → Import Blueprint** and select the `automation-notification.yml` file.
4. Adjust the notification targets and thresholds as needed.## Contribution
Contributions to enhance this project are welcome! If you have suggestions, improvements, or bug fixes, please open an issue or submit a pull request.
## License
This project is licensed under the terms of the BSD 3-Clause License. See the [LICENSE](LICENSE) file for more details.