stockholm/makefu/2configs/home/ham/automation/ladestecker_timer.nix
2021-08-31 15:24:48 +02:00

25 lines
534 B
Nix

let
relay = "switch.terrasse_plug_relay";
timeout = "300";
in {
services.home-assistant.config.automation = [
{ alias = "Always turn off Charging station after ${toString (timeout)}m";
trigger = [
{
platform = "state";
entity_id = relay;
to = "on";
for.minutes = timeout;
}
];
action =
[
{
service = "homeassistant.turn_off";
entity_id = [ relay ];
}
];
}
];
}