summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/home/ham/automation
diff options
context:
space:
mode:
Diffstat (limited to 'makefu/2configs/home/ham/automation')
-rw-r--r--makefu/2configs/home/ham/automation/keller_buttons.nix7
-rw-r--r--makefu/2configs/home/ham/automation/ladestecker_timer.nix24
-rw-r--r--makefu/2configs/home/ham/automation/light_buttons.nix4
3 files changed, 27 insertions, 8 deletions
diff --git a/makefu/2configs/home/ham/automation/keller_buttons.nix b/makefu/2configs/home/ham/automation/keller_buttons.nix
deleted file mode 100644
index 598dc7df0..000000000
--- a/makefu/2configs/home/ham/automation/keller_buttons.nix
+++ /dev/null
@@ -1,7 +0,0 @@
-let
- inherit (../lib) btn_cycle_light;
-in {
- services.home-assistant.config.automation = [
- (btn_cycle_light "light.keller_osram" "keller_btn1" 128)
- ];
-}
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 ];
+ }
+ ];
+ }
+ ];
+}
diff --git a/makefu/2configs/home/ham/automation/light_buttons.nix b/makefu/2configs/home/ham/automation/light_buttons.nix
index b3c9ecdb6..62fc87bb4 100644
--- a/makefu/2configs/home/ham/automation/light_buttons.nix
+++ b/makefu/2configs/home/ham/automation/light_buttons.nix
@@ -1,6 +1,6 @@
let
- inherit (../lib) btn_cycle_light;
+ inherit (import ../lib) btn_cycle_light;
turn_off_all = btn: #lights:
{
alias = "Turn of all lights via ${btn} double click";
@@ -19,6 +19,8 @@ in {
services.home-assistant.config.automation = [
# (btn_cycle_light "light.arbeitszimmerbeleuchtung" "arbeitszimmer_btn1")
(btn_cycle_light "light.schlafzimmer_komode_osram" "schlafzimmer_btn2" 128)
+
+ (btn_cycle_light "light.keller_osram" "keller_btn1" 128)
# (btn_cycle_light "light.wohnzimmerbeleuchtung" "wohnzimmer_btn3")
(turn_off_all "schlafzimmer_btn2" )
];