20-09-2024, 10:05 AM
De mon coté, j'ai un flux Node-RED qui reformate le json reçu de mon Enphase (mais c'est pareil que pout ton Lixee) pour être lu par le routeur RMS.
Je reçois un json brut :
Que je transforme en :
Avec un bloc function :
Je reçois un json brut :
Code :
{"production":{"ph-a":{"p":248.274,"q":-86.307,"s":286.456,"v":239.133,"i":1.2,"pf":0.88,"f":50},"ph-b":{"p":0,"q":0,"s":0,"v":0,"i":0,"pf":0,"f":0},"ph-c":{"p":0,"q":0,"s":0,"v":0,"i":0,"pf":0,"f":0}},"net-consumption":{"ph-a":{"p":77.972,"q":-233.674,"s":314.19,"v":239.133,"i":1.314,"pf":0.25,"f":50},"ph-b":{"p":0,"q":0,"s":0,"v":0,"i":0,"pf":0,"f":0},"ph-c":{"p":0,"q":0,"s":0,"v":0,"i":0,"pf":0,"f":0}},"total-consumption":{"ph-a":{"p":326.246,"q":-319.981,"s":601.049,"v":239.133,"i":2.513,"pf":0.54,"f":50},"ph-b":{"p":0,"q":0,"s":0,"v":0,"i":0,"pf":0,"f":0},"ph-c":{"p":0,"q":0,"s":0,"v":0,"i":0,"pf":0,"f":0}}}
Que je transforme en :
Code :
{"Pw":77.972,"Pf":0.25,"Pva":314.19}
Avec un bloc function :
Code :
msg.payload = '{"Pw":' +
msg.payload["net-consumption"]["ph-a"].p +
',"Pf":' +
msg.payload["net-consumption"]["ph-a"].pf +
',"Pva":' +
msg.payload["net-consumption"]["ph-a"].s +
'}';
msg.topic = "Envoy/RMS"
return msg;
Enphase -> Node-RED -> Source MQTT
3x IQ7+/3x 375WhC + 4x IQ8MC/4x 400WhC
1x Routeur 12.06_Custom -> CES 2,5kW
Domotique gérée sous Jeedom 4.4.19 (DIY VMM Synology)
3x IQ7+/3x 375WhC + 4x IQ8MC/4x 400WhC
1x Routeur 12.06_Custom -> CES 2,5kW
Domotique gérée sous Jeedom 4.4.19 (DIY VMM Synology)