Responding to myself since I think I have found what became "wrong" coding with beta 3.8035:
the plugins where I see the issue have in common the fact that some devices are created and immediately updated in the same "onHeartbeat" callback... Seems with the version 3.8035 of domoticz only one device can be created and updated within the same call to "onHeartbeat"... If I change the code so that on the first heartbeat the devices that need to be created are and that then on the second and subsequent heartbeats these devices are updated (AND ONLY THEN)...
So this code that used to work:
Code: Select all
# display the data
for pollutant in self.pollutants:
Domoticz.Debug(
"Pollutant: {} = {} (max = {})".format(pollutant.name, pollutant.level, pollutant.levelmax))
if pollutant.level:
# if device does not yet exist, then create it
if not (pollutant.index in Devices):
Domoticz.Device(Name=pollutant.name, Unit=pollutant.index, TypeName="Custom",
Options={"Custom": "1;{}".format(pollutant.unit)}, Used=pollutant.used).Create()
# update the device
self.UpdateDevice(pollutant.index, pollutant.level, pollutant.green, pollutant.red)
needs to be replaced by this one:
Code: Select all
# display the data
device_created = False
for pollutant in self.pollutants:
Domoticz.Debug(
"Pollutant: {} = {} (max = {})".format(pollutant.name, pollutant.level, pollutant.levelmax))
if pollutant.level:
# if device does not yet exist, then create it
if not (pollutant.index in Devices):
Domoticz.Device(Name=pollutant.name, Unit=pollutant.index, TypeName="Custom",
Options={"Custom": "1;{}".format(pollutant.unit)}, Used=pollutant.used).Create()
device_created = True
else:
# update the device
self.UpdateDevice(pollutant.index, pollutant.level, pollutant.green, pollutant.red)
if device_created:
self.lastupdate = now
# force an update on the next heartbeat rather than on the usual polling interval
Pretty strange behaviour... Would be good to revert to previous one if possible. In the meantime I'll rewrite my plugins to address this