diff options
author | makefu <github@syntax-fehler.de> | 2023-06-03 15:27:46 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2023-06-03 15:27:46 +0200 |
commit | be3284417942c0164c1b32c9cf34ba44bcfb86c3 (patch) | |
tree | 4302b9ce28125003e4daf5ae411f65cef58537ef /makefu/2configs/home/ham/automation/light_buttons.nix | |
parent | dd0a6294c8699640f47127f237104aac9d96c896 (diff) |
ma home: deploy home-assistant via docker
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; }; } ]; |