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

124 lines
3.0 KiB
Nix
Raw Normal View History

2020-01-07 15:52:31 +00:00
let
2020-01-08 09:16:21 +00:00
glados = import ../lib;
2020-01-07 15:52:31 +00:00
in
{
# LED
2020-01-08 09:16:21 +00:00
light = [
(glados.esphome.led { name = "Fablab LED"; host = "fablab_led"; topic = "led_ring"; })
(glados.esphome.led { name = "Fablab LED Part A"; host = "fablab_led"; topic = "A";})
(glados.esphome.led { name = "Fablab LED Part B"; host = "fablab_led"; topic = "B";})
(glados.esphome.led { name = "Fablab LED Part C"; host = "fablab_led"; topic = "C";})
(glados.esphome.led { name = "Fablab LED Part D"; host = "fablab_led"; topic = "D";})
];
sensor = [
(glados.esphome.temp { host = "fablab_feinstaub";})
2020-01-08 09:16:21 +00:00
(glados.esphome.dust_25m { host = "fablab_feinstaub";})
(glados.esphome.dust_100m { host = "fablab_feinstaub";})
2020-01-07 15:52:31 +00:00
];
automation =
2020-01-08 09:16:21 +00:00
[
{ alias = "Gute Luft Fablab";
trigger = [
{
platform = "numeric_state";
below = 25;
entity_id = "sensor.fablab_feinstaub_2_5um";
2020-01-08 09:16:21 +00:00
}
];
action =
[
{ service = "light.turn_on";
data = {
entity_id = "light.fablab_led";
2020-01-08 09:16:21 +00:00
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";
2020-01-08 09:16:21 +00:00
}
];
action =
[
{ service = "light.turn_on";
data = {
entity_id = "light.fablab_led";
2020-01-08 09:16:21 +00:00
effect = "Twinkle";
color_name = "yellow";
};
}
];
}
{ alias = "schlechte Luft Fablab";
trigger = [
{
platform = "numeric_state";
above = 50;
entity_id = "sensor.fablab_feinstaub_2_5um";
2020-01-08 09:16:21 +00:00
}
];
action =
[
{ service = "light.turn_on";
data = {
entity_id = "light.fablab_led";
2020-01-08 09:16:21 +00:00
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";
};
}
];
}
2020-01-07 15:52:31 +00:00
];
}