What device to use for daily values

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
Henry
Posts: 29
Joined: Tuesday 06 March 2018 18:56
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: Netherlands
Contact:

What device to use for daily values

Post 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
2024-10-28 13 36 39.png (51.45 KiB) Viewed 777 times
User avatar
waltervl
Posts: 5369
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: What device to use for daily values

Post 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.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
psubiaco
Posts: 204
Joined: Monday 20 August 2018 9:38
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Italy
Contact:

Re: What device to use for daily values

Post 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.
Paolo
--
I use DomBus modules to charge EV car, get a full alarm system, control heat pump, fire alarm detection, lights and much more. Video
Facebook page - Youtube channel
Henry
Posts: 29
Joined: Tuesday 06 March 2018 18:56
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: What device to use for daily values

Post 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)?
User avatar
psubiaco
Posts: 204
Joined: Monday 20 August 2018 9:38
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Italy
Contact:

Re: What device to use for daily values

Post by psubiaco »

Use a function in Node-RED to pass the right value to MQTT
Paolo
--
I use DomBus modules to charge EV car, get a full alarm system, control heat pump, fire alarm detection, lights and much more. Video
Facebook page - Youtube channel
Henry
Posts: 29
Joined: Tuesday 06 March 2018 18:56
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: What device to use for daily values

Post 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)
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests