25.10.2024, 13:08

Hello Community,

I'm writing for asking help about how to store a value inside a GA and use it as reference for a calculation.

To be more clear I expose my real case:

I've the value of energy consumption measured by a meter. I need to calculate the energy consumption of the last month so I think I'd need to store the value of the previous month in variable and make a subtraction from the actual value.

Hope someone can help me.

Thanks

I'm writing for asking help about how to store a value inside a GA and use it as reference for a calculation.

To be more clear I expose my real case:

I've the value of energy consumption measured by a meter. I need to calculate the energy consumption of the last month so I think I'd need to store the value of the previous month in variable and make a subtraction from the actual value.

Code:

`Electrical_Consumption_Now = ("32/1/100")-- amount of energy measured by the meter`

Electrical_Consumption_previous_month = ....

Electrical_Consumption_calculated = Electrical_Consumption_Now - Electrical_Consumption_previous_month

grp.write(32/1/101, Electrical_Consumption_Calculated)

Hope someone can help me.

Thanks