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

70 lines
1.7 KiB
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;
schlafzimmer_komode = "light.schlafzimmer_komode_osram";
schlafzimmer_button = "sensor.schlafzimmer_btn2_click";
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")
2021-12-04 16:31:26 +00:00
{
alias = "toggle keller";
trigger = {
platform = "state";
entity_id = "sensor.keller_btn1_click";
to = "single";
};
action = {
service = "light.toggle";
#entity_id = lights;
data = {
entity_id = "light.keller_osram";
brightness = 255;
};
};
}
{
alias = "low brightness keller with doubleclick";
trigger = {
platform = "state";
entity_id = "sensor.keller_btn1_click";
to = "double";
};
action = {
service = "light.toggle";
data = {
entity_id = "light.keller_osram";
brightness = 25;
2021-12-04 16:31:26 +00:00
};
};
}
2021-08-27 20:45:16 +00:00
# (btn_cycle_light "light.wohnzimmerbeleuchtung" "wohnzimmer_btn3")
2021-12-04 16:31:26 +00:00
{
alias = "Dim Toggle schlafzimmer komode";
2021-12-04 16:31:26 +00:00
trigger = {
platform = "state";
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;
2021-12-04 16:31:26 +00:00
to = "double";
};
action = {
service = "light.toggle";
entity_id = schlafzimmer_komode;
brightness = 255;
2021-12-04 16:31:26 +00:00
};
}
2020-11-19 00:39:10 +00:00
];
}