Electricity consumption & cost per day, month and year  [Solved]

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

User avatar
McMelloW
Posts: 434
Joined: Monday 20 November 2017 17:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.1
Location: Harderwijk, NL
Contact:

Re: Electricity consumption & cost per day, month and year

Post by McMelloW »

mojso wrote: Friday 21 June 2024 13:17 I made a change in the script, in line 150, 158, 167
if you plan to update domoticz immediately, you can do it before or after,
I have last beta update of Domoticz
Thanks a lot It works OK now.
Greetings McMelloW
User avatar
McMelloW
Posts: 434
Joined: Monday 20 November 2017 17:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.1
Location: Harderwijk, NL
Contact:

Missing 5 days - Electricity consumption & cost per day, month and year

Post by McMelloW »

These 2 lines (179-180) in the source code

Code: Select all

            dz.log('daysCounterMonth: '  .. daysCounterMonth, dz.LOG_DEBUG)
            dz.log('daysCounterYear: '  .. daysCounterYear, dz.LOG_DEBUG)
Showing these results in the domoticz log

Code: Select all

2024-06-21 19:39:00.579  Status: dzVents: Debug: ElecConsCost: daysCounterMonth: 16
2024-06-21 19:39:00.579  Status: dzVents: Debug: ElecConsCost: daysCounterYear: 168
Today it is day 173 of 2024 and day 21 of June so I miss 5 days of the year and of the month. The date on my Raspberry Pi is the actual date & time. It is also synchronized with ntp

Does somebody has an explanation for this difference.
Greetings McMelloW
User avatar
waltervl
Posts: 5889
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Electricity consumption & cost per day, month and year

Post by waltervl »

It seems to count the number of entries in the database. So probably Domoticz did not register your energy every day.
Do you see gaps in the graphs of your original energy devices?
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
McMelloW
Posts: 434
Joined: Monday 20 November 2017 17:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.1
Location: Harderwijk, NL
Contact:

Re: Electricity consumption & cost per day, month and year

Post by McMelloW »

waltervl wrote: Friday 21 June 2024 20:29 It seems to count the number of entries in the database. So probably Domoticz did not register your energy every day.
Do you see gaps in the graphs of your original energy devices?
Yes there are gaps in these devices. I had to go back 5 days after an updatebeta. This causes the gaps in the database.
The energy data consumed and delivered is registered by my energy provider as I can see.

I had the impression the days and month were just counted by de calendar. But it is not.
Greetings McMelloW
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest