I have a dzVents script that every day at 23:59 stores the rain of the day into the script data.
Code: Select all
if item.trigger == 'at 23:59' then
domoticz.data.Rain_daily.add(rainSensor.rain)
end
https://drive.google.com/file/d/1S7NKNK ... sp=sharing.
However when looking into the script data, you can see that the 29.2mm is repeated until 02/07 (the day there is another value). And the same with the 0.4mm... so far no rain since then, so stays at 0.4mm.
So I have the impression when the is no rain, the previous "counter" is still kept. How can I solve this?
Code: Select all
["Rain_daily"] = {
[1] = {
["data"] = 0.40000000596046;
["time"] = "2026-7-5 21:59:0.178";
};
[2] = {
["data"] = 0.40000000596046;
["time"] = "2026-7-4 21:59:0.438";
};
[3] = {
["data"] = 0.40000000596046;
["time"] = "2026-7-3 21:59:0.242";
};
[4] = {
["data"] = 0.40000000596046;
["time"] = "2026-7-2 21:59:0.646";
};
[5] = {
["data"] = 29.200000762939;
["time"] = "2026-7-1 21:59:0.65";
};
[6] = {
["data"] = 29.200000762939;
["time"] = "2026-6-30 21:59:0.171";
};
[7] = {
["data"] = 29.200000762939;
["time"] = "2026-6-29 21:59:1.916";
};
};