Something does not work.
The value on the energy meter is not updated correctly
What am I wrong with?
DZvents Scripts
Code: Select all
print('Whtotal PRIMA -> '..domoticz.devices('test_meter').WhTotal)
print('Energia -> ' ..( energia_consumata-energia_prodotta))
domoticz.devices('test_meter').updateElectricity(consumata_attuale,domoticz.devices('test_meter').WhTotal+(energia_consumata-energia_prodotta))
print('Whtotal DOPO -> '..domoticz.devices('test_meter').WhTotal)
Code: Select all
2020-05-04 00:00:00.261 Status: dzVents: ++ Whtotal PRIMA -> 11222.0
2020-05-04 00:00:00.261 Status: dzVents: ++ Energia -> 6.0
2020-05-04 00:00:00.261 Status: dzVents: ++ Whtotal DOPO -> 11222.0
2020-05-04 00:01:00.350 Status: dzVents: ++ Whtotal PRIMA -> 11228.0
2020-05-04 00:01:00.350 Status: dzVents: ++ Energia -> 8.0
2020-05-04 00:01:00.351 Status: dzVents: ++ Whtotal DOPO -> 11228.0