ma ham: add fenster_auf automation
This commit is contained in:
parent
07147023dd
commit
64bc6f1f65
33
makefu/2configs/home/ham/automation/fenster_auf.nix
Normal file
33
makefu/2configs/home/ham/automation/fenster_auf.nix
Normal file
@ -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")
|
||||
];
|
||||
}
|
Loading…
Reference in New Issue
Block a user