Skip to content
This repository has been archived by the owner on Dec 28, 2022. It is now read-only.

Submitting commands before startup completes will remove devices list #74

Closed
danielwegener opened this issue Nov 17, 2019 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@danielwegener
Copy link

danielwegener commented Nov 17, 2019

I experience a weird behaviour where my zigbee devices list is always empty after a restart and my device db simply gets all devices attached but never finds "old" devices.
I've debugged the session and I think the following is happening:

  • I have a mqtt listener that translates mqtt states as commands. Some of these states are retained and are automatically sent as soon as the mqtt node is online
  • Now, the zigbee command node receives commands before the controller is fully started
  • This leads to a case where herdsmens Device.loadFromDatabaseIfNecessary is called before Controller.start() and internally Entity.injectDatabase(this.database); is called which will initialize the Entity with an empty object.
  • Therefore no Coordinator can be found at startup and a new one is created on each restart

Unfortunately herdsmen does not throw an exception or something (I think it should either delay commands until the startup finishes - or reject them), but a "user friendly" (or at least understandable) measure would be to prevent commands (drop or fail them) until herdsman is started.

Environment:


    "node-red-contrib-zigbee": {
      "version": "0.16.1",
      "resolved": "https://registry.npmjs.org/node-red-contrib-zigbee/-/node-red-contrib-zigbee-0.16.1.tgz",
      "integrity": "sha512-kPOsJ4hIrwgNwgfi71AovSudB0dwkieZdHDJJ+THroB36RnxAdrSm1/1eOgGpaYpzBT2IxsVYyBVSeeFCH73FA==",
      "requires": {
        "debug": "^4.1.1",
        "mkdirp": "^0.5.1",
        "obj-ease": "^1.0.1",
        "vis": "^4.21.0",
        "zigbee-herdsman": "0.12.4",
        "zigbee-herdsman-converters": "^11.1.41"

@danielwegener danielwegener changed the title Submitting commands before startup will remove devices list Submitting commands before startup completes will remove devices list Nov 17, 2019
@hobbyquaker hobbyquaker added the bug Something isn't working label Nov 17, 2019
@danielwegener
Copy link
Author

Thanks, 0.16.3 works for me!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants