Hi,
I'm measuring power with my CurrentCost clamps (one Watt measure every 6 seconds).
I'm using the Dummy hardware with "Electric (instant + counter)", and counter is computed.
With small power (even some tens of Watts), the result in counter is either false (0) or inacurate.
In SQLHelper.cpp, I see this calculation :
float energyDuringInterval = static_cast<float>(powerDuringInterval * intervalSeconds / 3600);
float energyAfterInterval = static_cast<float>(energyUpToInterval + energyDuringInterval);
(for testing purpose, we start at 0, energyUpToInterval = 0)
So, for 20W and 6s : 20*6/3600 = 0.033Wh and for 30W : 30*6/3600 = 0.050Wh
Later, we can see :
sprintf(sValueUpdate, "%s;%.1f", powerUpdate, energyAfterInterval);
Ha ! So, if energyAfterInterval < 0.050, the %.1f brings us back to 0.
The value stored in the dB should be more precise, at least %.3f to avoid such problems.
In the database, sValue is a string (100 char if I recall correctly), so it shouldn't be a problem.
I've compiled Domoticz with this only change, and it perfectly works.
Thanks !
[DONE/SOLVED] Possibility to record small power consumption ?
Moderators: leecollings, remb0
-
Francis91
- Posts: 5
- Joined: Friday 26 August 2022 14:16
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
[DONE/SOLVED] Possibility to record small power consumption ?
Last edited by Francis91 on Thursday 01 September 2022 15:35, edited 1 time in total.
Who is online
Users browsing this forum: No registered users and 1 guest