zwave-js-ui icon indicating copy to clipboard operation
zwave-js-ui copied to clipboard

Using zwave-js-ui Inside A Standalone Node Application

Open patrolport opened this issue 1 year ago • 5 comments

Hello!

We were hoping somebody could point us in the right direction after hours of searching. We have the ZW JS UI setup through a browser and are able to connect to our ZW devices and interact with them.

What we need to do is get callbacks on certain events (i.e. window opened, loss of connection, etc.) directly in our node application. We were able to get this to at least run using the non UI version of zwave-js, but how do we use the UI version inside our node application which already has the ZW devices setup and configured?

Thank you very much

patrolport avatar May 10 '24 05:05 patrolport

Using mqtt? https://zwave-js.github.io/zwave-js-ui/#/guide/mqtt

robertsLando avatar May 10 '24 06:05 robertsLando

Okay, thank you. Is this the best way to do it?

Originally, we wanted to use zwave-js directly in one single application (combine zwave-js with our existing application). We then thought it would be good to utilize the UI version as well which is why we were thinking of doing everything directly in our application and then just also have a web UI to work with for the first time setup.

Appreciate the help and quick response!

patrolport avatar May 10 '24 06:05 patrolport

Okay, thank you. Is this the best way to do it?

I think it is, you are not the only one doing this, Jeedom does the same: https://doc.jeedom.com/en_US/plugins/automation%20protocol/zwavejs/ (and maybe other that I'm not aware/don't remember)

The alternative is to enable websocekt server in option and use it's api: https://github.com/zwave-js/zwave-js-server

robertsLando avatar May 10 '24 13:05 robertsLando

Thank you, appreciate the info. We are thinking the MQTT solution should work. If not, we will look into websockets.

One problem is needing a broker to interact between zwave-js-ui and our application. After doing some research, it appears using Aedes as a broker and the mqtt module as a client in the same application would be the best route to interact with zwave-js-ui from our application.

Thank you for your help!

patrolport avatar May 10 '24 14:05 patrolport

@patrolport Yeah that could be an easy solution to have an "all in one" application :)

robertsLando avatar May 13 '24 07:05 robertsLando

This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this issue entirely you can add the no-stale label

github-actions[bot] avatar Aug 12 '24 00:08 github-actions[bot]