summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/home/ham/automation/ladestecker_timer.nix
blob: 8e877129c8b113f7a1de85607cd2c52f92fc77a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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 ];
          }
        ];
      }
  ];
}