I have Home Assistant working fine on a Raspberry Pi. I have a remote system that will be in another building, but on the same LAN. I want to use Z-Wave on this remote system and control it from my HA install. In another thread I’ve had people tell me to use ZWaveJS2MQTT. I have it installed in a remote Linux system and can get to the control panel.
I’m using the ZWaveJS2MQTT wiki, but there are a number of points where I’m confused. For instance, when talking about using HA, I’m not clear if the settings would be for Z2M (for short) is communicating with HA on another system or if the settings are for Z2M when it is on a system running HA. I’m also not clear just what goes on with MQTT and HA.
I’ve installed the MQTT Broker in HA. If I get Z2M working properly on the other system, will the Broker in HA automatically discover the MQTT socket on the other system?
I basically have two systems that use MQTT, but I have no clue how to get them talking to each other.
you don’t need to use MQTT at all unless you want to.
Z2M can communicate with HA over websockets without using MQTT.
all you need to do is set up your HA to point to the IP address (and port but that’s usually standard unless you’ve manually changed it) of your Z2M install.
If I go that route, do I just use the broker on HA? And if I do, then how do I tell HA to listen to it as well as act as broker? I may just use finity’s way, but I’m thinking using MQTT would also be a good thing, in the long run, since learning that would teach me how to do it with other MQTT systems. (For instance, I know there’s an Insteon over MQTT setup out there and I might need to use that, too.)
That’s good news - I’ll have to look at that, too!
So what integration do I use on HA’s end for it to listen to Z2M?
You add the ZWaveJS integration ( NOT the add on ), then you tell it to use ws://IP-ADDRESS-OF-PI-RUNNING-ZWaveJS2MQTT:3000 and it will magically work.
I know I’m being really dense here, but on the HA end, I have ZWaveJS integration running and it has about a dozen devices on it, in my house. But I’m not sure where to enter the IP address. Looking at the options like Add Node and System Options, when I try them, I don’t see anything that allows me to enter a socket address.
So you already have ZWaveJS running and it has devices in it - if this is going to be separate from the “remote” ZWaveJS2MQTT instance, you will need to add a SECOND ZWaveJS to Home assistant and make sure you DO NOT tick the box that says “I am using the Home Assistant Addon”, it wwill then pop up with a screen asking for the URL - that box is where you type in the websocket URL.
On the Z2M control panel, under Home Assistant, be sure MQTT Discovery is off.
When configuring on the HA end, don’t use just the host name. It needs either the IP address or the FQDN. It’s on my LAN, so using WS://REMOTE-ZWAVE:3000 did not work. Using the IP address worked and using WS://REMOTE-ZWAVE.HOUSE.LAN (with my LAN using HOUSE.LAN for the domain) worked.
(I use a DHCP server and do reserve addresses for important computers, like my workstation, and a few others, but I much prefer being able to specify a system by hostname in case the IP address changes.)
Thank you, Andrew! That’s more than once you’ve helped me get something up and running.
(I am taking notes on these things and want to post write-ups for them that’ll include keywords that’ll make them easy to find.)
Presumably you are running ZWaveJS2MQTT on the Remote Pi using docker. If that’s the case - this is the script I use every month to automatically update it so when the latest Home Assistant update comes out and wants the ZWaveJS server to be a minimum API schema, the Docker container is already running the server with the latest schema.
This will run the script docker_container_updater.sh at 9 minutes past 13 (1pm) on the 2nd of the month (it is always updated on the 1st)
The actual script:
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower --run-once --cleanup --include-stopped
This will pull the latest images for every docker container, including the ones which aren’t running. It will remove the old container images for ones it has updated.
If you want more configuration over it - there is more info here: Arguments - Watchtower
Hope this helps with your installation and your guide.
I just downloaded and unzipped Z2M, since I don’t have Docker on that system and didn’t want to bother installing it. I found a few issues with what was in the Wiki on Z2M and am in touch with the developer behind it to get those fixed.
I tried to build it with yarn. If possible, I was hoping I could put Z2M on my MacMini down in the barn, but I can’t get yarn to work - it keeps saying it can’t find “install.” So, for now, I’ve just unzipped Z2M and I’m using that. (The binary works fine on Debian, but doesn’t work on Raspbian. So I need to wait until that’s resolved to include that info, which I think is important, in any write-up I do.)
The update scripts are a good idea and I’ll see how I have to adapt the one on the remote system since I’m not using Docker.
Also, right now, I just ran Z2M on my Debian system. I’m going to also be setting it up as a service so it starts on boot and is restarted if it crashes.
There have been many threads on here where something automatically updated and it broke something but the user had no idea it was the update that caused it.
I would take the extra time needed to do manual updates than to have something break with an auto update and then spend potentially way more time trying to troubleshoot the problem while the system is dead in the water.
I guess I’ve been spoiled by Debian - used it for years with auto-update setup and never had an issue. And for the past 4 years, I’ve been on rural internet, so doing updates in the background was a help - I didn’t start something and have to wait for a long time for it to download. Also, with updates set, it was downloading smaller amounts of data at a time, which works much better on crappy internet than trying to download a lot in one shot.
So how often do you do updates? Maybe once a month?
Usually. Especially for things closely related to HA since that is the release cycle.
For a lot of things I rarely update if things still work. Every once in a while I’ll realize I haven’t updated things in a while and I’ll go thru them at that point and get them all done at once.
I still haven’t updated my Debian 9 yet. TBH, I’m really nervous about doing it and having things crash on me if something goes wrong since it runs all of my HA ecosystem. It would be moderately painful to have to rebuild everything even with backups.
I’m using HA on a USB drive (since SD cards get trashed so easily), with an HAOS image on the drive. I decided I’d rather have this on it’s own box for the reasons you cite - I don’t want something else bringing down HA.
I have mixed feelings about updates - do them as they come out or do them in groups? But, as I mentioned, with rural internet (until SpaceX finally says, “Hey, you can have Starlink now!”), it’s much easier to do them individually. A few weeks ago I updated one two Raspian systems and I got error after error because I could not keep a solid connection long enough for apt to download all it needed. (I know there are ways to download them individually and do offline upgrades - I honestly didn’t feel like doing the research on that because I had other things to do. It was frustrating but easier to just keep restarting it until it finally worked.)
The system now running Z2M will be running a CNC system in a few months, as part of a new business. I was hoping it might be possible to run Z2M on my Mac - that’s why I was trying to download the files from GitHub and build it with yarn. If I could build it on Linux, then I figured I’d try and see if I could build it on a Mac, using brew to add whatever common tools from Linux I might need. I’d rather keep the CNC and Z2M on separate systems. (I may end up putting Z2M on an older Pi3 - but if that’s all it does, even for a Pi, that’s under-usage.)
It doesn’t matter. Every Major Home Assistant release wants a newer version of the ZWaveJS Server, than the previous version. So it’s going to break either way. Either I update Home Assistant and then ZWave breaks until I update the ZWaveJS2MQTT container. Or I update the Container, which hasn’t yet broken anything and Home Assistant will continue along happily until I get round to updating it (and I don’t usually update it until the first point release comes out after the major version)
@mobile.andrew.jones pointed that out. Once I understood that, and he told me how to start ZWaveJS on HA with a 2nd integration of it, I got the two systems communicating with very little work.
My frustration now is NOT HA related - I got it working, but today is my day off, with several fun things set up, so once I got that working, I didn’t have time to get the computer down to the barn and start connecting Z-Wave devices! I’ll get to it tomorrow, but I don’t like having to wait once I finally get them working!
Yeah. How many times can you turn the lights and fans on and off before you wonder why there’s nothing else you can do!
I can’t rush to this, but I’m eager to get drapes working in the rec room where we have a nice home theater setup. I’ve wanted a nice home theater system since I was in my 20s and it’d take a 16mm projector to do something like that! We have 4 large windows in that room. Three will have “normal” drapes in front of them. The 4th will have a valence at the top and different drapes.
When I push the button all the drapes will close. What makes the 4th different is that once it closes, the 135" screen will roll down from behind the valence (where it was hidden). Then, after it’s down, and while the 4K projector is warming up, the drapes will open again on that window, but now, instead of the window, will be the video projection screen.
Now will that be a theater like experience or what?
But even with something as cool as that, how many times can I start that and close it all down before it gets tiring? True, it’ll still be a thrill for me for a long time to be able to start a movie that way, like we’re in a rea theater, but none of it is something you can just play with.
It’s like when you buy a new car and have fun driving it around, but then you have to park it in the driveway or garage and you can’t play with it during dinner or when you’re in the house!
Yes, I did get problems til WS-server with HA 2021.10 update, stopped working.
Z-wave of IP will not work anymore. Used RPi3 with WS-server.
In HA there is this error on Z-Wave JS module:
“Retrying setup: Z-Wave JS Server version is incompatible: 1.10.3 a version is required that supports at least api schema 10”.
So I assume the WS-server has to be updated. I have now swithced to MQTT instead for the Zwave-over-IP. Maybe this will make the setup easier and more redundant with HA-updates in the future?