Hi all - I did some google research today and found a website https://thecomputerperson.wordpress.com/2016/08/03/enphase-envoy-s-data-scraping that had lots of interesting and unpublished urls within our Envoys that display instantaneous values for power, reactive power, apparent power, voltage, current , power factor, lifetime power, last 7 days power and heaps of others for Consumption, Production and Net Consumption. It’s a nicely formatted json file which is updated with current values every time you call this url:
http://envoy.local/production.json
Here’s an example from my system:
{"production":[{"type":"inverters","activeCount":18,"readingTime":1629011546,"wNow":48,"whLifetime":15040561},{"type":"eim","activeCount":1,"measurementType":"production","readingTime":1629011749,"wNow":23.678,"whLifetime":15003847.261,"varhLeadLifetime":0.002,"varhLagLifetime":4480231.873,"vahLifetime":17614612.48,"rmsCurrent":1.289,"rmsVoltage":241.538,"reactPwr":305.709,"apprntPwr":311.372,"pwrFactor":0.07,"whToday":24605.261,"whLastSevenDays":154546.261,"vahToday":26747.48,"varhLeadToday":0.002,"varhLagToday":4836.873}],"consumption":[{"type":"eim","activeCount":1,"measurementType":"total-consumption","readingTime":1629011749,"wNow":667.827,"whLifetime":13996625.56,"varhLeadLifetime":9752177.355,"varhLagLifetime":4501845.22,"vahLifetime":24310859.886,"rmsCurrent":5.589,"rmsVoltage":241.653,"reactPwr":-961.189,"apprntPwr":1350.597,"pwrFactor":0.49,"whToday":14845.56,"whLastSevenDays":169982.56,"vahToday":25662.886,"varhLeadToday":11539.355,"varhLagToday":4837.22},{"type":"eim","activeCount":1,"measurementType":"net-consumption","readingTime":1629011749,"wNow":644.15,"whLifetime":9080345.931,"varhLeadLifetime":9752177.353,"varhLagLifetime":21613.347,"vahLifetime":24310859.886,"rmsCurrent":4.3,"rmsVoltage":241.768,"reactPwr":-655.479,"apprntPwr":1040.031,"pwrFactor":0.64,"whToday":0,"whLastSevenDays":0,"vahToday":0,"varhLeadToday":0,"varhLagToday":0}],"storage":[{"type":"acb","activeCount":0,"readingTime":0,"wNow":0,"whNow":0,"state":"idle"}]}
There is another url that displays similar information on a continuous streaming basis, however there are a at least 3 points to be aware of:
- You require the installer password for this - obtain this by running a simple python script from here GitHub - sarnau/EnphaseEnergy: Various collected information about Enphase Energy solar system
- The data is json formatted, except that the first curly bracket is missing from the “data” key, so you need to add that bracket and the quotation marks before the JSON can be parsed
- The data includes consumption/production details for power, current, power factor etc for three phases. If your system is single phase, the non-present phases read zero
http://installer:"installer password"@envoy.local/stream/meter
Here’s an example from my system which updates once per second:
data: {"production":{"ph-a":{"p":-2.24,"q":236.363,"s":239.815,"v":243.884,"i":0.984,"pf":0.0,"f":50.06},"ph-b":{"p":0.0,"q":0.0,"s":0.0,"v":0.0,"i":0.0,"pf":0.0,"f":0.0},"ph-c":{"p":0.0,"q":0.0,"s":0.0,"v":0.0,"i":0.0,"pf":0.0,"f":0.0}},"net-consumption":{"ph-a":{"p":785.708,"q":-648.654,"s":1144.564,"v":244.111,"i":4.69,"pf":0.68,"f":50.12},"ph-b":{"p":0.0,"q":0.0,"s":0.0,"v":0.0,"i":0.0,"pf":0.0,"f":0.0},"ph-c":{"p":0.0,"q":0.0,"s":0.0,"v":0.0,"i":0.0,"pf":0.0,"f":0.0}},"total-consumption":{"ph-a":{"p":783.468,"q":-885.017,"s":1384.502,"v":243.997,"i":5.674,"pf":0.57,"f":50.09},"ph-b":{"p":0.0,"q":0.0,"s":0.0,"v":0.0,"i":0.0,"pf":0.0,"f":0.0},"ph-c":{"p":0.0,"q":0.0,"s":0.0,"v":0.0,"i":0.0,"pf":0.0,"f":0.0}}}
data: {"production":{"ph-a":{"p":-2.127,"q":237.415,"s":240.205,"v":244.042,"i":0.985,"pf":0.0,"f":50.12},"ph-b":{"p":0.0,"q":0.0,"s":0.0,"v":0.0,"i":0.0,"pf":0.0,"f":0.0},"ph-c":{"p":0.0,"q":0.0,"s":0.0,"v":0.0,"i":0.0,"pf":0.0,"f":0.0}},"net-consumption":{"ph-a":{"p":787.869,"q":-649.53,"s":1147.731,"v":244.266,"i":4.707,"pf":0.68,"f":50.06},"ph-b":{"p":0.0,"q":0.0,"s":0.0,"v":0.0,"i":0.0,"pf":0.0,"f":0.0},"ph-c":{"p":0.0,"q":0.0,"s":0.0,"v":0.0,"i":0.0,"pf":0.0,"f":0.0}},"total-consumption":{"ph-a":{"p":785.742,"q":-886.946,"s":1389.779,"v":244.154,"i":5.692,"pf":0.57,"f":50.09},"ph-b":{"p":0.0,"q":0.0,"s":0.0,"v":0.0,"i":0.0,"pf":0.0,"f":0.0},"ph-c":{"p":0.0,"q":0.0,"s":0.0,"v":0.0,"i":0.0,"pf":0.0,"f":0.0}}}
data: {"production":{"ph-a":{"p":-1.949,"q":236.617,"s":240.536,"v":244.283,"i":0.985,"pf":0.0,"f":50.12},"ph-b":{"p":0.0,"q":0.0,"s":0.0,"v":0.0,"i":0.0,"pf":0.0,"f":0.0},"ph-c":{"p":0.0,"q":0.0,"s":0.0,"v":0.0,"i":0.0,"pf":0.0,"f":0.0}},"net-consumption":{"ph-a":{"p":781.671,"q":-649.608,"s":1144.144,"v":244.487,"i":4.674,"pf":0.68,"f":50.12},"ph-b":{"p":0.0,"q":0.0,"s":0.0,"v":0.0,"i":0.0,"pf":0.0,"f":0.0},"ph-c":{"p":0.0,"q":0.0,"s":0.0,"v":0.0,"i":0.0,"pf":0.0,"f":0.0}},"total-consumption":{"ph-a":{"p":779.722,"q":-886.225,"s":1382.896,"v":244.385,"i":5.659,"pf":0.56,"f":50.12},"ph-b":{"p":0.0,"q":0.0,"s":0.0,"v":0.0,"i":0.0,"pf":0.0,"f":0.0},"ph-c":{"p":0.0,"q":0.0,"s":0.0,"v":0.0,"i":0.0,"pf":0.0,"f":0.0}}}
Note:
It’s night here and you can see the phantom negative power values being generated.
Also note:
- s = Apparent power
- p = Real power (this is the one we are interested in)
- q = Reactive power
I’m not very well versed with Home Assistant - I’d like to create 3 x sensors from either of these urls to display real-time Consumption, Production and Exported power. Does anyone know how to create a sensor from json data?