Page 1 of 1
What device to use for daily values
Posted: Monday 28 October 2024 13:37
by Henry
I'm running Node-RED to retrieve the daily energy usage from my NewMotion (Shell Recharge) charger. The value is updated after each charge session and at midnight this value is reset to 0. In Domoticz this results in negative values at midnight. I'm not sure what type of device I should use for this or how to handle this in a script.

- 2024-10-28 13 36 39.png (51.45 KiB) Viewed 1230 times
Re: What device to use for daily values
Posted: Monday 28 October 2024 13:41
by waltervl
Domoticz cannot handle this for a counter device. Is your charger not sending a total counter?
Else you first have to ask Domoticz what is the current counter value at midnight and add the daily value to it and send that to Domoticz.
Re: What device to use for daily values
Posted: Monday 28 October 2024 14:15
by psubiaco
The
Electric (Instant+Counter) device, configured in "managed" mode, is your friend.
If you know the charging power, just send it to Domoticz.
If you only know the energy charged in the last hour, you have to send to Domoticz that value (the only problem is that chart on Domoticz will display the charging energy translated 1 hour ahead).
For example, if the energy consumed from 12:00 to 13:00 is 5.7kWh, at 13.00 you can write 5700 (W) to Domoticz.
If energy between 13:00 and 14.00 is 0, write 0 to Domoticz.
You'll see the chart
Code: Select all
11 12 13 14 15
_____#####_____________ NodeRED
__________#####_______ Domoticz
Alternatively,
1. if you know python, make a plugin to monitor and control that wallbox: it's quite simple, expecially if your wallbox can be controlled by Modbus!
2. use a wallbox supported by Domoticz: you can also make it by yourself using a supported EVSE module.
Re: What device to use for daily values
Posted: Monday 28 October 2024 18:28
by Henry
I found a way to retrieve the total energy so I can use that. Only thing is that this is the total in kWh as a string e.g. 2.865,47
How can I convert this in a Wh string (2865470)?
Re: What device to use for daily values
Posted: Monday 28 October 2024 19:20
by psubiaco
Use a function in Node-RED to pass the right value to MQTT
Re: What device to use for daily values
Posted: Monday 28 October 2024 20:32
by Henry
This is (part of) the payload
Code: Select all
"payload": {
"chartTotal": {
"totalkWh": "2.865,47",
"totalkgCO2": "2.385,504",
"totalTime": 6790258,
"totalSessions": 223
},
Then the usage is
Code: Select all
$formatBase($number($substringBefore($replace(msg.payload.chartTotal.totalkWh, '.', ''), ',') & '.' & $substringAfter(msg.payload.chartTotal.totalkWh, ','))*1000)