Page 2 of 2

Re: Domoticz thermal energy kWh, thermal energy meter

Posted: Sunday 21 December 2025 18:05
by geoterm
BartSr wrote: Sunday 21 December 2025 16:40 For yr calculation you need:
Measure device for E-input
Temp measure device inlet water
Temp measure device outlet water
Waterflow measure device.

All available?
Yes. You're right.I have all of this. I need the device or script to calculate the device's power in watts x time, i.e., the amount of thermal energy in kWh.

Re: Domoticz thermal energy kWh, thermal energy meter

Posted: Sunday 21 December 2025 19:40
by geoterm
Computed or from device ?

Re: Domoticz thermal energy kWh, thermal energy meter

Posted: Sunday 21 December 2025 20:49
by geoterm
In my opinion, this device is not working. It shows the current power in watts, but does not calculate energy in kWh. There is no data in the logs.

Re: Domoticz thermal energy kWh, thermal energy meter

Posted: Sunday 21 December 2025 23:01
by waltervl
It should be set to calculated (as you do not supply the kwh counter) and you have to supply the watt data in Watts, not kW.

Re: Domoticz thermal energy kWh, thermal energy meter

Posted: Monday 22 December 2025 10:30
by geoterm
It works :). Thank you.
And actually providing the device with a value in Watts.
The key was writing the dz vents script:

Code: Select all

return {
	on = {
		devices = {
			200
		}
	},
	execute = function(domoticz, device)
		domoticz.devices(277).updateElectricity(domoticz.utils.round((domoticz.devices(252).temperature * domoticz.devices(200).flow *63.65), 0))
	end
}

Re: Domoticz thermal energy kWh, thermal energy meter

Posted: Monday 22 December 2025 16:52
by geoterm
How to create a device that calculates only today Wh or total Wh ?

Re: Domoticz thermal energy kWh, thermal energy meter

Posted: Monday 22 December 2025 17:57
by BartSr
This device automaticly resets the daily usage to 0 at 00.00h

Re: Domoticz thermal energy kWh, thermal energy meter

Posted: Monday 22 December 2025 18:50
by geoterm
Ok, but I want to display today wh and total wh on the display. How to do it?

Re: Domoticz thermal energy kWh, thermal energy meter

Posted: Monday 22 December 2025 19:37
by waltervl
You cannot do that, there is no option for that. The whtotal value is only available on the log-report page of the device.

Re: Domoticz thermal energy kWh, thermal energy meter

Posted: Monday 22 December 2025 20:51
by geoterm
Okay, that's what I felt.

Re: Domoticz thermal energy kWh, thermal energy meter

Posted: Monday 22 December 2025 20:56
by geoterm
I have a new challenge. In a new post. It concerns electricity, or rather, energy balance.

Re: Domoticz thermal energy kWh, thermal energy meter

Posted: Sunday 04 January 2026 18:42
by geoterm
I've noticed an error in the temperature delta between the supply and return. On the left is the value calculated by the ESP32, and on the right by the Domoticz script. Domoticz is calculating the delta incorrectly. Why?
When I restart the raspberry it counts fine for some time.
https://www.youtube.com/watch?v=zELH0_coS5U

Re: Domoticz thermal energy kWh, thermal energy meter

Posted: Sunday 04 January 2026 22:13
by geoterm
I had a problem removing devices—Domoticz was freezing. I temporarily disabled all LUA scripts, and now I can delete unnecessary devices.

Re: Domoticz thermal energy kWh, thermal energy meter

Posted: Monday 05 January 2026 12:38
by RonkA
Hi, I see in the video the initial values are not the same, that seems to me that the temperatures are not calibrated right.
Also the sample times to do the calculations is not in sync so this will introduce further deviation..

What i am stating here are pure guesses from my part because, besides this video without audio or description, you don't give a lot of information..

Re: Domoticz thermal energy kWh, thermal energy meter

Posted: Monday 05 January 2026 13:43
by waltervl
What is your script, and how is it triggered, on device change of one of the 2 temperature devices?
And better post this question in a Lua specific topic as it is not related to energy device. viewforum.php?f=61

Re: Domoticz thermal energy kWh, thermal energy meter

Posted: Wednesday 07 January 2026 11:15
by geoterm
I think I managed to solve this problem with the help of Google. I also had trouble removing unnecessary devices—Domoticz was freezing. I disabled LUA scripts, removed the unnecessary devices, re-enabled LUA scripts, and observed that Domoticz was counting correctly. Thanks for the tips.

Re: Domoticz thermal energy kWh, thermal energy meter

Posted: Wednesday 07 January 2026 20:20
by geoterm
It is possible that I had temperature sensors with duplicate names, e.g. "tz" and "tZ".