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

59 lines
1.3 KiB
Nix
Raw Normal View History

2021-10-01 16:50:13 +00:00
let
2022-01-30 22:51:32 +00:00
licht = [ "light.flur_statuslight" "light.wohnzimmer_status_led" ];
kehrwoche_color = [ 204 0 255 ]; # pink
nachtlicht_color = [ 255 190 0 ]; # ein dunkles rot
2021-10-01 16:50:13 +00:00
in
{
services.home-assistant.config.automation =
[
{ alias = "Nachtlicht im Flur an";
trigger = {
platform = "sun";
event = "sunset";
};
action =
[
{
service = "light.turn_on";
target.entity_id = licht;
data = {
brightness = 87;
2022-01-30 22:51:32 +00:00
rgb_color = nachtlicht_color;
2021-10-01 16:50:13 +00:00
#effect = "None";
};
}
];
}
2022-01-30 22:51:32 +00:00
{ alias = "Nachtlicht in Flur aus, Kehrwoche an";
2021-10-01 16:50:13 +00:00
trigger = {
platform = "sun";
event = "sunrise";
};
action =
[
2022-01-30 22:51:32 +00:00
{ choose = [
{
conditions = {
condition = "state";
entity_id = "calendar.kehrwoche_kehrwoche";
state = "on";
};
sequence = {
service = "light.turn_on";
target.entity_id = licht;
data = {
brightness = 190;
rgb_color = kehrwoche_color; # pink
};
};
}];
default = {
service = "light.turn_off";
entity_id = licht;
};
2021-10-01 16:50:13 +00:00
}
];
}
];
}