zwave-js / zwave-js-ui

Full featured Z-Wave Control Panel UI and MQTT gateway. Built using Nodejs, and Vue/Vuetify
https://zwave-js.github.io/zwave-js-ui
MIT License
970 stars 204 forks source link

Controller status is "Unknown state". #3891

Closed kpine closed 1 month ago

kpine commented 1 month ago

Checklist

Deploy method

Docker

Z-Wave JS UI version

9.18.1.fe0ba05

ZwaveJS version

13.2.0

Describe the bug

The controller state is shown as "Unknown state".

image

To Reproduce

No steps.

Expected behavior

Correct state is shown.

Additional context

Driver itself gives an inclusion state, so it must be down to how ZUI is calculating it.

const { logger, zwaveClient, require } = this
logger.info(`Controller inclusion state: ${driver.controller.inclusionState}`);

Output at time of UI "Unknown state" is:

Sep 13 10:25:04 zui[302191]: 2024-09-13 10:25:04.325 INFO Z-WAVE: Calling api driverFunction with args: [
Sep 13 10:25:04 zui[302191]:   'const { logger, zwaveClient, require } = this\n' +
Sep 13 10:25:04 zui[302191]:     'logger.info(`Controller inclusion state: ${driver.controller.inclusionState}`);',
Sep 13 10:25:04 zui[302191]:   [length]: 1
Sep 13 10:25:04 zui[302191]: ]
Sep 13 10:25:04 zui[302191]: 2024-09-13 10:25:04.328 INFO Z-WAVE: Controller inclusion state: 0
Sep 13 10:25:04 zui[302191]: 2024-09-13 10:25:04.329 INFO Z-WAVE: Success zwave api call driverFunction undefined

0 is InclusionState.Idle.

robertsLando commented 1 month ago

I think this is due to the change with controller events, I forgot to init the value as before the only way I had to get updates of the inclusion state was to use an interval. Fixing it asap