Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

enablePoll / disablePoll does not update the is_polled flag of full zwave payload #18

Closed
sjorge opened this issue Mar 15, 2019 · 10 comments

Comments

@sjorge
Copy link

sjorge commented Mar 15, 2019

While trying to solve #12 I was playing with enablePoll/disablePoll.

  • start zwave2mqtt with poll disabled for the value
  • send {"args":[{"node_id":4,"class_id":37,"instance":1,"index":0}]} to zwave/_CLIENTS/ZWAVE_GATEWAY-mosca/api/enablePoll/set
  • we now get the value every few seconds (frequency has no effect :()
    For the message received now this is the payload
{"value_id":"4-37-1-0","node_id":4,"class_id":37,"type":"bool","genre":"user","instance":1,"index":0,"label":"Switch","units":"","help":"","read_only":false,"write_only":false,"min":0,"max":0,"is_polled":false,"value":true}
  • (optionally disable poll again) send {"args":[{"node_id":4,"class_id":37,"instance":1,"index":0}]} to zwave/_CLIENTS/ZWAVE_GATEWAY-mosca/api/disablePoll/set

As you can see the polled message have is_polled set to false!

@robertsLando
Copy link
Member

robertsLando commented Mar 16, 2019 via email

@sjorge
Copy link
Author

sjorge commented Mar 16, 2019 via email

@robertsLando
Copy link
Member

robertsLando commented Mar 16, 2019 via email

@sjorge
Copy link
Author

sjorge commented Mar 19, 2019

This is still on my TODO to retest, but bit busy this week.

@robertsLando
Copy link
Member

robertsLando commented Mar 19, 2019 via email

@sjorge
Copy link
Author

sjorge commented Mar 21, 2019

I just had some time to test.

{"args":[{"node_id":4,"class_id":37,"instance":1,"index":0}]}

or

{"args":[{"node_id":4,"class_id":37,"instance":1,"index":0}, 0]}

Both enable the polling of the value but the flag is set to false

{"args":[{"node_id":4,"class_id":37,"instance":1,"index":0}, 1]}

Enables polling and the flag is then set to true as you said it would be.

All 3 variants do return a success message though 🤷‍♂️

@robertsLando
Copy link
Member

robertsLando commented Mar 21, 2019 via email

@robertsLando
Copy link
Member

@sjorge check the last commit and let me know if it fixes your problem 😄

@sjorge
Copy link
Author

sjorge commented Mar 22, 2019

That seems to work! But shoudn't the new code be moved up so that it is in the success branch of the if (err) ... above it?

@robertsLando
Copy link
Member

robertsLando commented Mar 23, 2019 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants