diff options
author | lassulus <git@lassul.us> | 2023-06-19 03:25:39 +0200 |
---|---|---|
committer | lassulus <git@lassul.us> | 2023-06-19 03:25:39 +0200 |
commit | 139799c53cdaf55c362109e01be9dd96cc8700ed (patch) | |
tree | b1ce719ec8f62458bce2d9fe2191b8d004630f2a /makefu/2configs/home/ham/automation/light_buttons.nix | |
parent | cb8fbb09127392a17d698d91f78ede7ae46accb8 (diff) | |
parent | a766e88e7c8d87aa6bdbde796d3a454f7b5e546e (diff) |
Merge remote-tracking branch 'gum/master'
Diffstat (limited to 'makefu/2configs/home/ham/automation/light_buttons.nix')
-rw-r--r-- | makefu/2configs/home/ham/automation/light_buttons.nix | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/makefu/2configs/home/ham/automation/light_buttons.nix b/makefu/2configs/home/ham/automation/light_buttons.nix index 1892917c4..460d48bc4 100644 --- a/makefu/2configs/home/ham/automation/light_buttons.nix +++ b/makefu/2configs/home/ham/automation/light_buttons.nix @@ -1,10 +1,12 @@ let inherit (import ../lib) btn_cycle_light; + schlafzimmer_komode = "light.schlafzimmer_komode_osram"; + schlafzimmer_button = "sensor.schlafzimmer_btn2_click"; in { services.home-assistant.config.automation = [ # (btn_cycle_light "light.arbeitszimmerbeleuchtung" "arbeitszimmer_btn1") - (btn_cycle_light "light.schlafzimmer_komode_osram" "schlafzimmer_btn2" 128) + { alias = "toggle keller"; trigger = { @@ -32,21 +34,35 @@ in { service = "light.toggle"; data = { entity_id = "light.keller_osram"; - brightness = 50; + brightness = 25; }; }; } # (btn_cycle_light "light.wohnzimmerbeleuchtung" "wohnzimmer_btn3") { - alias = "Turn of all lights via schlafzimmer_btn2 double click"; + alias = "Dim Toggle schlafzimmer komode"; trigger = { platform = "state"; - entity_id = "sensor.schlafzimmer_btn2_click"; + entity_id = schlafzimmer_button; + to = "single"; + }; + action = { + service = "light.toggle"; + entity_id = schlafzimmer_komode; + brightness = 1; + }; + } + { + alias = "Bright Toggle schlafzimmer komode"; + trigger = { + platform = "state"; + entity_id = schlafzimmer_button; to = "double"; }; action = { - service = "light.turn_off"; - entity_id = "all"; + service = "light.toggle"; + entity_id = schlafzimmer_komode; + brightness = 255; }; } ]; |