mirror of
https://git.sr.ht/~magic_rb/cluster
synced 2024-11-23 16:47:35 +01:00
55 lines
1.1 KiB
Nix
55 lines
1.1 KiB
Nix
|
{
|
||
|
alias = "Bathroom Light Dim";
|
||
|
description = "";
|
||
|
id = "c28cad3b-8435-48b4-9ced-bd5befaf11df";
|
||
|
|
||
|
trigger = [
|
||
|
{
|
||
|
entity_id = [ "sensor.0x540f57fffe3c601d_action" ];
|
||
|
id = "brightness_down";
|
||
|
platform = "state";
|
||
|
to = "brightness_move_down";
|
||
|
}
|
||
|
{
|
||
|
entity_id = [ "sensor.0x540f57fffe3c601d_action" ];
|
||
|
platform = "state";
|
||
|
to = "brightness_stop";
|
||
|
}
|
||
|
];
|
||
|
|
||
|
condition = [ ];
|
||
|
|
||
|
action = [{
|
||
|
"else" = [{ stop = ""; }];
|
||
|
"if" = [{
|
||
|
condition = "trigger";
|
||
|
id = "brightness_down";
|
||
|
}];
|
||
|
"then" = [{
|
||
|
repeat = {
|
||
|
sequence = [
|
||
|
{
|
||
|
data = { brightness_step_pct = -10; };
|
||
|
service = "light.turn_on";
|
||
|
target = { entity_id = "light.bathroom_lights"; };
|
||
|
}
|
||
|
{
|
||
|
delay = {
|
||
|
hours = 0;
|
||
|
milliseconds = 200;
|
||
|
minutes = 0;
|
||
|
seconds = 0;
|
||
|
};
|
||
|
}
|
||
|
];
|
||
|
while = [{
|
||
|
condition = "not";
|
||
|
conditions = [ ];
|
||
|
}];
|
||
|
};
|
||
|
}];
|
||
|
}];
|
||
|
|
||
|
mode = "restart";
|
||
|
}
|