Reset counter object each month
#1
Hi,

I have iEM 3150 Power Meter running and are continuously counting my power consumption. I have mapped the power consumption to an KNX object  (1/1/1) so it shows me the total power consumption. However, this counter is not possible to reset.

I would like an object let say (2/2/2) that starts each month showing 0 as consumption and as the month progresses it increases. Then, the first day of each month, it starts all over again. This way I am able to track my consumption during the month and se how it progresses.

BR
Mr.D
Reply
#2
This is how i would do it

Add this as a event script to your total power consumption object.
Code:
kwhtot = event.getvalue()
kwhstart = 'kwh_usage_month_start'
kwhoutput = '2/2/2'

if storage.get(kwhstart) == nil then
 storage.set(kwhstart, kwhtot)
end

grp.write(kwhoutput, kwhtot - storage.get(kwhstart))

And this one as scheduled script with cron time 0 0 1 * * ,this would run 1 day every month.
Code:
storage.set('kwh_usage_month_start', nil)
grp.write('2/2/2', 0)

Mvh  Wink

Best regards, Jørn.
Reply


Forum Jump: