Also eigentlich wäre es recht trivial das verfügbar zu machen. Eigentlich ist es aber auch recht unpraktisch, dass direkt in openWB einzubauen, weil es die Funktionalität anderer Stelle schon x mal implementiert gibt. In der openWB ist es auch kompliziert zu Pflegen, weil es keine Plugins gibt, alles muss durch das Bergwerk durch. Für die ganze Smart-Home-Geschichte eigentlich total unpraktisch.
Eigentlich muss man nur zum Einschalten "AAAAK9DygfiL/5r31e+UtsWg1Iv5nPCR6LfEsNGlwOLYo4HyhueT9tTu36Lfot8=" (BASE64) per TCP an den Port 9999 von dem Gerät schicken. Zum Ausschalten "AAAAK9DygfiL/5r31e+UtsWg1Iv5nPCR6LfEsNGlwOLYo4HyhueT9tTu3qPeo94=". Ich habe das mal mit NodeRED ausprobiert:
Code: Alles auswählen
[{"id":"ecd3fefd.609d98","type":"inject","z":"6205088.b1c0ef8","name":"ON","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"AAAAK9DygfiL/5r31e+UtsWg1Iv5nPCR6LfEsNGlwOLYo4HyhueT9tTu36Lfot8=","payloadType":"str","x":160,"y":400,"wires":[["a583b7ac.9cb958"]]},{"id":"a583b7ac.9cb958","type":"tcp out","z":"6205088.b1c0ef8","host":"YOUR_HOST","port":"9999","beserver":"client","base64":true,"end":true,"name":"","x":410,"y":400,"wires":[]},{"id":"ad26cd04.1ca64","type":"inject","z":"6205088.b1c0ef8","name":"OFF","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"AAAAK9DygfiL/5r31e+UtsWg1Iv5nPCR6LfEsNGlwOLYo4HyhueT9tTu3qPeo94=","payloadType":"str","x":150,"y":460,"wires":[["a583b7ac.9cb958"]]}]
Geht...
Eigentlich macht das mit NodeRED richtig Laune. Es gibt natürlich auch für NodeRED fertige Plugins um die Steckdosen anzusteuern. Um das ganze mit der openWB zu verheiraten geht es mit diesem Flow:
Code: Alles auswählen
[{"id":"bb4a131e.edd938","type":"kasa","z":"6205088.b1c0ef8","name":"","device":"YOUR_HOST","interval":"0","eventInterval":"0","payload":"getInfo","payloadType":"info","debug":false,"x":610,"y":300,"wires":[["c40c17f0.bb8708"]]},{"id":"45d9f9b8.b347c","type":"http in","z":"6205088.b1c0ef8","name":"","url":"/plug/power","method":"get","upload":false,"swaggerDoc":"","x":140,"y":360,"wires":[["995a6ff.a9ba71"]]},{"id":"995a6ff.a9ba71","type":"change","z":"6205088.b1c0ef8","name":"payload=getMeterInfo","rules":[{"t":"set","p":"payload","pt":"msg","to":"getMeterInfo","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":360,"wires":[["bb4a131e.edd938","8f845e5a.fcf62"]]},{"id":"7178e7dc.822088","type":"http response","z":"6205088.b1c0ef8","name":"","statusCode":"","headers":{},"x":770,"y":400,"wires":[]},{"id":"c40c17f0.bb8708","type":"change","z":"6205088.b1c0ef8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$round(payload.power)\t","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":670,"y":360,"wires":[["8f845e5a.fcf62"]]},{"id":"e63507c8.c8b258","type":"kasa","z":"6205088.b1c0ef8","name":"","device":"YOUR_HOST","interval":"0","eventInterval":"0","payload":"getInfo","payloadType":"info","debug":false,"x":530,"y":480,"wires":[[]]},{"id":"5e38151e.74e184","type":"http in","z":"6205088.b1c0ef8","name":"","url":"/plug/on","method":"get","upload":false,"swaggerDoc":"","x":130,"y":420,"wires":[["547155be.fff284","c48540f0.2181e8"]]},{"id":"547155be.fff284","type":"change","z":"6205088.b1c0ef8","name":"payload=true","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":420,"wires":[["e63507c8.c8b258"]]},{"id":"c48540f0.2181e8","type":"http response","z":"6205088.b1c0ef8","name":"","statusCode":"","headers":{},"x":330,"y":480,"wires":[]},{"id":"a681e120.825a5","type":"http in","z":"6205088.b1c0ef8","name":"","url":"/plug/off","method":"get","upload":false,"swaggerDoc":"","x":130,"y":540,"wires":[["a2554af.13257b8","c48540f0.2181e8"]]},{"id":"a2554af.13257b8","type":"change","z":"6205088.b1c0ef8","name":"payload=false","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":540,"wires":[["e63507c8.c8b258"]]},{"id":"8f845e5a.fcf62","type":"function","z":"6205088.b1c0ef8","name":"join","func":"if (msg.topic) {\n context.get('httpMessages').forEach(http => {\n http.payload = msg.payload;\n node.send(http);\n });\n context.set('httpMessages', []);\n} else {\n context.get('httpMessages').push(msg);\n}","outputs":1,"noerr":0,"initialize":"// Code added here will be run once\n// whenever the node is started.\ncontext.set('httpMessages', []);","finalize":"","libs":[],"x":630,"y":400,"wires":[["7178e7dc.822088"]]}]
Wenn man den drin hat, dann kann man einfach in der openWB den Plug als "Http" konfigurieren mit:
Gut, es tut irgendwelche Dinge. Ob es das richtige tut bin ich mir noch nicht so sicher. Da blicke ich bei dem Smart-Home-Modul der openWB noch nicht ganz durch.