diff --git a/README.md b/README.md index 3b492ab..f51e033 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ Aktuell werden folgende Geräte unterstützt: * tempsensor * gatebox * tvlift +* multisensor - nicht mit realer Hardware getestet, es werden bis zu 4 Sensoren unterstützt ## Changelog diff --git a/admin/jsonConfig.json b/admin/jsonConfig.json index 4480b36..cf99aee 100644 --- a/admin/jsonConfig.json +++ b/admin/jsonConfig.json @@ -88,6 +88,10 @@ "label": "tempsensor", "value": "tempsensor" }, + { + "label": "multisensor", + "value": "multisensor" + }, { "label": "tvlift", "value": "tvlift" diff --git a/lib/tools.js b/lib/tools.js index eaaab8f..ae0398d 100644 --- a/lib/tools.js +++ b/lib/tools.js @@ -70,6 +70,9 @@ async function initIobStates (name, datapoints) { iob.setObject(path, { type: iobObject.type, common: iobObject.common, + role: iobObject.role, + read: iobObject.read, + write: iobObject.write, native: {} }); } @@ -100,7 +103,7 @@ async function setIobStates (device, values) { } } } else { - if (iob.extLog) iob.log.info("setIobStates search: " + search + " not found"); + if (iob.extLog) iob.log.warn("setIobStates search: " + search + " not found"); } } } diff --git a/main.js b/main.js index f4a366b..e74168b 100644 --- a/main.js +++ b/main.js @@ -9,6 +9,7 @@ const gatebox = require("./lib/gatebox"); const shutterbox = require("./lib/shutterbox"); const switchbox = require("./lib/switchbox"); const tempsensor = require("./lib/tempsensor"); +const multisensor = require("./lib/multisensor"); const saunabox = require("./lib/saunabox"); const tvlift = require("./lib/tvlift"); @@ -100,6 +101,15 @@ class Blebox extends utils.Adapter { tools.getBleboxData(device, "deviceUptime"); }); break; + case "multisensor": + multisensor.init(); + tools.getBleboxData(device, "deviceState"); + tools.getBleboxData(device, "multisensorExtendedState"); + schedule.scheduleJob("*/10 * * * * *", function () { + tools.getBleboxData(device, "multisensorExtendedState"); + tools.getBleboxData(device, "deviceUptime"); + }); + break; case "saunabox": saunabox.init(); tools.getBleboxData(device, "deviceState"); @@ -425,6 +435,9 @@ class Blebox extends utils.Adapter { case "tempsensor": locationUrl = tempsensor.getApiUrl(type, val); break; + case "multisensor": + locationUrl = multisensor.getApiUrl(type, val); + break; default: break; @@ -452,6 +465,8 @@ class Blebox extends utils.Adapter { return switchbox.datapoints; case "tempsensor": return tempsensor.datapoints; + case "multisensor": + return multisensor.datapoints; case "saunabox": return saunabox.datapoints; default: