OK. I did some further analysis of this bug. It is definitely related to gas devices (point 2 below)
1) I have a real Gas P1 meter which shows in increase of 0.06 at 00:02 hrs.
This is shown as the daily total in the top right corner of the icon.
This is shown in the graph and related cvs at 00:00 hrs.
This is shown in the Meter table as an increase at 00:05:00 hrs and remains there with every further update.
2) This value is copied to a second GAS device.
The value is not shown in the top right corner (since not part of today's total)
This is shown in the graph and cvs at 23:00 the previous day.
This is shown in the Meter tables as an increase at 00:05:00 hrs and remains there until 03:00:00.
After 03:00:00 no new records are seen until a new value comes in later in the day,
which is then shown as the new total. The 0.06 total disappears.
3) The value of point 1) is copied to a CUSTOM device.
The value is shown as part of the total in the top right corner of the icon.
It is shown in the graph and cvs as an increase at 00:05:00 hrs and remains there until 01:00:00
It is shown in the Percentage table at 00:05:00 hrs and remains there until 01:00:00
The new value that comes in later in the day is added to the total.
4) The value of point 1) is copied to a COUNTER device.
The value is part of the daily total shown in the top right corner of the icon.
It is shown in the graph and csv at 00:05:00 and remains there until 01:00:00
The new value later in the day is added to the total.
The code that does the insertions for point 2,3 and 4 is:
Code: Select all
currentValue=domoticz.devices(idxHotWaterGas).counter
domoticz.devices(idxHotWaterGas).updateGas(increasegas*1000+currentValue*1000) -- update value must be in dm3
currentValue=domoticz.devices(idxHotWaterGas2).sensorValue
domoticz.devices(idxHotWaterGas2).updateCustomSensor(increasegas+currentValue)
currentValue=domoticz.devices(idxHotWaterGastest).counter
domoticz.devices(idxHotWaterGastest).updateCounter(increasegas*1000+currentValue*1000) -- update value must be in dm3
The problem is that for point 2, i.e. the GAS device, when querying the currentValue in the script later in the day (after 03:00:00) it is reported as 0 and then as result the new value replaces the total instead of being added to the total.
For the update at 00:02:00 and the update at 10:01:00 later in the day the logfile shows the following device values before the update:
2) for the second GAS device at 00:02 a counter of 0.616 and countertoday of 0.367
and at 10:01 counter 0 and countertoday 0, so the 0.06 is no longer there.
3) for the CUSTOM device at 00:02 a value of 0.505 and at 10:01 a value of 0.564, so the 0.06 was added correctly
4) for the COUNTER device at 00:02 a counter of 0.424 and countertoday of 0.367 (which sould be 0 since the new day just started)
and at 10:01 a counter of 0.484 and countertoday of 0.06, so the 006 was added correctly (if countertoday was 0 to start with after all)
Also the icon of the GAS meter shows in the top right corner the value of the last update and shows the total day value in small digits in the icon, as a total.
So definitely some real problems with GAS device of point 2. (icon shows p1 smart meter,gas) whereas a standard counter device works correctly and also the custom device works correctly.
I will now remove and re-create the 3 gas devices so they all start at the same value.