Una card Lovelace per Home Assistant che mostra quante porte/finestre sono aperte e, opzionalmente, l’elenco dettagliato di quali sensori sono aperti/chiusi. Pensata per utilizzare solo componenti nativi (ha-card, ha-icon) e integrarsi con i temi light/dark di Home Assistant.
- Home Assistant 2024.8.0 o superiore.
- HACS installato per una gestione semplice degli aggiornamenti (opzionale ma raccomandato).
- Dashboard Lovelace.
- Apri HACS in Home Assistant.
- Vai su Impostazioni HACS → Custom repositories.
- Aggiungi il repository:
- URL:
https://github.com/MattiaSaiko/lovelace-window-guardian-card - Tipo:
Frontend
- URL:
- Salva.
- Torna alla sezione Frontend di HACS, cerca Window Guardian Card e clicca su Installa.
- Conferma l’installazione e riavvia l’interfaccia se richiesto.
HACS registra automaticamente la risorsa come modulo JS. In caso contrario, vedi la sezione “Registrazione risorsa manuale”.
- Scarica il file
window-guardian-card.jsdall’ultima release del repository. - Copialo in:
config/www/community/lovelace-window-guardian-card/window-guardian-card.js - Riavvia Home Assistant.
- Vai sulla dashboard desiderata.
- Clicca su Modifica dashboard → Aggiungi scheda.
- Cerca “Custom: Window Guardian Card”.
- Compila i campi dell’editor visuale (o passa all’editor YAML) e salva.
La card supporta sia una configurazione semplice sia una configurazione personalizzata in modo da rinominare ogni entità.
| Parametro | Tipo | Descrizione |
|---|---|---|
type |
string | Tipo della card: custom:window-guardian-card |
title |
string | Titolo visualizzato nella card |
entities |
list | Lista di entità da monitorare (vedi configurazione sotto) |
compact |
boolean | Modalità visualizzazione compatta |
show_list |
boolean | Mostra lista dettagliata aperture |
show_closed |
boolean | Mostra anche sensori chiusi |
show_battery |
boolean | Mostra livello batteria sensori |
show_last_changed |
boolean | Mostra timestamp ultimo cambio stato |
attention_threshold |
number | Numero aperture per attivare alert visivo |
device_classes |
list | Classi dispositivi da filtrare: door, window, opening |
tap_action |
string | Azione al tap sulla card: more-info o navigate |
tap_action_path |
string | Path di navigazione (richiesto se tap_action è navigate) |
temperature_entity |
string | Sensore temperatura esterna per protezione antigelo |
temperature_threshold |
number | Soglia temperatura (°C) per attivare alert antigelo |
| Parametro | Tipo | Descrizione |
|---|---|---|
entity |
string | ID dell'entità da monitorare |
name |
string | Nome personalizzato da visualizzare |
icon |
string | Icona MDI personalizzata |
icon_color |
string | Colore icona (hex o nome CSS) |
battery_entity |
string | Sensore batteria specifico per entità |
A Lovelace card for Home Assistant that displays how many doors/windows are open and, optionally, a detailed list of open/closed sensors. Designed to employ only native (ha-card, ha-icon) components and integrate with Home Assistant’s light/dark themes.
- Home Assistant 2024.8.0 or higher.
- HACS installed for easy update management (optional but recommended).
- Dashboard Lovelace.
- Open HACS in Home Assistant.
- Go to HACS Settings → Custom repositories.
- Add the repository:
- URL:
https://github.com/MattiaSaiko/lovelace-window-guardian-card - Type:
Frontend
- URL:
- Save.
- Go back to the Frontend section in HACS, search for Window Guardian Card and click Install.
- Confirm the installation and restart the interface if requested.
HACS automatically registers the resource as a JS module. If not, see the “Manual resource registration” section.
- Download the
window-guardian-card.jsfile from the latest release of the repository. - Copy it to:
config/www/community/lovelace-window-guardian-card/window-guardian-card.js - Restart Home Assistant.
- Go to the desired dashboard.
- Click Edit dashboard → Add card.
- Search for “Custom: Window Guardian Card”.
- Fill in the fields in the visual editor (or switch to the YAML editor) and save.
The card supports both a simple configuration and a customised configuration so that each entity can be renamed.
| Parameter | Type | Description |
|---|---|---|
type |
string | Card type: custom:window-guardian-card |
title |
string | Title displayed in the card |
entities |
list | List of entities to monitor (see configuration below) |
compact |
boolean | Compact display mode |
show_list |
boolean | Display detailed list of openings |
show_closed |
boolean | Also display closed sensors |
show_battery |
boolean | Display battery level sensors |
show_last_changed |
boolean | Display timestamp of last status change |
attention_threshold |
number | Number of openings required to trigger the visual alert |
device_classes |
list | Device classes to filter: door, window, opening |
tap_action |
string | Action on card tap: more-info o navigate |
tap_action_path |
string | Navigation path (required if tap_action è navigate) |
temperature_entity |
string | Outdoor temperature sensor for frost protection |
temperature_threshold |
number | Temperature threshold (°C) to trigger frost alert |
| Parameter | Type | Description |
|---|---|---|
entity |
string | ID of the entity to be monitored |
name |
string | Custom name to display |
icon |
string | Custom MDI icon |
icon_color |
string | Icon colour (hex or CSS name) |
battery_entity |
string | Battery sensor specific to the entity |
If you enjoy using Window Guardian Card and want to support its development, you can:
Your support helps me dedicate more time to improving this card and creating new features for the Home Assistant community.
Thank you! 🙏