diff options
author | makefu <github@syntax-fehler.de> | 2021-08-31 15:14:37 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2021-08-31 15:24:48 +0200 |
commit | 6fa5b38bed3f8e73d6f86a844ef775735a3cad29 (patch) | |
tree | a0c171025107c1adef3c0f1a6eac5cbc65862436 /makefu/2configs/home/ham/automation/ladestecker_timer.nix | |
parent | 2c9923264e318ad83ab9ceb4a13e47112dff0d4f (diff) |
ma ham: consolidate button management
Diffstat (limited to 'makefu/2configs/home/ham/automation/ladestecker_timer.nix')
-rw-r--r-- | makefu/2configs/home/ham/automation/ladestecker_timer.nix | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/makefu/2configs/home/ham/automation/ladestecker_timer.nix b/makefu/2configs/home/ham/automation/ladestecker_timer.nix new file mode 100644 index 000000000..8e877129c --- /dev/null +++ b/makefu/2configs/home/ham/automation/ladestecker_timer.nix @@ -0,0 +1,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 ]; + } + ]; + } + ]; +} |