-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
availability_timeout prevents start #3191
Comments
The reason for this is that there are non existing entities on your Regarding the online state right after start, at this time zigbee2mqtt assumes that all devices are offline, however after one iteration of the availability timeout you should see the correct state. |
@Koenkk don't you mean online at startup? |
Does that mean that I have to put at least one ID/Friendly_Name in the whitelist and blacklist? As both lists try to get the ID of a NULL object in the original deviceAvailability.js and prevent zigbee2mqtt to start. In my opinion these lists can exist independently without having impact on the functionality.
@sjorge I see "online" as payload when starting a subscriber on a disconnected device |
@Jogobo can you share your |
Here you go...
I'm still testing with little devices before I start changing from Osram Lightify Gateway to zigbee2mqtt. |
I expect it to work when removing this from your configuration: availability_blacklist:
- '' |
Switched back to original deviceAvailability.js and removed
from configuration.yaml. Surprisingly zigbee2mqtt starts normal. Even when I remove
from configuration.yaml zigbee2mqtt starts. That was not the case yesterday. Only difference is that I now have 2 devices configured instead of only 1 device until yesterday. Strange... |
It's expected that it works after that (I only added a check to make sure the configuration is valid). Can I consider this issue fixed? |
I just checked with only availability_timeout set, no whitelist, no blacklist. It works now. |
Bug Report
What happened
When I set "availability_timeout" to a value greater "0" zigbee2mqtt refuses to start with the following log messages:
Mar 25 11:08:40 xxxx npm[16584]: /usr/local/zigbee2mqtt/lib/extension/deviceAvailability.js:34
Mar 25 11:08:40 xxxx npm[16584]: return settings.getEntity(e).ID;
Mar 25 11:08:40 xxxx npm[16584]: ^
Mar 25 11:08:40 xxxx npm[16584]: TypeError: Cannot read property 'ID' of null
Mar 25 11:08:40 xxxx npm[16584]: at DeviceAvailability.blacklist.settings.get.advanced.availability_blacklist.map(/usr/local/zigbee2mqtt/lib/extension/deviceAvailability.js:34:41)
Changing line 34 in deviceAvailability.js from
return settings.getEntity(e).ID;
to:
return ((settings.getEntity(e) === null) ? null : settings.getEntity(e).ID);
does the trick.
Line 39 needs to be changed the same way.
Though these changes get zigbee2mqtt working an unplugged device at startup time is shown as "online" as the logs show:
Mar 25 11:25:39 xxxx npm[18253]: ^[[32mzigbee2mqtt:info ^[[39m 2020-03-25 11:25:39: MQTT publish: topic 'zigbee2mqtt/<FRIENDLY_NAME>/availability', payload 'online'
Mar 25 11:25:49 xxxx npm[18253]: ^[[31mzigbee2mqtt:error^[[39m 2020-03-25 11:25:49: Failed to setup reporting for '<FRIENDLY_NAME>' - Error: Bind <FRIENDLY_NAME>/3 genOnOff from '<FRIENDLY_NAME>/1' failed (Error: AREQ - ZDO - bindRsp after 10000ms)
Mar 25 11:25:49 xxxx npm[18253]: at Endpoint. (/usr/local/zigbee2mqtt/node_modules/zigbee-herdsman/dist/controller/model/endpoint.js:235:23)
What did you expect to happen
Startup without errors and handling deactivated devices correctly.
How to reproduce it (minimal and precise)
Put "availability_timeout: 60" in configuration.yaml
Debug Info
zigbee2mqtt version: 1.12.0
The text was updated successfully, but these errors were encountered: