summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/home/ham/automation/fenster_auf.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2021-03-09 22:17:00 +0100
committermakefu <github@syntax-fehler.de>2021-03-09 22:17:00 +0100
commit64bc6f1f6578de055ebdec5748f9af7c6a7d875c (patch)
treeea63c84a1732b3331202a395afb92f2c22665d88 /makefu/2configs/home/ham/automation/fenster_auf.nix
parent07147023ddf7796562017a62369348a6a1b02fdc (diff)
ma ham: add fenster_auf automation
Diffstat (limited to 'makefu/2configs/home/ham/automation/fenster_auf.nix')
-rw-r--r--makefu/2configs/home/ham/automation/fenster_auf.nix33
1 files changed, 33 insertions, 0 deletions
diff --git a/makefu/2configs/home/ham/automation/fenster_auf.nix b/makefu/2configs/home/ham/automation/fenster_auf.nix
new file mode 100644
index 000000000..ccebd5b00
--- /dev/null
+++ b/makefu/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")
+ ];
+}