-
Notifications
You must be signed in to change notification settings - Fork 113
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
How to monitor the intermediate states during a command for value change ? #163
Comments
It seems we can get some information by enabling the OZW configuration option "NotifyTransactions":
In such case, we get some feedback via the 'notification' event:
I tried with my Fibaro light dimmer ; after requesting a change of the 'level' value, I get two notifications:
Notes:
==> it seems there is no way in the API to bind a call to an OZW action (like 'setValue') to a transactionID and get this ID back in the notification when the action is finished, to make the link. This seems not possible even in the openzwave library itself. ==> That smells like a hell to be able to reliabily trace the (asynchronous) results of the commands trigerred, especially in case multiple commands are sent in parallel to the same node. Any thought about that ? Thanks in advance. |
This is a known issue about OpenZWave and there's no easy way around it. Some ZWave devices don't even bother to report a manual status change, and you need to enable polling on them. I believe the protocol per se does not allow passing user data within a request, so the only way you can correlate a request and the status change is by some sort of FSM. I've done some work recently using the machina.js library and I think I can hack together a small demo in the following days. |
thanks for your answer.
Just some questions/remarks:
- zwave being a reliable protocol, i suppose the controller should receive
at least a 'techical acknowledgment' frame from the device, to state that
the request frame has been well delivered (and so, no re-sending is
needed). Even if this is not as complete as a 'ack message' that the action
itself has been well performed (typically a value change), this could be a
first info, no?
- unless i'm mistaken, the "transaction id" i see in the logs is present in
one of the bytes that are 'sent' (again, according to the logs). no?
Le 28 avril 2017 7:08:35 PM Elias Karakoulakis <[email protected]> a
écrit :
… This is a known issue about OpenZWave and there's no easy way around it.
Some ZWave devices don't even bother to report a manual status change, and
you need to enable polling on them.
If you're updating UI values then you're better off subscribing to value
change events.
I believe the protocol per se does not allow passing user data within a
request, so the only way you can correlate a request and the status change
is by some sort of FSM. I've done some work recently using the machina.js
library and I think I can hack together a small demo in the following days.
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#163 (comment)
|
@ekarak Did you ever manage to hack together a state machine to match received notifications to issued commands? I would very interested. |
FYI, I raised the question in openzwave google group: https://groups.google.com/forum/#!topic/openzwave/QSNaRe8JHLc |
Hi,
first, thanks for this usefull library.
I'd like to send zwave commands and associate JS promises, being resolved/rejected according to the real feedback provided by the zwave network.
When testing, I set a value (the 'Level' value of a Fibaro FGD212), i get lot's of logs displayed by the zwave driver ; here is a summary (full logs are available at the end of this post):
1- queuing the command,
2- sending it,
3- ensure it is delivered to Z-Wave stack,
4- a callback ID (here 0xc2)
5- a confirmation that the expected callbackId was received
6- finally, a message with the new value
For all those summarized steps, I have no feedback on Javascript side, only for the last one (number 6), using an event ''value changed'
I wonder to be able to get more intermediate notifications (for steps 1 to 5, but especially during step 5, which looks the best step to resolve/reject my 'changeValue' promise).
Is there a way to get them ?
Thanks in advance.
full logs:
The text was updated successfully, but these errors were encountered: