OpenZWave / node-openzwave-shared

OpenZWave addon for Node.js (all versions) including management and security functions
Other
199 stars 113 forks source link

Sleeping nodes do not update #249

Open dillw opened 5 years ago

dillw commented 5 years ago

When the openZwave program is started and nodes are sleeping, no update event will be fired unless the node is reset and the node sends all info including all command classes.

From the log it can be seen that openZwave sees the value update but does not fire an event since it does not have the command class registered.

Is there a way to fire an event for value change even if the node has been asleep (no command class set)?

Logs: . . . 2018-10-03 22:00:54.858 Info, Node003, WARNING: ZW_SEND_DATA failed. No ACK received - device may be asleep. 2018-10-03 22:00:54.858 Info, Node003, Node 3 has been marked as asleep 2018-10-03 22:00:54.858 Info, Node003, Node not responding - moving QueryStageComplete command to Wake-Up queue 2018-10-03 22:00:54.858 Detail, Node003, Notification: Notification - NoOperation 2018-10-03 22:00:54.858 Detail, Node003, Notification: Notification - Node Asleep 2018-10-03 22:00:54.858 Detail, Node001, Query Stage Complete (Neighbors) 2018-10-03 22:00:54.859 Detail, Node001, AdvanceQueries queryPending=0 queryRetries=0 queryStage=Session live=1 2018-10-03 22:00:54.859 Detail, Node001, QueryStage_Session 2018-10-03 22:00:54.859 Detail, Node001, QueryStage_Dynamic 2018-10-03 22:00:54.859 Detail, Node001, QueryStage_Configuration 2018-10-03 22:00:54.859 Detail, Node001, QueryStage_Complete 2018-10-03 22:00:54.859 Warning, CheckCompletedNodeQueries m_allNodesQueried=0 m_awakeNodesQueried=0 2018-10-03 22:00:54.859 Warning, CheckCompletedNodeQueries all=0, deadFound=0 sleepingOnly=1 2018-10-03 22:00:54.859 Info, Node query processing complete except for sleeping nodes. 2018-10-03 22:00:54.859 Detail, Node001, Notification: NodeQueriesComplete 2018-10-03 22:00:54.860 Detail, contrlr, Notification: AwakeNodesQueried 2018-10-03 22:01:10.072 Detail, Node002, Received: 0x01, 0x0f, 0x00, 0x04, 0x00, 0x02, 0x09, 0x71, 0x05, 0x00, 0x00, 0x00, 0xff, 0x06, 0x16, 0x00, 0x64 2018-10-03 22:01:10.073 Detail, 2018-10-03 22:01:10.073 Info, Node002, ApplicationCommandHandler - Unhandled Command Class 0x71 2018-10-03 22:01:10.090 Detail, Node002, Received: 0x01, 0x0a, 0x00, 0x04, 0x00, 0x02, 0x04, 0x30, 0x03, 0xff, 0x0a, 0x31 2018-10-03 22:01:10.090 Detail, 2018-10-03 22:01:10.090 Info, Node002, ApplicationCommandHandler - Unhandled Command Class 0x30

Seems to be same issue as #46 but no solution was mentioned besides resetting nodes.

ekarak commented 5 years ago

Unhandled Command Class 0x30 but I see that this command class is now supported: http://www.openzwave.com/dev/classOpenZWave_1_1SensorBinary.html

What version of the OZW lib do you have?

sim51 commented 5 years ago

I have exactly the same behaviour, and I'm using the latest OZW (I'm directly on the master from the repo)

sim51 commented 5 years ago

The problem comes from the test2,js script.

It assumes that after the network scan it will discover all the device and be able to fulfil all the device information. Or if you have a sleeping device, this one will not send its info, so the device will never be ready

To resolve this, I have done the following modification in the script :

So now, If I configure ozw to save the network state, even after restart, I will receive the sleeping device events.

I hope this can help people !

PS: Do you want a PR on the script with my modifications ?

robertsLando commented 5 years ago

@sim51 can you make a PR and link it here so I can check your changes?

robertsLando commented 4 years ago

@sim51 Any news?

sim51 commented 4 years ago

I don't have the code on my laptop anymore ... but I can try to redo it