From da7161c0ddfaeb3b81b8878e605d020eeb48528d Mon Sep 17 00:00:00 2001 From: Ranlvor Date: Mon, 20 May 2019 20:56:05 +0200 Subject: [PATCH] Add office fan --- config/home/index.js | 48 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/config/home/index.js b/config/home/index.js index e5a9a97..002bd81 100644 --- a/config/home/index.js +++ b/config/home/index.js @@ -183,6 +183,31 @@ const config: Config = { }, defaultValue: "OFF" }, + fanOfficeState: { + state: { + name: "stat/sonoff-office-fan/POWER", + type: types.option({ + OFF: "off", + ON: "on" + }) + }, + command: { + name: "cmnd/sonoff-office-fan/POWER", + type: types.string + }, + defaultValue: "OFF" + }, + fanOfficeAuto: { + state: { + name: "home-rust/temperature-control/office", + type: types.option({ true: "on", false: "off" }) + }, + command: { + name: "home-rust/temperature-control/office/set", + type: types.option({ on: "true", off: "false" }) + }, + defaultValue: "OFF" + }, hallwayBrightness: { state: { name: "home-rust/bulb/hallway/brightness", @@ -267,9 +292,30 @@ const config: Config = { } ] }, + officeFan: { + name: "Lüftung Büro", + position: [600, 400], + icon: mdi("fan"), + iconColor: ({fanOfficeState}) => + (fanOfficeState === "on" ? hex("#00FF00") : hex("#000000")), + ui: [ + { + type: "toggle", + topic: "fanOfficeState", + text: "Ein/Ausschalten", + icon: mdi("power") + }, + { + type: "toggle", + topic: "fanOfficeAuto", + text: "Automatik", + icon: mdi("air-conditioner") + } + ] + }, hallwayLight: { name: "Flur", - position: [500, 200], + position: [400, 200], icon: mdi("ceiling-light"), ui: [ {