From ef25d69c4d273765afd2ef86783e42bc98ca4b3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Fri, 30 Dec 2022 21:13:56 +0100 Subject: nixos: move home assistant around --- nixos/modules/home-assistant/light.nix | 13 +++++++++++++ nixos/modules/home-assistant/sensors.nix | 19 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 nixos/modules/home-assistant/light.nix create mode 100644 nixos/modules/home-assistant/sensors.nix (limited to 'nixos/modules/home-assistant') diff --git a/nixos/modules/home-assistant/light.nix b/nixos/modules/home-assistant/light.nix new file mode 100644 index 0000000..a9d158b --- /dev/null +++ b/nixos/modules/home-assistant/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/modules/home-assistant/sensors.nix b/nixos/modules/home-assistant/sensors.nix new file mode 100644 index 0000000..fadd4eb --- /dev/null +++ b/nixos/modules/home-assistant/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"; + } +] -- cgit v1.2.3