This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Reset counter object each month
#4
Hi,

possible to use different variants, as use trends:

https://forum.logicmachine.net/showthrea...umentation

but I think for you easiest way is create scheduled scripts, and write to the different groups data of power consumption at 0:00 every 1st day for every month (you will have 12 scheduled scripts). So you will see consumption for starting of month:

Consumpted_Energy = grp.getvalue('33/5/30') -- Group of your Energy meter with consumed energy
grp.write('33/7/13', Consumpted_Energy) -- April. There will be saved data of consumed energy for 0:00 of 1st April

The same for May and so on..:

Consumpted_Energy = grp.getvalue('33/5/30') -- Group of your Energy meter with consumed energy
grp.write('33/7/14', Consumpted_Energy) -- May. There will be saved data of consumed energy for 0:00 of 1st May

For previous month just EnergyPrevious = grp.getvalue('33/7/14') - grp.getvalue('33/7/13') -- For April. You should think also about other month..

Just easy calculations Smile Of course such way you can show consumption for every day/week... etc. For me I show consumption from month start:

(Add this to event script for group where is recorded your consumed energy. So all recalculations will be done automatically when data upgrades (in example 33/5/30)).
MonthConsumed = grp.getvalue('33/5/30') - grp.getvalue('33/7/13' -- Smile

Also there you can add cost of energy:
EnergyCost = 0.16 -- (EuroCents per kWh) your cost

MonthEnergyConsumedCost = MonthConsumed * EnergyCost

grp.write('33/5/50', MonthEnergyConsumedCost) -- group you will store cost of consumed energy

This is just description of easy steps, let's try to play with..

Alex
Reply


Messages In This Thread
Reset counter object each month - by Mr.D - 12.01.2018, 19:32
RE: Reset counter object each month - by AlexLV - 26.04.2020, 09:03

Forum Jump: