PVoutput Get data to Home Assistant from an old newbie

I am over 70 and a complete newcomer to both Node Red and Home Assistant. I thought I would share this to encourage others to have a go. I installed both HAAS and Node-Red in Dockers on my QNAP server and my first project was to use Node Red to extract the data from PVoutput and present it to HAAS. Here is my flow, which the more knowledgeable might scorn and pick holes in, but it worked almost from a first try. It seems I am not completely brain dead yet.

Here is my flow.

[{"id":"f0d61061.dcc4f","type":"tab","label":"PV","disabled":false,"info":""},{"id":"3a024d92cf4082fc","type":"inject","z":"f0d61061.dcc4f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"*/3 7-16 * * *","once":true,"onceDelay":0.1,"topic":"","payloadType":"date","x":190,"y":80,"wires":[["59fe4d5e939e4fe9","85d3e2df305d10cf"]]},{"id":"59fe4d5e939e4fe9","type":"http request","z":"f0d61061.dcc4f","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"https://pvoutput.org/service/r2/getstatus.jsp?sid=xxxx&key=xxxxxxxxxxx&h=1&limit=1","tls":"","persist":false,"proxy":"","authType":"","senderr":false,"x":170,"y":180,"wires":[["e8399b93eb09899a"]]},{"id":"9992d126b8dd089e","type":"debug","z":"f0d61061.dcc4f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1090,"y":80,"wires":[]},{"id":"e8399b93eb09899a","type":"csv","z":"f0d61061.dcc4f","name":"","sep":",","hdrin":"","hdrout":"none","multi":"one","ret":"\\n","temp":"","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":170,"y":280,"wires":[["810b78c14a009ffd"]]},{"id":"810b78c14a009ffd","type":"split","z":"f0d61061.dcc4f","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":true,"addname":"topic","x":170,"y":380,"wires":[["29a7cd6404a60ea3"]]},{"id":"af349d4549ae7eb0","type":"ha-entity","z":"f0d61061.dcc4f","name":"Energy","server":"73abc5e48f7eb599","version":2,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"sensor.mypv_energy"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":"kWh"},{"property":"state_class","value":""},{"property":"last_reset","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"payload","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":680,"y":200,"wires":[["40ecae24cc2986fb"]]},{"id":"e341cbe17d758c0e","type":"ha-entity","z":"f0d61061.dcc4f","name":"Efficiency","server":"73abc5e48f7eb599","version":2,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"sensor.mypv_efficiency"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":"kWh/kW"},{"property":"state_class","value":""},{"property":"last_reset","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"payload","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":680,"y":260,"wires":[["cfd6d877ea62055f"]]},{"id":"2790843bea6ce3c5","type":"ha-entity","z":"f0d61061.dcc4f","name":"power","server":"73abc5e48f7eb599","version":2,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"sensor.mypv_power"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":"W"},{"property":"state_class","value":""},{"property":"last_reset","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"payload","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":670,"y":320,"wires":[["55ec3669ac0516e0"]]},{"id":"9f8874c1b35cfb58","type":"ha-entity","z":"f0d61061.dcc4f","name":"Average Power","server":"73abc5e48f7eb599","version":2,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"sensor.mypv_avpower"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":"W"},{"property":"state_class","value":""},{"property":"last_reset","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"payload","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":700,"y":380,"wires":[["51f1ce20ad3b9b28"]]},{"id":"550f8a9edfb69080","type":"ha-entity","z":"f0d61061.dcc4f","name":"Normalised","server":"73abc5e48f7eb599","version":2,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"sensor.mypv_normalised"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":"kW/kW"},{"property":"state_class","value":""},{"property":"last_reset","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"payload","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":690,"y":440,"wires":[["b45006fcac72184c"]]},{"id":"cdd35aed4f8feeac","type":"ha-entity","z":"f0d61061.dcc4f","name":"TIME","server":"73abc5e48f7eb599","version":2,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"sensor.mypv_time"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""},{"property":"last_reset","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"payload","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":670,"y":140,"wires":[["ae44598919b87d5f"]]},{"id":"ae44598919b87d5f","type":"debug","z":"f0d61061.dcc4f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1090,"y":140,"wires":[]},{"id":"40ecae24cc2986fb","type":"debug","z":"f0d61061.dcc4f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1090,"y":200,"wires":[]},{"id":"29a7cd6404a60ea3","type":"switch","z":"f0d61061.dcc4f","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"col1","vt":"str"},{"t":"eq","v":"col2","vt":"str"},{"t":"eq","v":"col3","vt":"str"},{"t":"eq","v":"col4","vt":"str"},{"t":"eq","v":"col5","vt":"str"},{"t":"eq","v":"col6","vt":"str"},{"t":"eq","v":"col7","vt":"str"},{"t":"eq","v":"col8","vt":"str"},{"t":"eq","v":"col9","vt":"str"},{"t":"eq","v":"col10","vt":"str"}],"checkall":"true","repair":false,"outputs":10,"x":390,"y":380,"wires":[[],["cdd35aed4f8feeac"],["af349d4549ae7eb0"],["e341cbe17d758c0e"],["2790843bea6ce3c5"],["9f8874c1b35cfb58"],["550f8a9edfb69080"],[],[],["dc3ebb4f5f0f751a"]]},{"id":"cfd6d877ea62055f","type":"debug","z":"f0d61061.dcc4f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1090,"y":260,"wires":[]},{"id":"55ec3669ac0516e0","type":"debug","z":"f0d61061.dcc4f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1090,"y":320,"wires":[]},{"id":"51f1ce20ad3b9b28","type":"debug","z":"f0d61061.dcc4f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1090,"y":380,"wires":[]},{"id":"b45006fcac72184c","type":"debug","z":"f0d61061.dcc4f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1090,"y":440,"wires":[]},{"id":"d453f2a2146c1be6","type":"debug","z":"f0d61061.dcc4f","name":"NOT USED","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1090,"y":500,"wires":[]},{"id":"dea1ac17f8b7ea81","type":"debug","z":"f0d61061.dcc4f","name":"NOT USED","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1090,"y":560,"wires":[]},{"id":"63099d64803a4a76","type":"debug","z":"f0d61061.dcc4f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1090,"y":620,"wires":[]},{"id":"dc3ebb4f5f0f751a","type":"ha-entity","z":"f0d61061.dcc4f","name":"Temperature","server":"73abc5e48f7eb599","version":2,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"sensor.mypv_temp"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":"deg C"},{"property":"state_class","value":""},{"property":"last_reset","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"payload","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":690,"y":620,"wires":[["63099d64803a4a76"]]},{"id":"1c51054791a3290b","type":"ha-entity","z":"f0d61061.dcc4f","name":"DATE","server":"73abc5e48f7eb599","version":2,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"sensor.mypv_date"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""},{"property":"last_reset","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":670,"y":80,"wires":[["9992d126b8dd089e"]]},{"id":"85d3e2df305d10cf","type":"moment","z":"f0d61061.dcc4f","name":"","topic":"","input":"","inputType":"msg","inTz":"Europe/London","adjAmount":0,"adjType":"days","adjDir":"add","format":"DD/MM/YYYY","locale":"","output":"","outputType":"msg","outTz":"Europe/London","x":460,"y":80,"wires":[["1c51054791a3290b"]]},{"id":"d1b10fde1a1c6f0f","type":"comment","z":"f0d61061.dcc4f","name":"The URL","info":"This is the GET ststus URL\n\nYou will need to put your own ID and KEY in here shown by xxxx\nNote:it is preferable to use a Read Only key, which you can set yourself in the PVoutput.org setup\n\nThe Limit = 1 is to limit the output to the last known value\n\nhttps://pvoutput.org/service/r2/getstatus.jsp?sid=xxx&key=xxxxxxxxxxxx&h=1&limit=1","x":380,"y":180,"wires":[]},{"id":"73abc5e48f7eb599","type":"server","name":"Home Assistant","version":2,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30"}]

Hello and welcome to the forum.

You might want to read this as it explains how to share your flow.

It sounds like you are enjoying using Node-RED - be careful it can become highly addictive.

Hi @Linhey great first post.

Thanks for sharing your experiences.


Some canned text...

in order to make code more readable and importable it is important to surround your code with three backticks
```
like this
```

You can edit and correct your post by clicking the pencil icon.

See this post for more details - How to share code or flow json


I recommend watching this playlist: Node-RED Essentials. The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

Sorry about my flow post, I will do better next time, thanks for the help.

Thanks for the video tips I shall go and have a look now.