Node Red experts, attention please! Charger on/off trouble.


MASSIVE restock of EV Batteries at www.batteryhookup.com 5% coupon "POWERWALLS"

FilipII

New member
Joined
Mar 11, 2018
Messages
12
Im trying to use a smart meter and Node Red on a RPi with a relay board to charge my batteries, but I have stumbled opon a problem, lets say for simplicity I want the chargers to turn on when I export 100W to the grid, and turn off when Im exporting 1W.

I cant find the nodes to use for this function, I can only get it to turn on and off at the same power, and that is a problem, because if I export 100W and the chargers turn on, Im no longer exporting power so the chargers turn off!

I hope someone has an idea of what nodes I can use to get this function to work properly!
 

daromer

Moderator
Joined
Oct 8, 2016
Messages
5,662
No idea what you talk about? Paste in the code used from NodeRed and I can draw it up and see what you do.

What nodes do you use to read the data and what node for the output?
 

FilipII

New member
Joined
Mar 11, 2018
Messages
12
This is the code from Node Red, I hope you can import it to see if you understand what I mean.

Code:
[{"id":"16906a85.ca2365","type":"mqtt in","z":"a3c487f9.7dcc58","name":"Phase R mqtt","topic":"electricity/fase/R","qos":"2","broker":"6c4a2646.3e8b18","x":79.5,"y":248,"wires":[["6c83c973.7a2a38"]]},{"id":"6c83c973.7a2a38","type":"delay","z":"a3c487f9.7dcc58","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"3","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":257,"y":250,"wires":[["4a9814ee.93881c","6e0f5219.f5936c","c173e483.6f0e08"]]},{"id":"9472a999.ebbf28","type":"mqtt in","z":"a3c487f9.7dcc58","name":"Phase S mqtt","topic":"electricity/fase/S","qos":"2","broker":"6c4a2646.3e8b18","x":76,"y":335,"wires":[["c952f3a3.3305"]]},{"id":"95ac5ffe.fe18a","type":"mqtt in","z":"a3c487f9.7dcc58","name":"Phase T mqtt","topic":"electricity/fase/T","qos":"2","broker":"6c4a2646.3e8b18","x":75,"y":402,"wires":[["3266dc95.ab6954"]]},{"id":"c952f3a3.3305","type":"delay","z":"a3c487f9.7dcc58","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"3","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":274,"y":333,"wires":[["4a91f46e.5cdd7c","6e0f5219.f5936c","f5a7e1da.3a51f"]]},{"id":"3266dc95.ab6954","type":"delay","z":"a3c487f9.7dcc58","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"3","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":268,"y":403,"wires":[["c5a53720.4e11c8","6e0f5219.f5936c","f99502de.b1216"]]},{"id":"4a9814ee.93881c","type":"ui_gauge","z":"a3c487f9.7dcc58","name":"","group":"5fc8aa84.68be74","order":1,"width":"6","height":"6","gtype":"gage","title":"Gauge","label":"W","format":"{{value}}","min":"-3000","max":"+3000","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":489,"y":252,"wires":[]},{"id":"4a91f46e.5cdd7c","type":"ui_gauge","z":"a3c487f9.7dcc58","name":"","group":"5fc8aa84.68be74","order":3,"width":"6","height":"6","gtype":"gage","title":"Gauge","label":"W","format":"{{value}}","min":"-3000","max":"+3000","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":503,"y":304,"wires":[]},{"id":"c5a53720.4e11c8","type":"ui_gauge","z":"a3c487f9.7dcc58","name":"","group":"5fc8aa84.68be74","order":2,"width":"6","height":"6","gtype":"gage","title":"Gauge","label":"W","format":"{{value}}","min":"-3000","max":"+3000","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":503,"y":348,"wires":[]},{"id":"6e0f5219.f5936c","type":"ui_chart","z":"a3c487f9.7dcc58","name":"","group":"cb3a6130.14a68","order":1,"width":"6","height":"6","label":"chart","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","ymin":"","ymax":"","removeOlder":"2","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"x":326,"y":189,"wires":[[],[]]},{"id":"c173e483.6f0e08","type":"switch","z":"a3c487f9.7dcc58","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"-150","vt":"num"}],"checkall":"true","outputs":1,"x":253,"y":453,"wires":[["892cb260.ed66e"]]},{"id":"f5a7e1da.3a51f","type":"switch","z":"a3c487f9.7dcc58","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"-150","vt":"num"}],"checkall":"true","outputs":1,"x":227,"y":527,"wires":[["6fa0009c.6b69a"]]},{"id":"f99502de.b1216","type":"switch","z":"a3c487f9.7dcc58","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"-150","vt":"num"}],"checkall":"true","outputs":1,"x":203,"y":607,"wires":[["9400ff40.e451e8"]]},{"id":"892cb260.ed66e","type":"trigger","z":"a3c487f9.7dcc58","op1":"1","op2":"0","op1type":"num","op2type":"num","duration":"5","extend":true,"units":"s","reset":"","name":"","x":458,"y":418,"wires":[["401fe750.3a0018"]]},{"id":"6fa0009c.6b69a","type":"trigger","z":"a3c487f9.7dcc58","op1":"1","op2":"0","op1type":"num","op2type":"num","duration":"5","extend":true,"units":"s","reset":"","name":"","x":433,"y":499,"wires":[["38dc9ec9.363f9a"]]},{"id":"9400ff40.e451e8","type":"trigger","z":"a3c487f9.7dcc58","op1":"1","op2":"0","op1type":"num","op2type":"num","duration":"5","extend":true,"units":"s","reset":"","name":"","x":423,"y":578,"wires":[["e02854e6.41ff3"]]},{"id":"401fe750.3a0018","type":"rpi-gpio out","z":"a3c487f9.7dcc58","name":"R Charger","pin":"16","set":"","level":"0","out":"out","x":651,"y":453,"wires":[]},{"id":"38dc9ec9.363f9a","type":"rpi-gpio out","z":"a3c487f9.7dcc58","name":"S Charger","pin":"18","set":"","level":"0","out":"out","x":622,"y":507,"wires":[]},{"id":"e02854e6.41ff3","type":"rpi-gpio out","z":"a3c487f9.7dcc58","name":"T Charger","pin":"22","set":"","level":"0","out":"out","x":624,"y":555,"wires":[]},{"id":"6c4a2646.3e8b18","type":"mqtt-broker","z":"","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"1","birthPayload":""},{"id":"5fc8aa84.68be74","type":"ui_group","z":"","name":"Group","tab":"3b9133bd.12eaac","order":null,"disp":true,"width":"6"},{"id":"cb3a6130.14a68","type":"ui_group","name":"Group 1","tab":"3cc5a09d.bc52e","order":1,"disp":true,"width":6},{"id":"3b9133bd.12eaac","type":"ui_tab","name":"Tab","icon":"dashboard","order":0},{"id":"3cc5a09d.bc52e","type":"ui_tab","name":"Tab 2","icon":"dashboard","order":2}]
 

Korishan

Moderator
Joined
Jan 7, 2017
Messages
6,943
FilipII: please format correctly by using the [ code ] & [ /code ] tags. Plus formatting it to make it easier to read would help, too.

Code:
this is an example code
[{"id":"16906a85.ca2365","type":"mqtt in","z":"a3c487f9.7dcc58","name":"Phase R mqtt","topic":"electricity/fase/R","qos":"2","broker":"6c4a2646.3e8b18","x":79.5,"y":248,"wires":[["6c83c973.7a2a38"]]},
 

FilipII

New member
Joined
Mar 11, 2018
Messages
12
No one? I think I need a function node, with a simple code, but my skills to write a function code is limited to zero...

This is my current flow, it has a setpoint to turn on the chargers when I sell in excess of 150W to the grid, but the problem begins when there is limited sunshine and the carger turns on when the export is 150W, then the export goes to zero and the charger turns off, then the export goes in excess of 150W again and the charger turns on, zero export and off again... never ending story.

image_aotkjs.jpg
 

floydR

Member
Joined
Aug 23, 2017
Messages
1,481
How any amps do your chargers draw?

Later floyd


ps am no expert at anything
 

FilipII

New member
Joined
Mar 11, 2018
Messages
12
At the moment Im using small 2A bicycle chargers, later when the batrium watchmon4 system arrives (late april I belive) I will be hooking up three Eltek FP2HE, one on each phase, through Batrium I can set the charging amps up to 3 x 37,5A, most likely I will be using 3 x 10A during the summer.
 

floydR

Member
Joined
Aug 23, 2017
Messages
1,481
Seems to me that three 2A chargers would draw more than 150 watts total, basing this on 120 volts per phase 2A@48v output would be around .75A@ 120vac= 90-100 watts per charger, 270-300 watts total. Would just using 1 charger be possible?


later floyd
 

FilipII

New member
Joined
Mar 11, 2018
Messages
12
Yes, you are correct, each charger draws 122W, but I have three phases with 240V (L-N) and a setpoint of -150W on each phase. Later with more charge current I will change the setpoint accordingly, so its not what the chargers draw that is my problem it is the fact that when there is limited sunshine (dawn, dusk, rainy and cloudy days) and the export hovers around the setpoint the chargers turn on and off until the export including the load from the charger goes in excess of -150W, then it works great...
 
Top