2020-01-07 15:52:31 +00:00
|
|
|
let
|
2020-01-08 09:16:21 +00:00
|
|
|
glados = import ../lib;
|
2020-07-28 20:19:17 +00:00
|
|
|
feinstaub_sensor = "sensor.fablab_particulate_matter_2_5um_concentration";
|
|
|
|
ledring = "light.fablab_led_ring";
|
2020-01-07 15:52:31 +00:00
|
|
|
in
|
|
|
|
{
|
|
|
|
automation =
|
2020-01-08 09:16:21 +00:00
|
|
|
[
|
|
|
|
{ alias = "Gute Luft Fablab";
|
|
|
|
trigger = [
|
|
|
|
{
|
|
|
|
platform = "numeric_state";
|
2020-07-28 20:19:17 +00:00
|
|
|
entity_id = feinstaub_sensor;
|
|
|
|
below = 3;
|
2020-01-08 09:16:21 +00:00
|
|
|
}
|
|
|
|
];
|
|
|
|
action =
|
|
|
|
[
|
|
|
|
{ service = "light.turn_on";
|
|
|
|
data = {
|
2020-07-28 20:19:17 +00:00
|
|
|
entity_id = ledring;
|
2020-01-08 09:16:21 +00:00
|
|
|
effect = "Twinkle";
|
|
|
|
color_name = "green";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
|
|
|
{ alias = "mäßige Luft Fablab";
|
|
|
|
trigger = [
|
|
|
|
{
|
|
|
|
platform = "numeric_state";
|
2020-07-28 20:19:17 +00:00
|
|
|
above = 3;
|
|
|
|
below = 10;
|
|
|
|
entity_id = feinstaub_sensor;
|
2020-01-08 09:16:21 +00:00
|
|
|
}
|
|
|
|
];
|
|
|
|
action =
|
|
|
|
[
|
|
|
|
{ service = "light.turn_on";
|
|
|
|
data = {
|
2020-07-28 20:19:17 +00:00
|
|
|
entity_id = ledring;
|
2020-01-08 09:16:21 +00:00
|
|
|
effect = "Twinkle";
|
|
|
|
color_name = "yellow";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
|
|
|
{ alias = "schlechte Luft Fablab";
|
|
|
|
trigger = [
|
|
|
|
{
|
|
|
|
platform = "numeric_state";
|
2020-07-28 20:19:17 +00:00
|
|
|
above = 10;
|
|
|
|
entity_id = feinstaub_sensor;
|
2020-01-08 09:16:21 +00:00
|
|
|
}
|
|
|
|
];
|
|
|
|
action =
|
|
|
|
[
|
|
|
|
{ service = "light.turn_on";
|
|
|
|
data = {
|
2020-07-28 20:19:17 +00:00
|
|
|
entity_id = ledring;
|
|
|
|
effect = "Fireworks";
|
2020-01-08 09:16:21 +00:00
|
|
|
color_name = "red";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
2020-01-09 21:42:39 +00:00
|
|
|
{ alias = "Luft Sensor nicht verfügbar";
|
|
|
|
trigger = [
|
|
|
|
{
|
|
|
|
platform = "state";
|
|
|
|
to = "unavailable";
|
2020-07-28 20:19:17 +00:00
|
|
|
entity_id = feinstaub_sensor;
|
2020-01-09 21:42:39 +00:00
|
|
|
}
|
|
|
|
];
|
|
|
|
action =
|
|
|
|
[
|
|
|
|
{ service = "light.turn_on";
|
|
|
|
data = {
|
2020-07-28 20:19:17 +00:00
|
|
|
entity_id = ledring;
|
2020-01-09 21:42:39 +00:00
|
|
|
effect = "Rainbow";
|
|
|
|
color_name = "blue";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
|
|
|
{ alias = "Fablab Licht Reboot";
|
|
|
|
trigger = [
|
|
|
|
{
|
|
|
|
platform = "state";
|
|
|
|
from = "unavailable";
|
2020-07-28 20:19:17 +00:00
|
|
|
entity_id = ledring;
|
2020-01-09 21:42:39 +00:00
|
|
|
}
|
|
|
|
];
|
|
|
|
action =
|
|
|
|
[
|
|
|
|
{ service = "light.turn_on";
|
|
|
|
data = {
|
2020-07-28 20:19:17 +00:00
|
|
|
entity_id = ledring;
|
2020-01-09 21:42:39 +00:00
|
|
|
effect = "Rainbow";
|
|
|
|
color_name = "orange";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
2020-01-07 15:52:31 +00:00
|
|
|
];
|
|
|
|
}
|