From 5b2062f912d29fc044a30408df3693c0dea7196e Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Sun, 20 Dec 2020 01:33:24 +0100 Subject: [PATCH] hass improvements --- configs/pepe/home-assistant.nix | 23 ++++++++++--------- .../home-assistant/zigbee2mqtt/heater.nix | 8 +++++++ 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/configs/pepe/home-assistant.nix b/configs/pepe/home-assistant.nix index c79a2b3..b8ea9fd 100644 --- a/configs/pepe/home-assistant.nix +++ b/configs/pepe/home-assistant.nix @@ -414,19 +414,20 @@ in { service = "mqtt.publish"; data_template = { topic = "zigbee2mqtt/${heater}/set"; # office - payload_template = '' - {"system_mode":"auto","current_heating_setpoint":${ - toString temperatur - }}''; - }; - }; - heater_off = heater: { - service = "mqtt.publish"; - data_template = { - topic = "zigbee2mqtt/${heater}/set"; # office - payload_template = ''{"system_mode":"off"}''; + payload_template = builtins.toJSON { + system_mode = "auto"; + current_heating_setpoint = toString temperatur; + eurotronic_host_flags.window_open = false; + }; }; }; + #heater_off = heater: { + # service = "mqtt.publish"; + # data_template = { + # topic = "zigbee2mqtt/${heater}/set"; # office + # payload_template = ''{"system_mode":"off"}''; + # }; + #}; hot = 22; cold = 14; diff --git a/configs/pepe/home-assistant/zigbee2mqtt/heater.nix b/configs/pepe/home-assistant/zigbee2mqtt/heater.nix index b327efa..963611a 100644 --- a/configs/pepe/home-assistant/zigbee2mqtt/heater.nix +++ b/configs/pepe/home-assistant/zigbee2mqtt/heater.nix @@ -64,6 +64,14 @@ in { device_class = "temperature"; value_template = "{{ value_json.local_temperature }}"; } + { + platform = "mqtt"; + name = "pi_heating_demand_${name}"; + state_topic = "zigbee2mqtt/${name}"; + availability_topic = "zigbee2mqtt/bridge/state"; + unit_of_measurement = "%"; + value_template = "{{ value_json.pi_heating_demand }}"; + } ]) allDevices); };