Now I want to monitor the water usage of one day. So I created a second incremental counter. This counter I want to reset to zero at 0:00 h. Only problem is that it does not reset to zero.
Code: Select all
return {
on = { timer = {'at 0:00'},
devices = { 'Waterpuls' },
},
execute = function(domoticz, device)
if (device.trigger == 'at 0:00') then
domoticz.devices('Waterverbruik dag').updateCounter(0)
print ('Reset Waterverbruik dag')
end
if (device.name == 'Waterpuls' and device.state == 'On') then
domoticz.devices('Waterverbruik').incrementCounter(1)
domoticz.devices('Waterverbruik dag').incrementCounter(1)
end
end
}
Can anybody help?