Code: Alles auswählen
[{"id":"2320459f59b642cf","type":"tab","label":"Hoymiles to OpenWB","disabled":false,"info":"","env":[]},{"id":"5fc858e8.750c58","type":"debug","z":"2320459f59b642cf","name":"Debug W","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1100,"y":140,"wires":[]},{"id":"a94d47cc78fa8456","type":"comment","z":"2320459f59b642cf","name":"Power W","info":"","x":80,"y":20,"wires":[]},{"id":"da9974ede763e9e1","type":"comment","z":"2320459f59b642cf","name":"Wh Counter","info":"","x":90,"y":340,"wires":[]},{"id":"74c9c59ac92952d5","type":"mqtt out","z":"2320459f59b642cf","name":"","topic":"openWB/set/pv/2/W","qos":"2","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"0c113ab30c2c903e","x":1140,"y":220,"wires":[]},{"id":"f756d863c3265918","type":"mqtt out","z":"2320459f59b642cf","name":"","topic":"openWB/set/pv/2/WhCounter","qos":"2","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"0c113ab30c2c903e","x":1420,"y":520,"wires":[]},{"id":"0c508bcf4a4e1f87","type":"debug","z":"2320459f59b642cf","name":"Debug Wh","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1370,"y":440,"wires":[]},{"id":"73e75fbd64a85302","type":"poll-state","z":"2320459f59b642cf","name":"Holzpalast Süd","server":"7029792c.ebefd8","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"60","updateIntervalType":"num","updateIntervalUnits":"seconds","outputinitially":true,"outputonchanged":true,"entity_id":"sensor.holzpalast_power","state_type":"num","halt_if":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"x":120,"y":80,"wires":[["e8701232f6866482"]]},{"id":"987bcf3e274b488b","type":"poll-state","z":"2320459f59b642cf","name":"Holzpalast Ost Links","server":"7029792c.ebefd8","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"60","updateIntervalType":"num","updateIntervalUnits":"seconds","outputinitially":true,"outputonchanged":true,"entity_id":"sensor.holzpalast_ost_power","state_type":"num","halt_if":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"x":130,"y":140,"wires":[["54f17bfaba4c7ee9"]]},{"id":"d1370ade22ee5e57","type":"poll-state","z":"2320459f59b642cf","name":"Mülltonnen","server":"7029792c.ebefd8","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"60","updateIntervalType":"num","updateIntervalUnits":"seconds","outputinitially":true,"outputonchanged":true,"entity_id":"sensor.mulltonnen_power","state_type":"num","halt_if":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"x":100,"y":200,"wires":[["9df7196f6a030740"]]},{"id":"efbdf2800c77f228","type":"poll-state","z":"2320459f59b642cf","name":"Holzpalast Süd kWh","server":"7029792c.ebefd8","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"60","updateIntervalType":"num","updateIntervalUnits":"seconds","outputinitially":true,"outputonchanged":true,"entity_id":"sensor.holzpalast_yieldtotal","state_type":"num","halt_if":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"x":130,"y":400,"wires":[["e1ab3ef2aa1ddd4d"]]},{"id":"40128ed1429017d0","type":"poll-state","z":"2320459f59b642cf","name":"Holzpalast Ost Links kWh","server":"7029792c.ebefd8","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"60","updateIntervalType":"num","updateIntervalUnits":"seconds","outputinitially":true,"outputonchanged":true,"entity_id":"sensor.holzpalast_ost_yieldtotal","state_type":"num","halt_if":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"x":150,"y":460,"wires":[["2605eeda94afa297"]]},{"id":"c9a4f1a2b7b99d7e","type":"poll-state","z":"2320459f59b642cf","name":"Mülltonnen kWh","server":"7029792c.ebefd8","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"60","updateIntervalType":"num","updateIntervalUnits":"seconds","outputinitially":true,"outputonchanged":true,"entity_id":"sensor.mulltonnen_yieldtotal","state_type":"num","halt_if":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"x":120,"y":520,"wires":[["387e3c84db8dfe2d"]]},{"id":"e1ab3ef2aa1ddd4d","type":"change","z":"2320459f59b642cf","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":400,"wires":[["ec27a42712c5bfe4"]]},{"id":"2605eeda94afa297","type":"change","z":"2320459f59b642cf","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":460,"wires":[["ec27a42712c5bfe4"]]},{"id":"387e3c84db8dfe2d","type":"change","z":"2320459f59b642cf","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"3","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":520,"wires":[["ec27a42712c5bfe4"]]},{"id":"e8701232f6866482","type":"change","z":"2320459f59b642cf","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":80,"wires":[["d0a213bb96ac06e2"]]},{"id":"54f17bfaba4c7ee9","type":"change","z":"2320459f59b642cf","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":140,"wires":[["d0a213bb96ac06e2"]]},{"id":"9df7196f6a030740","type":"change","z":"2320459f59b642cf","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"3","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":200,"wires":[["d0a213bb96ac06e2"]]},{"id":"ec27a42712c5bfe4","type":"combine-statistic","z":"2320459f59b642cf","name":"","topic":"","operator":"sum","falsy":"include","defer":250,"timeout":0,"distinction":"topic","x":640,"y":480,"wires":[["833a28e7e28556b0"]]},{"id":"d0a213bb96ac06e2","type":"combine-statistic","z":"2320459f59b642cf","name":"","topic":"","operator":"sum","falsy":"include","defer":250,"timeout":0,"distinction":"topic","x":600,"y":180,"wires":[["9ac976a16245cfdb"]]},{"id":"ce0aca2c1ae7e798","type":"rbe","z":"2320459f59b642cf","name":"entprellen","func":"deadband","gap":"","start":"","inout":"in","septopics":false,"property":"payload","topi":"topic","x":1180,"y":480,"wires":[["0c508bcf4a4e1f87","f756d863c3265918"]]},{"id":"49c19f8ee087e822","type":"rbe","z":"2320459f59b642cf","name":"entprellen","func":"rbe","gap":"","start":"","inout":"out","septopics":false,"property":"payload","topi":"topic","x":920,"y":180,"wires":[["74c9c59ac92952d5","5fc858e8.750c58"]]},{"id":"c4cc70536e68ba0a","type":"calculator","z":"2320459f59b642cf","name":"kwh in wh","inputMsgField":"payload","outputMsgField":"payload","operation":"mult","constant":"1000","round":true,"decimals":"2","x":1020,"y":480,"wires":[["ce0aca2c1ae7e798"]]},{"id":"9ac976a16245cfdb","type":"function","z":"2320459f59b642cf","name":"Runden","func":"msg.payload = Number(msg.payload.toFixed(2));\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":760,"y":180,"wires":[["49c19f8ee087e822"]]},{"id":"833a28e7e28556b0","type":"calculator","z":"2320459f59b642cf","name":"Wirkungsgrad 95,5%","inputMsgField":"payload","outputMsgField":"payload","operation":"mult","constant":"0.955","round":false,"decimals":"0","x":820,"y":480,"wires":[["c4cc70536e68ba0a"]]},{"id":"0c113ab30c2c903e","type":"mqtt-broker","name":"OpenWB","broker":"openwb.steingaesser.net","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""},{"id":"7029792c.ebefd8","type":"server","name":"Home Assistant","version":4,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":true,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m"}]
ich bräuchte mal etwas Hilfe um an die OpenWB über WR2 MQTT die Daten korrekt zu senden.
Ich habe mehrere Microwechselrichter von Hoymiles. Diese lese ich über OpenDTU aus. https://github.com/tbnobody/OpenDTU
Deren Daten landen über MQTT bei mir im HomeAssistant. Die Ertragsdaten bekomme ich für jeden Microwechselrichter einzeln. Um nun der OpenWB die Daten korrekt zu liefern muss ich diese also erstmal Summieren. Das wollte ich nun mit NodeRed als HASS AddOn machen. Das klappt aber nicht ganz zufriedenstellend.
Hier ist das was ich grade im NodeRed mache.
Code: Alles auswählen
[{"id":"2320459f59b642cf","type":"tab","label":"Hoymiles to OpenWB","disabled":false,"info":"","env":[]},{"id":"2ffed9e9209a0d26","type":"poll-state","z":"2320459f59b642cf","name":"Holzpalast Süd","server":"7029792c.ebefd8","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"60","updateIntervalType":"num","updateIntervalUnits":"seconds","outputinitially":true,"outputonchanged":true,"entity_id":"sensor.holzpalast_power","state_type":"num","halt_if":"0","halt_if_type":"num","halt_if_compare":"gte","outputs":2,"x":100,"y":80,"wires":[["31c9f087.3438f"],[]]},{"id":"233d97a63db15276","type":"poll-state","z":"2320459f59b642cf","name":"Holzpalast Ost Links","server":"7029792c.ebefd8","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"60","updateIntervalType":"num","updateIntervalUnits":"seconds","outputinitially":true,"outputonchanged":true,"entity_id":"sensor.holzpalast_ost_power","state_type":"num","halt_if":"0","halt_if_type":"num","halt_if_compare":"gte","outputs":2,"x":110,"y":140,"wires":[["7b8e0037.f117a"],[]]},{"id":"efa413cb6787d4d2","type":"poll-state","z":"2320459f59b642cf","name":"Mülltonnen","server":"7029792c.ebefd8","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"60","updateIntervalType":"num","updateIntervalUnits":"seconds","outputinitially":true,"outputonchanged":true,"entity_id":"sensor.mulltonnen_power","state_type":"num","halt_if":"0","halt_if_type":"num","halt_if_compare":"gte","outputs":2,"x":80,"y":200,"wires":[["36c0a2a6770ef8ec"],[]]},{"id":"ce878c18.15589","type":"join","z":"2320459f59b642cf","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":530,"y":140,"wires":[["bac9a9fd.bbd678"]]},{"id":"31c9f087.3438f","type":"change","z":"2320459f59b642cf","name":"","rules":[{"t":"set","p":"parts","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":80,"wires":[["ce878c18.15589"]]},{"id":"7b8e0037.f117a","type":"change","z":"2320459f59b642cf","name":"","rules":[{"t":"set","p":"parts","pt":"msg","to":"2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":140,"wires":[["ce878c18.15589"]]},{"id":"bac9a9fd.bbd678","type":"change","z":"2320459f59b642cf","name":"$sum(payload)","rules":[{"t":"set","p":"payload","pt":"msg","to":"$sum(payload)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":140,"wires":[["5fc858e8.750c58","74c9c59ac92952d5"]]},{"id":"5fc858e8.750c58","type":"debug","z":"2320459f59b642cf","name":"Debug W","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":940,"y":100,"wires":[]},{"id":"36c0a2a6770ef8ec","type":"change","z":"2320459f59b642cf","name":"","rules":[{"t":"set","p":"parts","pt":"msg","to":"3","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":200,"wires":[["ce878c18.15589"]]},{"id":"28127b26f95e071e","type":"poll-state","z":"2320459f59b642cf","name":"Holzpalast Süd Wh","server":"7029792c.ebefd8","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"60","updateIntervalType":"num","updateIntervalUnits":"seconds","outputinitially":true,"outputonchanged":true,"entity_id":"sensor.holzpalast_yieldday","state_type":"num","halt_if":"1","halt_if_type":"num","halt_if_compare":"gte","outputs":2,"x":110,"y":360,"wires":[["7beb00db0650a66c"],[]]},{"id":"7cff721b40b14fd2","type":"poll-state","z":"2320459f59b642cf","name":"Holzpalast Ost Links Wh","server":"7029792c.ebefd8","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"60","updateIntervalType":"num","updateIntervalUnits":"seconds","outputinitially":true,"outputonchanged":true,"entity_id":"sensor.holzpalast_ost_yieldday","state_type":"num","halt_if":"1","halt_if_type":"num","halt_if_compare":"gte","outputs":2,"x":130,"y":420,"wires":[["ca070c193b16bd7a"],[]]},{"id":"985938c4bb01be1a","type":"poll-state","z":"2320459f59b642cf","name":"Mülltonnen Wh","server":"7029792c.ebefd8","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"60","updateIntervalType":"num","updateIntervalUnits":"seconds","outputinitially":true,"outputonchanged":true,"entity_id":"sensor.mulltonnen_yieldday","state_type":"num","halt_if":"1","halt_if_type":"num","halt_if_compare":"gte","outputs":2,"x":100,"y":480,"wires":[["efcd25794231b672"],[]]},{"id":"8082767545c3b186","type":"join","z":"2320459f59b642cf","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":590,"y":420,"wires":[["efd6d59c8e00201f"]]},{"id":"7beb00db0650a66c","type":"change","z":"2320459f59b642cf","name":"","rules":[{"t":"set","p":"parts","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":360,"wires":[["8082767545c3b186"]]},{"id":"ca070c193b16bd7a","type":"change","z":"2320459f59b642cf","name":"","rules":[{"t":"set","p":"parts","pt":"msg","to":"2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":420,"wires":[["8082767545c3b186"]]},{"id":"efd6d59c8e00201f","type":"change","z":"2320459f59b642cf","name":"$sum(payload)","rules":[{"t":"set","p":"payload","pt":"msg","to":"$sum(payload)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":420,"wires":[["1fa5678e1e90a584","0c508bcf4a4e1f87"]]},{"id":"184d24fd615072f1","type":"debug","z":"2320459f59b642cf","name":"Debug Wh Float","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1300,"y":380,"wires":[]},{"id":"efcd25794231b672","type":"change","z":"2320459f59b642cf","name":"","rules":[{"t":"set","p":"parts","pt":"msg","to":"3","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":480,"wires":[["8082767545c3b186"]]},{"id":"a94d47cc78fa8456","type":"comment","z":"2320459f59b642cf","name":"Power W","info":"","x":80,"y":20,"wires":[]},{"id":"da9974ede763e9e1","type":"comment","z":"2320459f59b642cf","name":"Daily Wh","info":"","x":80,"y":300,"wires":[]},{"id":"74c9c59ac92952d5","type":"mqtt out","z":"2320459f59b642cf","name":"","topic":"openWB/set/pv/2/W","qos":"2","retain":"true","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"0c113ab30c2c903e","x":980,"y":160,"wires":[]},{"id":"f756d863c3265918","type":"mqtt out","z":"2320459f59b642cf","name":"","topic":"openWB/set/pv/2/WhCounter","qos":"2","retain":"true","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"0c113ab30c2c903e","x":1340,"y":440,"wires":[]},{"id":"1fa5678e1e90a584","type":"toFloat","z":"2320459f59b642cf","name":"","toFixed":"","x":1050,"y":400,"wires":[["184d24fd615072f1"]]},{"id":"0c508bcf4a4e1f87","type":"debug","z":"2320459f59b642cf","name":"Debug Wh","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1010,"y":340,"wires":[]},{"id":"7029792c.ebefd8","type":"server","name":"Home Assistant","version":4,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":true,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m"},{"id":"0c113ab30c2c903e","type":"mqtt-broker","name":"OpenWB","broker":"openwb.steingaesser.net","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""}]
Probleme bereitet mir der Gesamtertrag. Summiere ich das Ganze genau so wie den Ertrag bekomme ich völlig abweichende Werte in der OpenWB als das was ich sende. Zudem rutscht plötzlich der Gesamtertrag der OpenWB ins Minus. Und das obwohl da noch 3 SMA als WR1 konfiguriert sind und die liefern deutlich mehr als die Hoymiles. Ich bin nun 26kwh im Minus obwohl ich nur ein paar Wh über MQTT übermittelt habe.
Man soll es ja Float schicken. Daher habe ich nun ein FloatModul von nodeRed genommen. Aber da kommen nur irgendwelche ganz eigenartige Werte raus ohne Sinn. Ich bin mir nun also absoult unsicher wie ich der OpenWB die Gesamtertragsdaten für WR2 senden soll damit auch plausibel gezählt werden kann.
Eventuell hat hier schon mal jemand etwas ähnliches gemacht und kann helfen?
Grüße
Dirk