summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/home/ham/automation/fenster_auf.nix
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2021-03-17 15:42:13 +0100
committerlassulus <lassulus@lassul.us>2021-03-17 15:42:13 +0100
commit3d1472a7cac3ab2c5f9efd06a501368308681999 (patch)
tree950fbe49dfd060923756dd517c41f27f646857de /makefu/2configs/home/ham/automation/fenster_auf.nix
parentf659c1879f6e0a0e9228205edd794aaab467aa0b (diff)
parent2044ad632b68ce173463287a9f437aae699bda83 (diff)
Merge remote-tracking branch 'gum/master'
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")
+ ];
+}