Nod red to pvoutput error

Hi
I’ve manage to get my solar generation and energy use to post on my Pvouput page, using my emonpi two ct clamps with Nod red.

I copied Vster,s post below.
Continuing the discussion from PVOutput.org NodeRed:

Works well until my Solar generation drops to 0, then i get errors and it stops posting for about an hour.

msg.payload : string[137]
“ReFAIL: Time:Mon Feb 08 2021 16:32:01 GMT+0000 (Greenwich Mean Time) StatusCode:400 StatusMsg:Bad request 400: Invalid power value [-6]”

Once the value is positive again it starts posting.
The error is from v2 is solar I assume.
I’m a novice at this to say the least,

Any help would be much appreciated.

Hi Paul,

It looks like PVO is rejecting your upload because the Power value you’re sending is negative, in this case -6. The Power field is the amount of Power the house is using, eg, 2000W if the kettle is on, or 0W is nobody is home (or rather the solar PV is covering the baseload).
Crucially, It’s NOT what’s happening at the meter, i.e. 2000W with the kettle on, or -2000W when the PV is exporting.

You may need to a a new logged value to EmonCMS, something along the lines of, Power (at the meter), but with the “Allow Positive” filter and then logged. This filter stops the feed going negative. Then feed this new value into my PVO Node Red code.

Hope that makes sense,
Lee

1 Like

Hi Lee
And a big thank you for your reply.
I am so new to this, That I need to learn how it all links together.
The only way I manage to get it uploading was trial and error (whim and a prayer) not understanding how it all works.
Only had my emonpi a week and hadn’t heard of nod red till coming to the forum.
Sorry for the my life history lesson. So now to understand how emoncsm works to hopefully know what’s going on.
Is the a dummy’s guide or best place to understand the the prosses of how it all links together
Thanks again Lee

Hi Lee
Still trying to get my head round this, I’ve attached the nodred debug just before the error happens.

13/02/2021, 16:38:03[node: Data stored](http://192.168.1.28:1880/#)msg.payload : Object

{ d: "20210213", t: "16:38", v1: 3836.17, v2: "2", v3: 7718.38 … }

13/02/2021, 16:38:03[node: headercheck](http://192.168.1.28:1880/#)msg : Object

{ payload: "OK 200: Added Status", topic: "", _msgid: "c410004.284cb", action: "", headers: object … }

13/02/2021, 16:43:03[node: Debug1](http://192.168.1.28:1880/#)msg.payload : Object

{ d: "20210213", t: "16:43", v1: 3835.83, v2: "-9", v3: 7770.13 … }

13/02/2021, 16:43:03[node: Data stored](http://192.168.1.28:1880/#)msg.payload : Object

{ d: "20210213", t: "16:43", v1: 3835.83, v2: "-9", v3: 7770.13 … }

13/02/2021, 16:43:08[node: headercheck](http://192.168.1.28:1880/#)msg : Object

{ payload: "Bad request 400: Invalid power…", topic: "", _msgid: "7c171937.8366e8", action: "", headers: object … }

13/02/2021, 16:43:08[node: Post dump1](http://192.168.1.28:1880/#)msg.payload : string[137]

"FAILED: Time:Sat Feb 13 2021 16:43:08 GMT+0000 (Greenwich Mean Time) StatusCode:400 StatusMsg:Bad request 400: Invalid power value [-9]"

once the inverter has powered down approx. 25 minute, it starts to post on pvoutput again.
I know I am trying to run before I can walk.
I’ve tried your suggestion but still not fully understanding have made no progress.
I tried +positive before the log to feed in power2 inputs and that zeroed in my graph ok but still error on upload.
I just hope I’m no screwing anything up
sorry to be a pain

It’s continuing to fail because negative values are still getting through to PVO.
(-9 in the post above this one)

Sounds like you may have selected the wrong item from the dropdown list.
The one you want looks like this:

I suspect the problem lies elsewhere and I would welcome clarification from someone who is more familiar with the operation of the emonpi/emonbase than I am.
I have had a quick look at the node red code from the previous post (PVOutput.txt) that Paul said he used as his starting point.
The inputs that are used are from ‘mqtt in’ nodes. In terms of overall data flow through the open energy monitor system, I understand mqtt is earlier in the data flow into emoncms than the ‘inputs’. The figure below is from the guide and shows the MQTT broker between the emonHUB service and the Local Emoncms.


So including an emoncms input process to ensure the power2 value is positive will have no effect on the information being processed by node red.
Assuming Paul has not made too many changes to the PVOutput.txt node red code, I suggest looking at the node that was called ‘store power 2’ and find a suitable place in that routine to block the negative values.
I hope this helps.

1 Like

Hi Bill yes sorry I did add allow positive not +positive

Simon thank you for the diagram.
I have so much to learn and the diagram gives me a starting point to work through how all the processes work.
Thanks again for your time, much appreciated.