From b345abe8338bb83449024cc202b8d58ae71e172e Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Fri, 11 Sep 2026 13:34:15 +0200 Subject: [PATCH] add alarm Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com> --- server-modules/home-assistant/default.nix | 24 ++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/server-modules/home-assistant/default.nix b/server-modules/home-assistant/default.nix index bc40aba4..82a59cf8 100644 --- a/server-modules/home-assistant/default.nix +++ b/server-modules/home-assistant/default.nix @@ -13,7 +13,10 @@ ]; in { sops.secrets = - {signal_sender_number.owner = "hass";} + { + signal_sender_number.owner = "hass"; + alarm_code.owner = "hass"; + } // lib.genAttrs signalRecipients (_: {owner = "hass";}); sops.templates."home-assistant-secrets.yaml" = { @@ -22,6 +25,7 @@ in { restartUnits = ["home-assistant.service"]; content = "signal_sender: \"${config.sops.placeholder.signal_sender_number}\"\n" + + "alarm_code: \"${config.sops.placeholder.alarm_code}\"\n" + lib.concatMapStrings (n: "${n}: \"${config.sops.placeholder.${n}}\"\n") signalRecipients; }; @@ -55,6 +59,24 @@ in { automation = "!include automations.yaml"; script = "!include scripts.yaml"; frontend.themes = nixyTheme; + alarm_control_panel = [ + { + platform = "manual"; + name = "Home"; + code = "!secret alarm_code"; + code_arm_required = false; + armed_home = { + arming_time = 0; + delay_time = 0; + trigger_time = 120; + }; + armed_away = { + arming_time = 30; + delay_time = 30; + trigger_time = 120; + }; + } + ]; notify = (map (n: { name = "signal_${n}";