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

More detailed README

Open f45tb00t opened this issue 3 years ago • 11 comments

Hello,

actually I am reinstalling everything from scratch. Prior I used OZW Beta on a PI, now I have new hardware and I would like to use Z-Wave JS. I am using the Core Version of HA in a venv just to have more flexibility and to have a better learning progress.

Unfortunately the RTFM is not very detailed about the prerequisites. Since I read a whole load of Threads in different forums where ppl are struggling with issues installing or where and how to start.

If you do this things on daily basis it's just a fast shot to implement it. But when you never did that before, a damn lot of research is needed. Surely good for the learning effect, but as we all have work, families and stuff, it will be kinda hard to get this stuff running at first glance

So let me kindly ask for some more details about the whole process. I am quite sure this won't only help me, but a lot of other folks. Writing the RTFM is most likely done in 5-10 minutes, but will save thousands of hours of research for the ppl. Surely no 100% step by step is needed, but a little more details would be awesome.

Most likely like:

  1. dependencies -> install npm? Just npm? Thats it?
  2. "ts-node src/bin/server.ts /dev/tty0" My assumption is its the address to the z-wave stick
  3. nice to have/know: security implications and hardening.

Cheers

fastboot

f45tb00t avatar Apr 22 '21 06:04 f45tb00t

@f45tb00t your point is fair about it not being very obvious from the README about how to run this locally. The reality is that the majority of users are running this via a Home Assistant addon, or a Docker container, so it hasn't been a priority to improve the installation instructions. I can try to answer your questions, and we would welcome a PR if you want to help fill in the gap.

  1. You need node.js which comes with npm (package manager). There are other dependencies, but once you have node installed, go into the directory and run npm install . to install the dependencies locally
  2. Your assumption is correct
  3. If you run this from source, there is no security within your LAN - communication with the server is unencrypted and no auth is required to connect. If you run this using the addon or a Docker container, you have more control over port access and can "secure" the connection that way if it's a concern.

raman325 avatar Apr 23 '21 16:04 raman325

@raman325 With some help from your comment I managed to get Z-wave JS server running.

Any suggestions on how to increase the security, if even possible? I run Homeassistant in a LXC container and am not using the Docker option.

Thank you!

Ramshield avatar Jul 12 '21 19:07 Ramshield

LXC

The only thing you could do is control access to the container at the network level. If your router supports it, you can add firewall rules to reject any traffic to that port that doesn't come from your Home Assistant instance. If your HA instance is also in an LXC container, I would imagine that LXC has a similar concept as Docker in being able to define a private network that HA and Z-Wave JS can communicate on rather than exposing the websocket port to your entire LAN.

raman325 avatar Jul 12 '21 20:07 raman325

These installation instructions make enormous assumptions of knowledge that most people dont have. I have npm installed, but not a clue of what to do next. Is it too much to ask for some simple instructions?

alabamatoy avatar Sep 23 '21 20:09 alabamatoy

These installation instructions make enormous assumptions of knowledge that most people dont have. I have npm installed, but not a clue of what to do next. Is it too much to ask for some simple instructions?

There are effective ways to ask, like the OP did, and your approach is definitely not one of them. See my comment here for more context as to why these instructions aren't more comprehensive: https://github.com/zwave-js/zwave-js-server/issues/203#issuecomment-825766754 . Also, if you have no understanding of how npm works nor a way to learn how it works, this is not the right installation method for you. We don't want to have to support it when something breaks because then we are troubleshooting the steps you took instead of the server itself.

A quick search on Docker Hub shows plenty of results there if a Docker container is easier for you to get up and running: https://hub.docker.com/search?q=zwave-js-server&type=image (I recommend this one: https://hub.docker.com/r/kpine/zwave-js-server)

raman325 avatar Sep 24 '21 02:09 raman325

Respectfully, I want to learn, but I also want to focus on other things than npm and node.js and docker. What's wrong with some simple instructions, copy this here, run that, etc? I am willing to assist and be a test mule, but y'all are acting all secretive about it.

alabamatoy avatar Sep 24 '21 11:09 alabamatoy

There is no intent to be secretive, my comment clearly states that this hasn't been a priority. The piece about things being unsupported is another reason why it hasn't been a priority, but there's nothing to hide given that this is a public repo with a published public npm package. I added the link to the NPM package referenced in the meantime, hopefully that ~~happens~~ EDIT: helps.

raman325 avatar Sep 24 '21 12:09 raman325

So I got it running in a Saltstack state. I'd be happy to share that with you @alabamatoy. It isn't perfect, but it might help you get on the right track. I don't have time to write a elaborate how-to at the moment. Contact me by e-mail (it's in my profile) if you'd like. If you don't know Saltstack I can give you the manual steps as well.

Ramshield avatar Sep 24 '21 13:09 Ramshield

Alright, I was like f*ck it and translated my Saltstack back to bash, it might not work 100%, but feel free to give me a shout!: https://github.com/zwave-js/zwave-js-server/pull/391

Ramshield avatar Sep 24 '21 14:09 Ramshield

@raman325 With some help from your comment I managed to get Z-wave JS server running.

Any suggestions on how to increase the security, if even possible? I run Homeassistant in a LXC container and am not using the Docker option.

Thank you!

Would you be so kind as to share how you got it working in your LXC? I am in the same boat and can't get it installed. TY

ac2323 avatar Dec 27 '21 19:12 ac2323

@ac2323 Please see #391, even though it was never merged is shows the changes to the README which might help, if not, please feel free to contact me.

Ramshield avatar Dec 27 '21 19:12 Ramshield