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.

Convert from Wh to Kwh
#1
Hi there,
what's wrong with this below?

Consumo_impianto = grp.getvalue('3/3/30')
os.sleep(0.5)
Consumo_ftv_fase_1 = grp.getvalue('3/3/24')
os.sleep(0.5)
Consumo_ftv_fase_2 = grp.getvalue('3/3/25')
os.sleep(0.5)
Consumo_ftv_fase_1 = grp.getvalue('3/3/26')
os.sleep(0.5)
Consumo_pdc = grp.getvalue('3/3/27')
os.sleep(0.5)
Consumo_impianto_kwh = (Consumo_impianto / 1000)
os.sleep(0.5)
Consumo_ftv_fase_1_kwh = (Consumo_ftv_fase_1 / 1000)
os.sleep(0.5)
Consumo_ftv_fase_2_kwh = (Consumo_ftv_fase_2 / 1000)
os.sleep(0.5)
Consumo_ftv_fase_3_kwh = (Consumo_ftv_fase_3 / 1000)
os.sleep(0.5)
Consumo_pdc_kwh = (Consumo_pdc / 1000)
os.sleep(0.5)
grp.write ('3/3/121', Consumo_impianto_kwh)
os.sleep(0.5)
grp.write ('3/3/124', Consumo_ftv_fase_1_kwh)
os.sleep(0.5)
grp.write ('3/3/125', Consumo_ftv_fase_2_kwh)
os.sleep(0.5)
grp.write ('3/3/126', Consumo_ftv_fase_3_kwh)
os.sleep(0.5)
grp.write ('3/3/127', Consumo_pdc_kwh)

Nothing write.

Thanks.
Reply
#2
Hi,

Are you using modbus templates? If yes you can add a scale factor in the template.

BR,

Erwin
Reply
#3
Hi Erwing,
no. Data comes from KNX (4 byte integer). Active Energy.

I remember that with an old version of Logic Machine there was not any problem. I cannot explain it.

Thanks.
Reply
#4
Have you logged the outcome?

Maybe you need to round it with math.round(value, 0)

You can also remove the delay’s on all items that are not grp.write related.

BR,

Erwin
Reply
#5
OK Done. Thank you!!
Reply


Forum Jump: