From 11f67addffc266e3a136907c6fe8b428b1864d96 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 9 Mar 2021 22:17:00 +0100 Subject: [PATCH] ma ham: add fenster_auf automation --- 2configs/home/ham/automation/fenster_auf.nix | 33 ++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 2configs/home/ham/automation/fenster_auf.nix diff --git a/2configs/home/ham/automation/fenster_auf.nix b/2configs/home/ham/automation/fenster_auf.nix new file mode 100644 index 0000000..ccebd5b --- /dev/null +++ b/2configs/home/ham/automation/fenster_auf.nix @@ -0,0 +1,33 @@ +let + min = 20; + fenster_offen = name: entity: + { alias = "${name} seit ${toString min} Minuten offen"; + trigger = [ + { + platform = "state"; + entity_id = entity; + to = "on"; + for.minutes = min; + } + ]; + action = + [ + { + service = "notify.firetv_wohnzimmer"; + data = { + title = "${name} seit ${toString min} Minuten offen"; + message = "Bitte einmal checken ob das ok ist :)"; + data = { + interrupt = 1; + duration = 300; + }; + }; + } + ]; + }; +in { + services.home-assistant.config.automation = [ + (fenster_offen "Badezimmerfenster" "binary_sensor.badezimmer_fenster_contact") + (fenster_offen "Duschfenster" "binary_sensor.dusche_fenster_contact") + ]; +}