zwave-js / node-zwave-js

Z-Wave driver written entirely in JavaScript/TypeScript
https://zwave-js.github.io/node-zwave-js/
MIT License
750 stars 599 forks source link

Openzwave shared migration #1067

Closed robertsLando closed 3 years ago

robertsLando commented 4 years ago

This issue will collect some Q/A about the migration from OZW shared and this library

robertsLando commented 4 years ago

Lifecycle:

The lifecycle of a node in zwavejs is:

  1. node added
  2. node alive/awake
  3. node ready
  4. interview completed

A node is ready once we know it is not dead and we have all the necessary information. That is:

While a node is being interviewed, a bunch of queries are made and you'll either see value added or value updated as well as some metadata updated events. This interview starts once a node is either awake or alive and after it was included.

Once ready, it is safe to interact with the device, since all values are at least cached. It does not mean that the values are up to date though. In theory, associations could change (if you control the device with another driver while zwave-js is off). neighbors are usually updated at the very end of the interview, so you should wait for interview completed there.

robertsLando commented 4 years ago

In openzwave-shared each valueId was identified by <nodeId>-<cmdClass>-<instance>-<index> Ex: 1-112-0-0

In zwavejs a valueid is identified by (https://zwave-js.github.io/node-zwave-js/#/api/valueid):

interface ValueID {
    commandClass: CommandClasses;
    endpoint?: number;
    property: number | string;
    propertyKey?: number | string;
}
AlCalzone commented 3 years ago

@robertsLando do we still need this?

robertsLando commented 3 years ago

Nope