stockholm/krebs/2configs/shack/glados/multi/schlechte_luft.nix

110 lines
2.4 KiB
Nix

let
glados = import ../lib;
in
{
automation =
[
{ alias = "Gute Luft Fablab";
trigger = [
{
platform = "numeric_state";
below = 25;
entity_id = "sensor.fablab_feinstaub_2_5um";
}
];
action =
[
{ service = "light.turn_on";
data = {
entity_id = "light.fablab_led";
effect = "Twinkle";
color_name = "green";
};
}
];
}
{ alias = "mäßige Luft Fablab";
trigger = [
#{
# platform = "numeric_state";
# above = 25;
# entity_id = "sensor.fablab_feinstaub_25m";
#}
{
platform = "numeric_state";
above = 25;
below = 50;
entity_id = "sensor.fablab_feinstaub_2_5um";
}
];
action =
[
{ service = "light.turn_on";
data = {
entity_id = "light.fablab_led";
effect = "Twinkle";
color_name = "yellow";
};
}
];
}
{ alias = "schlechte Luft Fablab";
trigger = [
{
platform = "numeric_state";
above = 50;
entity_id = "sensor.fablab_feinstaub_2_5um";
}
];
action =
[
{ service = "light.turn_on";
data = {
entity_id = "light.fablab_led";
effect = "Twinkle";
color_name = "red";
};
}
];
}
{ alias = "Luft Sensor nicht verfügbar";
trigger = [
{
platform = "state";
to = "unavailable";
entity_id = "sensor.fablab_feinstaub_2_5um";
}
];
action =
[
{ service = "light.turn_on";
data = {
entity_id = "light.fablab_led";
effect = "Rainbow";
color_name = "blue";
};
}
];
}
{ alias = "Fablab Licht Reboot";
trigger = [
{
platform = "state";
from = "unavailable";
entity_id = "light.fablab_led";
}
];
action =
[
{ service = "light.turn_on";
data = {
entity_id = "light.fablab_led";
effect = "Rainbow";
color_name = "orange";
};
}
];
}
];
}