I have a few Vera’s lying around and I wanted to migrate one to home assistant, and instead of going the tedious way of adding again all my zwave devices to a zwave stick, I decided to try and make a zwave-to-tcp device out of the controller, and connect home assistant to it.
zwave chip - ser2net - tcp port - ... ethernet ... - socat - serial device - home assistant
And guess what? It works great!
And only uses 18 mb of ram out of 128 on my edge and barely uses any cpu - and i probably can go lower than that.
You need to be able to ssh to the controller (the password is on the bottom of the unit). You need a home assistant already installed somewhere where you have root / can run socat.
I used a Vera EDGE with the latest firmware version:
"firmware_version": "1.7.2931" "zwave_version" : "4.5"
You can check this info by going to http://<vera_ip>/cgi-bin/cmh/sysinfo.sh
This should work on any Vera that has ser2net (afaik all of them have it), but if you have one that does not have it do
opkg update opkg install ser2net
On Vera: list all proceses
On Vera: kill all unnecesarry processes
Except the processes with [name] in command collumn above, kill everything. I only left
root 1 0.0 0.5 1360 652 ? S Sep28 0:13 /sbin/procd root 443 0.0 0.2 888 280 ? S Sep28 0:34 /sbin/ubusd root 444 0.0 0.1 768 212 ttyS1 Ss+ Sep28 0:00 /sbin/askfirst ttyS1 /bin/ash --login root 1877 0.0 0.5 1560 656 ? S Sep28 0:15 /sbin/logd -S 256 root 2234 0.0 0.5 1532 752 ? S Sep28 1:31 /sbin/netifd nobody 4334 0.0 0.4 964 508 ? S 23:12 0:00 /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf -k root 4637 0.0 0.3 1712 444 ? S 23:13 0:00 /usr/sbin/ntpd -n -p 0.openwrt.pool.ntp.org 1.openwrt.pool.ntp.o root 10059 0.0 0.3 1148 416 ? S 20:13 0:00 /usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p 22 root 30759 0.0 0.4 1212 536 ? Rs 23:05 0:02 /usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p 22 root 30935 0.0 0.4 1732 548 pts/0 Ss 23:05 0:00 -ash
everything else kill with
kill -9 id1 id2 id3 etc..
Id’s are the process id’s (2nd column on ps aux command), example usage:
kill -9 345 4689 4964 3458
On Vera: enable ser2net to allow network access to the zwave chip
ser2net -C "7676:raw:0:/dev/ttyS):115200 8DATABITS NONE 1STOPBIT"
this allows us to connect to the serial of the zwave chip on the vera and use it as a network-connected USB stick.
On Home Assistant - first ssh connection
install socat with “apt-get install socat” or whatever package manager your distribution has
start socat as root with (replace 126.96.36.199 with vera ip)
socat PTY,link=/dev/zwavevera,group=root,mode=777 TCP:188.8.131.52:7676
This will create a /dev/zwavevera serial connection. Leave the ssh connection open with socat running and start another ssh for next step.
On Home Assistant - second ssh connection
Stop home assistant in your preferred way (depending on installation method)
Edit configuration.yaml and add
zwave: usb_path: /dev/zwavevera
Start home assistant, wait for it to install openzwave (might take a while if zwave was not installed previously). Then, after the web interface is loaded, wait until all zwave devices are detected and identified - for me with 30-something devices it took about 5 minutes. If you have any battery-operated devices then wake them up.
After you’re content with the detection period go to hass configuration and restart it, to make it write the zwavecfg file.
If people are interested in this I can create two scripts to automate setting up vera (one for disabling vera default processes and another one for enabling them back).
Hope this at least gives you some ideas…