diff options
author | Karel Kočí <cynerd@email.cz> | 2022-12-14 15:20:26 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2022-12-14 15:20:26 +0100 |
commit | c8fce8af5101064ea3dcfcb9d2bc39f1b9b83755 (patch) | |
tree | 842dac179e580aafe02526a24ba8982e7ccd713f /nixos/machine/hass | |
parent | c4c0b2a9bfb98250e620c92ac6e173a5946464f7 (diff) | |
download | nixos-personal-c8fce8af5101064ea3dcfcb9d2bc39f1b9b83755.tar.gz nixos-personal-c8fce8af5101064ea3dcfcb9d2bc39f1b9b83755.tar.bz2 nixos-personal-c8fce8af5101064ea3dcfcb9d2bc39f1b9b83755.zip |
Add Home Assistant
Now running on Errol as the cross compilation for python cryptography
does not work correctly.
Diffstat (limited to 'nixos/machine/hass')
-rw-r--r-- | nixos/machine/hass/light.nix | 13 | ||||
-rw-r--r-- | nixos/machine/hass/sensors.nix | 19 |
2 files changed, 32 insertions, 0 deletions
diff --git a/nixos/machine/hass/light.nix b/nixos/machine/hass/light.nix new file mode 100644 index 0000000..a9d158b --- /dev/null +++ b/nixos/machine/hass/light.nix @@ -0,0 +1,13 @@ +[ + { + name = "RGB Osvětlení"; + command_topic = "homeassistant/led-strip"; + brightness_scale = 100; + brightness_command_topic = "bigclown/node/power-controller:0/led-strip/-/brightness/set"; + #brightness_state_topic = "bigclown/node/power-controller:0/led-strip/-/brightness/set"; + rgb_command_template = ''"#{{"%02x" % red}}{{"%02x" % green}}{{"%02x" % blue}}"''; + rgb_command_topic = "bigclown/node/power-controller:0/led-strip/-/color/set"; + #rgb_value_template = ''{{int(value[2:4],16)}},{{int(value[5:7],16)}},{{int(value[8:10],16)}}''; + #rgb_state_topic = "bigclown/node/power-controller:0/led-strip/-/color/set"; + } +] diff --git a/nixos/machine/hass/sensors.nix b/nixos/machine/hass/sensors.nix new file mode 100644 index 0000000..fadd4eb --- /dev/null +++ b/nixos/machine/hass/sensors.nix @@ -0,0 +1,19 @@ +[ + { + name = "Teplota"; + state_class = "measurement"; + state_topic = "bigclown/node/climate-monitor:0/thermometer/0:0/temperature"; + unit_of_measurement = "°C"; + } + { + name = "Vlhkost"; + state_class = "measurement"; + state_topic = "bigclown/node/climate-monitor:0/hygrometer/0:4/relative-humidity"; + unit_of_measurement = "%"; + } + { + name = "Osvětlení"; + state_class = "measurement"; + state_topic = "bigclown/node/climate-monitor:0/lux-meter/0:0/illuminance"; + } +] |