add template & mushroom cards

Signed-off-by: Hadi <[email protected]>
This commit is contained in:
Hadi
2026-10-01 20:26:04 +02:00
parent 2c544c5382
commit fa554c2475
2 changed files with 27 additions and 0 deletions
+26
View File
@@ -11,6 +11,11 @@
"h" "h"
"d" "d"
]; ];
motionRooms = [
"toilet"
"entry"
];
in { in {
sops.secrets = sops.secrets =
{ {
@@ -60,6 +65,27 @@ in {
automation = "!include automations.yaml"; automation = "!include automations.yaml";
script = "!include scripts.yaml"; script = "!include scripts.yaml";
frontend.themes = nixyTheme; frontend.themes = nixyTheme;
# Timestamp of the last motion detection (trigger-based, survives restarts)
template =
map (room: {
trigger = [
{
trigger = "state";
entity_id = "binary_sensor.${room}_motion";
to = "on";
}
];
sensor = [
{
name = "${room} last motion";
unique_id = "${room}_last_motion";
device_class = "timestamp";
icon = "mdi:motion-sensor";
state = "{{ now().isoformat() }}";
}
];
})
motionRooms;
alarm_control_panel = [ alarm_control_panel = [
{ {
platform = "manual"; platform = "manual";
@@ -63,5 +63,6 @@ in {
multiday-calendar-card multiday-calendar-card
pkgs.home-assistant-custom-lovelace-modules.bubble-card pkgs.home-assistant-custom-lovelace-modules.bubble-card
pkgs.home-assistant-custom-lovelace-modules.auto-entities pkgs.home-assistant-custom-lovelace-modules.auto-entities
pkgs.home-assistant-custom-lovelace-modules.mushroom
]; ];
} }