summaryrefslogtreecommitdiffstats
path: root/krebs/2configs/shack/glados
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2020-01-10 09:59:11 +0100
committermakefu <github@syntax-fehler.de>2020-01-10 09:59:11 +0100
commit5f3dcaa95810e1729a884df1d999b236c6eaaccc (patch)
tree11f005ebb695a778bdd499fc6e7fc45776c2a821 /krebs/2configs/shack/glados
parent8c0cf30a2d271c3360d356209350774e634a4543 (diff)
shack/glados: use host consistently
Diffstat (limited to 'krebs/2configs/shack/glados')
-rw-r--r--krebs/2configs/shack/glados/automation/hass-restart.nix1
-rw-r--r--krebs/2configs/shack/glados/lib/default.nix26
-rw-r--r--krebs/2configs/shack/glados/multi/wasser.nix2
-rw-r--r--krebs/2configs/shack/glados/sensors/hass.nix4
4 files changed, 17 insertions, 16 deletions
diff --git a/krebs/2configs/shack/glados/automation/hass-restart.nix b/krebs/2configs/shack/glados/automation/hass-restart.nix
index 0b4439d97..e87354978 100644
--- a/krebs/2configs/shack/glados/automation/hass-restart.nix
+++ b/krebs/2configs/shack/glados/automation/hass-restart.nix
@@ -11,6 +11,7 @@
data = {
entity_id = "light.fablab_led";
effect = "Rainbow";
+ color_name = "yellow";
};
}
];
diff --git a/krebs/2configs/shack/glados/lib/default.nix b/krebs/2configs/shack/glados/lib/default.nix
index 19c657e64..6737af842 100644
--- a/krebs/2configs/shack/glados/lib/default.nix
+++ b/krebs/2configs/shack/glados/lib/default.nix
@@ -4,32 +4,32 @@ in
{
esphome =
{
- temp = {name, topic ? "temperature" }:
+ temp = {host, topic ? "temperature" }:
{
platform = "mqtt";
- name = "${name} Temperature";
+ name = "${host} Temperature";
device_class = "temperature";
unit_of_measurement = "°C";
icon = "mdi:thermometer";
- state_topic = "${prefix}/${name}/sensor/${topic}/state";
- availability_topic = "${prefix}/${name}/status";
+ state_topic = "${prefix}/${host}/sensor/${topic}/state";
+ availability_topic = "${prefix}/${host}/status";
payload_available = "online";
payload_not_available = "offline";
};
- hum = {name, topic ? "humidity" }:
+ hum = {host, topic ? "humidity" }:
{
platform = "mqtt";
unit_of_measurement = "%";
icon = "mdi:water-percent";
device_class = "humidity";
- name = "${name} Humidity";
- state_topic = "${prefix}/${name}/sensor/${topic}/state";
- availability_topic = "${prefix}/${name}/status";
+ name = "${host} Humidity";
+ state_topic = "${prefix}/${host}/sensor/${topic}/state";
+ availability_topic = "${prefix}/${host}/status";
payload_available = "online";
payload_not_available = "offline";
};
# copied from "homeassistant/light/fablab_led/led_ring/config"
- led = {name, topic ? "led", host ? name }:
+ led = {host, topic ? "led", name ? host}:
{ # name: fablab_led
# topic: led_ring
platform = "mqtt";
@@ -64,7 +64,7 @@ in
icon = "mdi:chemical-weapon";
inherit name;
state_topic = "${prefix}/${host}/sensor/${topic}/state";
- availability_topic = "${prefix}/${name}/status";
+ availability_topic = "${prefix}/${host}/status";
};
dust_100m = {host, name ? "${host} < 10µm", topic ? "particulate_matter_100m_concentration" }:
{
@@ -72,8 +72,8 @@ in
unit_of_measurement = "µg/m³";
icon = "mdi:chemical-weapon";
inherit name;
- state_topic = "${prefix}/${name}/sensor/${topic}/state";
- availability_topic = "${prefix}/${name}/status";
+ state_topic = "${prefix}/${host}/sensor/${topic}/state";
+ availability_topic = "${prefix}/${host}/status";
};
switch = {host, name ? "${host} Button", topic ? "btn" }:
# host: ampel
@@ -89,7 +89,7 @@ in
};
tasmota =
{
- plug = {name, topic ? name }:
+ plug = {host, name ? host, topic ? host}:
{
platform = "mqtt";
inherit name;
diff --git a/krebs/2configs/shack/glados/multi/wasser.nix b/krebs/2configs/shack/glados/multi/wasser.nix
index e909cce74..cdfe01405 100644
--- a/krebs/2configs/shack/glados/multi/wasser.nix
+++ b/krebs/2configs/shack/glados/multi/wasser.nix
@@ -4,7 +4,7 @@ let
in
{
switch = [
- (glados.tasmota.plug { name = "Wasser"; topic = "plug";} )
+ (glados.tasmota.plug { host = "Wasser"; topic = "plug";} )
];
automation =
diff --git a/krebs/2configs/shack/glados/sensors/hass.nix b/krebs/2configs/shack/glados/sensors/hass.nix
index 997344366..8de0ef391 100644
--- a/krebs/2configs/shack/glados/sensors/hass.nix
+++ b/krebs/2configs/shack/glados/sensors/hass.nix
@@ -1,5 +1,5 @@
let
glados = import ../lib;
in
- (map (name: glados.esphome.temp {inherit name;}) [ "lounge" "werkstatt" "herrenklo" "dusche" "fablab" "whc" ])
- ++ (map (name: glados.esphome.hum {inherit name;}) [ "lounge" "werkstatt" "herrenklo" "dusche" "fablab" "whc" ])
+ (map (host: glados.esphome.temp {inherit host;}) [ "lounge" "werkstatt" "herrenklo" "dusche" "fablab" "whc" ])
+ ++ (map (host: glados.esphome.hum {inherit host;}) [ "lounge" "werkstatt" "herrenklo" "dusche" "fablab" "whc" ])