From a6aef2ee9a3b04ba0884b9375aae4aac8abdea40 Mon Sep 17 00:00:00 2001 From: Ranlvor Date: Sat, 19 Dec 2020 16:19:42 +0100 Subject: [PATCH] uwap-home, heater diningroom: show boost/window open state --- config/uwap-home/index.js | 40 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/config/uwap-home/index.js b/config/uwap-home/index.js index 2bc18c0..c23927b 100644 --- a/config/uwap-home/index.js +++ b/config/uwap-home/index.js @@ -248,6 +248,34 @@ const config: Config = { }, defaultValue: "126.5" }, + heaterdiningroomWindowEnd: { + state: { + name: "tele/home-rust/fritzbox/device/diningroom", + type: (msg) => { + const json = JSON.parse(msg.toString()); + if (!json || !json["windowopenactiveendtime"]) { + return "inactive"; + } else { + return new Date(json["windowopenactiveendtime"] * 1000).toLocaleTimeString(); + } + } + }, + defaultValue: "unavailable" + }, + heaterdiningroomBoostEnd: { + state: { + name: "tele/home-rust/fritzbox/device/diningroom", + type: (msg) => { + const json = JSON.parse(msg.toString()); + if (!json || !json["boostactiveendtime"]) { + return "inactive"; + } else { + return new Date(json["windowopenactiveendtime"] * 1000).toLocaleTimeString(); + } + } + }, + defaultValue: "unavailable" + }, heaterBedroomTsoll: { state: { name: "tele/home-rust/fritzbox/device/bedroom/tsoll", @@ -747,6 +775,18 @@ const config: Config = { { value: 18, label: "18°C" }, { value: 28, label: "28°C" } ] + }, + { + type: "text", + text: "Window open mode till", + icon: svg(icons.mdiSortClockAscending), + topic: "heaterdiningroomWindowEnd" + }, + { + type: "text", + text: "Boost mode till", + icon: svg(icons.mdiSortClockDescending), + topic: "heaterdiningroomBoostEnd" } ] },