I have found a execution error that occurs in drivers that call the doConfigure lifecycle when the Hub has a reboot..
I found out yesterday when the Hub was rebooted by updating to firmware 41.06.
It is not a problem with this firmware since it also happens with firmware 40.06
For example in your stock zigbee power meter driver the lifecycle handler calls do_Configure, which performs device:configure() .
lifecycle_handlers = {
init = device_init,
doConfigure = do_configure,
}
local device_init = function(self, device)
device:set_field(zigbee_constants.SIMPLE_METERING_DIVISOR_KEY, 1000, {persist = true})
device:set_field(zigbee_constants.ELECTRICAL_MEASUREMENT_DIVISOR_KEY, 10, {persist = true})
end
local do_configure = function(self, device)
device:refresh()
device:configure()
-- Additional one time configuration
if device:supports_capability(capabilities.energyMeter) or device:supports_capability(capabilities.powerMeter) then
-- Divisor and multipler for EnergyMeter
device:send(ElectricalMeasurement.attributes.ACPowerDivisor:read(device))
device:send(ElectricalMeasurement.attributes.ACPowerMultiplier:read(device))
-- Divisor and multipler for PowerMeter
device:send(SimpleMetering.attributes.Divisor:read(device))
device:send(SimpleMetering.attributes.Multiplier:read(device))
end
end
When executing the bind requets it gives a missing value error in the device_management.lua module, line 77.
This logs is from a driver that have the same code of the stock zigbee power meter
2022-01-16T15:48:35.980262670+00:00 ERROR Zigbee Switch Power Mc Caldera thread encountered error: [string "st/dispatcher.lua"]:229: Error encountered while processing event for <ZigbeeDevice: 92d80935-27ff-4d7f-ba4d-70ac7c0db9e7 [0xCCC5] (Caldera)>:
arg1: init
[string "st/zigbee/device_management.lua"]:77: Missing necessary values for bind request
2022-01-16T15:48:36.040540337+00:00 TRACE Zigbee Switch Power Mc Received event with handler _resync
2022-01-16T15:48:36.088176337+00:00 TRACE Zigbee Switch Power Mc Received event with handler device_lifecycle
If the device was already configured, there is no problem, but if the driver has to perform other actions in that function, it does not do them anymore and jumps from the do_configure function to the next function or method.
For example in my case driver have to restart a Timer too, which stops if the Hub is restarted and remains stopped.
I have seen it in two drivers, in one of them I can attach exactly what it was going to execute when the error occurs
In this line give ethe error:
---battery configure
print("Battery Config >>>>>>>>>")
device:send(device_management.build_bind_request(device, PowerConfiguration.ID, self.environment_info.hub_zigbee_eui))
2022-01-16T15:21:50.674286084+00:00 PRINT Zigbee Sensor v6 Battery Config >>>>>>>>>
2022-01-16T15:21:50.683695+00:00 ERROR Zigbee Sensor v6 A A A A Sensor thread encountered error: [string “st.dispatcher”]:229: Error encountered while processing event for <ZigbeeDevice: 94025b9a-c7ec-41ab-a333-ee180eef1c9a [0x67BC] (A A A A Sensor)>:
arg1: init
[string “st.zigbee.device_management”]:77: Missing necessary values for bind request
2022-01-16T15:21:50.759002834+00:00 TRACE Zigbee Sensor v6 Received event with handler _resync
This is the error that not reconfigure thepower and energy divisor and multiplier when the hub is reboot