Wenn Du schon ein nodered laufen hast, machst du eben alles darüber ohne groß darüber nachzudenken, wie es denn ohne gehen würde. In der 2er-Software stehen nur noch die Logs in der Ramdisk. Alle anderen Werte und die openWB-Konfiguration sind im MQTT-Broker. Einen Flow, der ein MQTT-Topic an einen http-Endpoint rausreicht, ist nicht kompliziert:
Der obere Flow abonniert ein MQTT-Topic und schreibt den sich immer ändernden Wert in einen flow-globalen Speicher. Der untere stellt einen http-Endpoint bereit, der den flow-globalen Speicher auf Anfrage ausgibt.
Code: Alles auswählen
[{"id":"fb07ae17.cf9858","type":"mqtt in","z":"aa9fb964.b9ee58","name":"","topic":"openWB/counter/0/get/power","qos":"2","datatype":"auto","broker":"c4cb83c8.1bd0c","x":180,"y":1140,"wires":[["e6c04cc1.93acd"]]},{"id":"8a0b6081.65557","type":"http response","z":"aa9fb964.b9ee58","name":"","statusCode":"","headers":{},"x":650,"y":1240,"wires":[]},{"id":"4982dbf0.6cecf4","type":"http in","z":"aa9fb964.b9ee58","name":"","url":"/housepower","method":"get","upload":false,"swaggerDoc":"","x":180,"y":1240,"wires":[["c82be42d.acd7f"]]},{"id":"e6c04cc1.93acd","type":"change","z":"aa9fb964.b9ee58","name":"","rules":[{"t":"set","p":"housepower","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":1140,"wires":[[]]},{"id":"c82be42d.acd7f","type":"change","z":"aa9fb964.b9ee58","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"housepower","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":1240,"wires":[["8a0b6081.65557"]]},{"id":"c4cb83c8.1bd0c","type":"mqtt-broker","name":"OpenWB","broker":"wallbox.fritz.box","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"30","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","willTopic":"","willQos":"0","willRetain":"false","willPayload":""}]