stockholm/makefu/2configs/home/ham/automation/light_buttons.nix

28 lines
757 B
Nix
Raw Normal View History

2020-12-30 10:02:21 +00:00
2020-11-19 00:39:10 +00:00
let
2021-08-31 13:14:37 +00:00
inherit (import ../lib) btn_cycle_light;
2021-08-27 20:45:16 +00:00
turn_off_all = btn: #lights:
2020-11-19 00:39:10 +00:00
{
alias = "Turn of all lights via ${btn} double click";
trigger = {
platform = "state";
entity_id = "sensor.${btn}_click";
to = "double";
};
action = {
service = "light.turn_off";
2021-08-27 20:45:16 +00:00
#entity_id = lights;
2020-12-30 10:02:21 +00:00
entity_id = "all";
2020-11-19 00:39:10 +00:00
};
};
in {
services.home-assistant.config.automation = [
2021-08-27 20:45:16 +00:00
# (btn_cycle_light "light.arbeitszimmerbeleuchtung" "arbeitszimmer_btn1")
(btn_cycle_light "light.schlafzimmer_komode_osram" "schlafzimmer_btn2" 128)
2021-08-31 13:14:37 +00:00
(btn_cycle_light "light.keller_osram" "keller_btn1" 128)
2021-08-27 20:45:16 +00:00
# (btn_cycle_light "light.wohnzimmerbeleuchtung" "wohnzimmer_btn3")
(turn_off_all "schlafzimmer_btn2" )
2020-11-19 00:39:10 +00:00
];
}