G'day Node-REDers
I have an Enphase PV (Solar) system and it has some URLs that I can use to get system statistics from. Some of those URLs don't require authentication, some accept basic authentication and another one has me completely baffled.
The URL is question is http://<ip.address>/stream/meter
If I go to the URL in a browser it has a pop-up box asking me for a username/password and then proceeds to publish data into my browser every 1 second. It looks something like this:
data: {"production":{"ph-a":{"p":232.537,"q":187.693,"s":327.427,"v":242.298,"i":1.349,"pf":0.65,"f":50.0},"ph-b":{"p":249.617,"q":201.235,"s":337.434,"v":242.235,"i":1.39,"pf":0.74,"f":50.0},"ph-c":{"p":224.22,"q":184.517,"s":331.288,"v":241.9,"i":1.368,"pf":0.66,"f":50.0}},"net-consumption":{"ph-a":{"p":74.585,"q":-462.933,"s":506.441,"v":242.552,"i":2.089,"pf":0.14,"f":50.0},"ph-b":{"p":-151.449,"q":-371.813,"s":423.539,"v":242.308,"i":1.745,"pf":-0.36,"f":50.0},"ph-c":{"p":-52.098,"q":-262.391,"s":345.107,"v":241.836,"i":1.425,"pf":-0.14,"f":50.0}},"total-consumption":{"ph-a":{"p":307.122,"q":-650.625,"s":833.514,"v":242.425,"i":3.438,"pf":0.37,"f":50.0},"ph-b":{"p":98.168,"q":-573.048,"s":-86.134,"v":242.271,"i":-0.356,"pf":1.0,"f":50.0},"ph-c":{"p":172.121,"q":-446.908,"s":-13.926,"v":241.868,"i":-0.058,"pf":1.0,"f":50.0}}}
data: {"production":{"ph-a":{"p":231.285,"q":187.331,"s":328.961,"v":242.288,"i":1.367,"pf":0.7,"f":50.0},"ph-b":{"p":249.293,"q":201.003,"s":335.831,"v":242.219,"i":1.384,"pf":0.74,"f":50.0},"ph-c":{"p":223.598,"q":183.81,"s":330.599,"v":241.96,"i":1.364,"pf":0.67,"f":50.0}},"net-consumption":{"ph-a":{"p":71.76,"q":-462.373,"s":507.293,"v":242.527,"i":2.096,"pf":0.12,"f":50.0},"ph-b":{"p":-151.677,"q":-370.624,"s":422.958,"v":242.313,"i":1.746,"pf":-0.35,"f":50.0},"ph-c":{"p":-51.148,"q":-261.246,"s":344.877,"v":241.888,"i":1.427,"pf":-0.13,"f":50.0}},"total-consumption":{"ph-a":{"p":303.045,"q":-649.704,"s":839.369,"v":242.408,"i":3.463,"pf":0.36,"f":50.0},"ph-b":{"p":97.616,"q":-571.627,"s":-87.635,"v":242.266,"i":-0.362,"pf":1.0,"f":50.0},"ph-c":{"p":172.45,"q":-445.056,"s":-15.059,"v":241.924,"i":-0.062,"pf":1.0,"f":50.0}}}
data: {"production":{"ph-a":{"p":230.31,"q":187.58,"s":330.835,"v":242.255,"i":1.366,"pf":0.7,"f":50.0},"ph-b":{"p":249.121,"q":202.04,"s":335.431,"v":242.176,"i":1.385,"pf":0.75,"f":50.0},"ph-c":{"p":221.888,"q":183.173,"s":329.174,"v":242.008,"i":1.357,"pf":0.67,"f":50.0}},"net-consumption":{"ph-a":{"p":70.529,"q":-461.948,"s":506.92,"v":242.476,"i":2.088,"pf":0.12,"f":50.0},"ph-b":{"p":-149.897,"q":-370.863,"s":422.172,"v":242.288,"i":1.74,"pf":-0.36,"f":50.0},"ph-c":{"p":-52.899,"q":-261.437,"s":344.755,"v":241.929,"i":1.423,"pf":-0.17,"f":50.0}},"total-consumption":{"ph-a":{"p":300.839,"q":-649.528,"s":837.124,"v":242.366,"i":3.454,"pf":0.36,"f":50.0},"ph-b":{"p":99.223,"q":-572.902,"s":-85.998,"v":242.232,"i":-0.355,"pf":1.0,"f":50.0},"ph-c":{"p":168.988,"q":-444.609,"s":-15.902,"v":241.969,"i":-0.066,"pf":1.0,"f":50.0}}}
data: {"production":{"ph-a":{"p":230.31,"q":187.58,"s":330.835,"v":242.255,"i":1.366,"pf":0.7,"f":50.0},"ph-b":{"p":249.121,"q":202.04,"s":335.431,"v":242.176,"i":1.385,"pf":0.75,"f":50.0},"ph-c":{"p":221.888,"q":183.173,"s":329.174,"v":242.008,"i":1.357,"pf":0.67,"f":50.0}},"net-consumption":{"ph-a":{"p":70.529,"q":-461.948,"s":506.92,"v":242.476,"i":2.088,"pf":0.12,"f":50.0},"ph-b":{"p":-149.897,"q":-370.863,"s":422.172,"v":242.288,"i":1.74,"pf":-0.36,"f":50.0},"ph-c":{"p":-52.899,"q":-261.437,"s":344.755,"v":241.929,"i":1.423,"pf":-0.17,"f":50.0}},"total-consumption":{"ph-a":{"p":300.839,"q":-649.528,"s":837.124,"v":242.366,"i":3.454,"pf":0.36,"f":50.0},"ph-b":{"p":99.223,"q":-572.902,"s":-85.998,"v":242.232,"i":-0.355,"pf":1.0,"f":50.0},"ph-c":{"p":168.988,"q":-444.609,"s":-15.902,"v":241.969,"i":-0.066,"pf":1.0,"f":50.0}}}
data: {"production":{"ph-a":{"p":229.937,"q":187.384,"s":330.214,"v":242.257,"i":1.358,"pf":0.73,"f":50.0},"ph-b":{"p":246.959,"q":201.114,"s":333.81,"v":242.048,"i":1.379,"pf":0.73,"f":50.0},"ph-c":{"p":221.006,"q":183.913,"s":327.228,"v":242.127,"i":1.353,"pf":0.67,"f":50.0}},"net-consumption":{"ph-a":{"p":67.605,"q":-460.779,"s":505.633,"v":242.429,"i":2.09,"pf":0.17,"f":50.0},"ph-b":{"p":-149.061,"q":-371.75,"s":421.063,"v":242.191,"i":1.741,"pf":-0.39,"f":50.0},"ph-c":{"p":-57.835,"q":-261.707,"s":344.843,"v":242.046,"i":1.428,"pf":-0.12,"f":50.0}},"total-consumption":{"ph-a":{"p":297.543,"q":-648.163,"s":835.672,"v":242.343,"i":3.448,"pf":0.36,"f":50.0},"ph-b":{"p":97.898,"q":-572.865,"s":-87.724,"v":242.12,"i":-0.362,"pf":1.0,"f":50.0},"ph-c":{"p":163.171,"q":-445.62,"s":-18.161,"v":242.087,"i":-0.075,"pf":1.0,"f":50.0}}}
I've found this page https://dtbaker.net/blog/monitoring-solar-panels-with-nodered-influxdb-grafana/ but he doesn't explain how he starts the stream and logs into the Enphase Envoy to get a cookie and then use that cookie for the data stream. I have written to the author asking for more information but there has been no response in the last few months.
I'd really like to get this working because the Enphase Envoy is producing and publishing this data every 1 second. Currently I am sending a HTTP GET request to it every 6 seconds which is making it work harder than necessary if the data I need is already being produced.
Any ideas?