mirror of
https://github.com/anotherhadi/nixy.git
synced 2026-10-05 11:18:24 +02:00
@@ -11,6 +11,11 @@
|
||||
"h"
|
||||
"d"
|
||||
];
|
||||
|
||||
motionRooms = [
|
||||
"toilet"
|
||||
"entry"
|
||||
];
|
||||
in {
|
||||
sops.secrets =
|
||||
{
|
||||
@@ -60,6 +65,27 @@ in {
|
||||
automation = "!include automations.yaml";
|
||||
script = "!include scripts.yaml";
|
||||
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 = [
|
||||
{
|
||||
platform = "manual";
|
||||
|
||||
@@ -63,5 +63,6 @@ in {
|
||||
multiday-calendar-card
|
||||
pkgs.home-assistant-custom-lovelace-modules.bubble-card
|
||||
pkgs.home-assistant-custom-lovelace-modules.auto-entities
|
||||
pkgs.home-assistant-custom-lovelace-modules.mushroom
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user