If anybody wants to test this just copy-past the flows to node-red, reconfigure email-emoncms-mqtt and use the following MQTT commands to simulate a charge:
The JSON global string named “evse_charge” to represent a charging EVSE:
{
"portable_evse": {
"mod": "P",
"amp": "12",
"pri": "H",
"ttl": 3
},
"garage_evse": {
"mod": "N",
"amp": "16",
"pri": "L",
"ttl": 3
}
}
Start charge:
mosquitto_pub -t evse/portable_evse/from -m "start,16,P"
This will send a email and create a JSON object from EVSE “portable_evse” with the following attributes:
Initial amp setting 16A
Initial charge mode: P (take all available power)
Statistics:
mosquitto_pub -t evse/portable_evse/from -m "stats,1847,1583,1345,5,9,2987,229,13.13,16,P"
This will update emoncms node “portable_evse” the elements are:
1847 = elapsed time (seconds)
1583 = energy (wh)
1345 = energy_liquid (wh)
5 = percent of battery(%)
9 = km charged (Km)
2987 = power (w)
229 = voltage (v)
13.13 = current (a)
16 = evseAmps (a)
P = charge mode [M,N,P,S]
and pass the last 2 variables to the next function → "P,16"
End charge:
mosquitto_pub -t evse/portable_evse/from -m "stop,12992,14354,13220,69,97,111.12"
This will reconfigure the EVSE with original settings, delete the JSON object and send a email with the stats:
12992 = elapsed time (seconds)
14354 = energy (wh)
13220 = energy_liquid (wh)
69 = percent of battery(%)
97 = km charged (Km)
111.12 = Total energy of the EVSE (kWh)
The House amps need to be present for the algorithm to work:
mosquitto_pub -t evse/portable_evse/from -m "emoncms/to/2 1537,6,1,0,0,23751"
1537 = Power CT1
6 - Current CT1
1 = pf CT1
0 = Power CT2
0 = Power CT3
23751 = Vrms X 100
At the bottom of the flows there are a lot of debug inject nodes to dump/check/inject variables and check operation.If it’s too fast the 10sec inject node at the top can be disabled and the variables will stick in memory.
This is still in heavy development, and sorry for the portuguese comments on the code.
node-red_evse.zip (5.9 KB)