Installing Home Assistant on Pine64 + Z-wave (IoT kit) without HassIO (i.e. manually)

tl;dr Tried to install HA on Pine64 IoT kit with zwave. z-wave failed to work with Hassio on dietpi. z-wave failed to work with manual install on dietpi. Worked with manual install on longsleep’s ubuntu xenial image. Highly recommend manual setup instead of hassio. Highly recommend OpenZWaveControlPanel.

I bought a Pine64 + with z-wave radio and for a long time I used OpenHAB. It worked fine. I connected all my z-wave lights and even made it work with HomeKit. But I wasn’t satisfied because it couldn’t connect it to my door/window sensors, motion sensors and most importantly (to me) my garage controller. At the time the garage controller was a z-wave secure inclusion retstriction. I used SmartThings for my secure z-wave devices. openhab z-wave plugin didn’t have secure inclusion but they have apparently since fixed that. But the openhab homekit still doesn’t work with anything but lights, switches and thermostats. I found out that homeassistant had the best homekit coverage and thus began my journey. I tried to install Hassio using this page: Hass.io install on PINE64+ and it didn’t work out. I think it’s because I couldn’t figure out how to mount the z-wave hardware onto the hassio containers. I tried a manual setup with dietpi and that too failed. I did however make this work with the ubuntu image. Here are my instructions:

  1. Install ubuntu using this link. Do the resize and the updates it suggests. http://wiki.pine64.org/index.php/Pine_A64_Software_Release#Xenial_Base_Image_.5B20161218-1.5D_by_longsleep

  2. apt-get install libudev-dev (required by z-wave module later but not included in instructions)

  3. apt-get install libffi-dev (required for python installation but not included in instructions)

  4. I also updated the resource limits because I got resource unavailable exceptions during my experiments. if you get these errors, see if increasing the limits of one or more of these helps. I’m not sure if it’s a wise idea to let these limits remain high

  5. ulimit -u 20000 (earlier 7800)

  6. ulimit -l unlimited (earlier 64)

  7. ulimit -n 10240 (earlier 1024)

  8. Install latest version of python. Follow instructions here: https://tecadmin.net/install-python-3-7-on-ubuntu-linuxmint/

  9. my zwave radio was available at ttyS2 and could be accessed by group tty. there were other ttyS* devices and one was accessible by dialout. My output of ls -ltr /dev/ttyS* earlier returned this:

crw-rw---- 1 root dialout 4, 67 Feb 22 21:54 /dev/ttyS3

crw–w---- 1 root tty 4, 66 Feb 22 21:54 /dev/ttyS2

crw–w---- 1 root tty 4, 65 Feb 22 21:55 /dev/ttyS1

crw–w---- 1 root tty 4, 64 Feb 22 21:55 /dev/ttyS0

I ran sudo chmod g+rw /dev/ttyS2 and then it became like so:

crw-rw---- 1 root dialout 4, 67 Feb 22 21:54 /dev/ttyS3

crw-rw---- 1 root tty 4, 66 Feb 22 21:54 /dev/ttyS2

crw–w---- 1 root tty 4, 65 Feb 22 21:55 /dev/ttyS1

crw–w---- 1 root tty 4, 64 Feb 22 21:55 /dev/ttyS0

See how the S2 now has crw-rw now? That’s where they say you need it to be. If that command doesn’t do it for you, google around and figure it out. I saw this on: https://www.home-assistant.io/docs/z-wave/installation/ in the troubleshooting section. I honestly don’t know if it will fail without. Just do it.

  1. You should probably create a new user (such as homeassistant) that will run the HA in the python virtual environment. This new user has to be added to the group that has access to the zwave radio (tty in my case): sudo useradd -rm homeassistant -G dialout,tty (I added to dialout too because other devices used that group)
  2. Install homeassistant using these instructions but start from the part where it says ‘cd /srv’: https://www.home-assistant.io/docs/installation/raspberry-pi/. We’ve already installed the python and created (or not) a user and added them to the right group. I would advise you run the hass command to once see if it booted up and then kill it and setup auto start.
  3. I went further then to setup autostart here: https://www.home-assistant.io/docs/autostart/systemd/. Obviously I copied the contents of the python environment and replaced ‘YOUR_USER’ with ‘homeassistant’. For the systemctl commands to enable the service I think they missed adding a ‘.service’. So it should be ‘systemctl enable [email protected]’. After that: systemctl start [email protected]
  4. Optional. When HA starts it’ll show you the “onboarding” screen. You enter the password once! so if you fat finger it and forget the password you can delete the auth credentials and start over (Yes, i did it): rm /home/<YOUR_USER>/.homeassistant/.storage/auth*
  5. After creating your user name and password and logging in, go to configuration-> integrations ->z-wave and click on the configure button. This will start installing the python package homeassistant-pyozw and it takes forever! You can see the process running if you run htop (apt-get install htop). If you want you can try pip3 install homeassistant-pyozw before clicking that “configure” link.
  6. Once it completes you’ll see that it’s offering you a window to type the path of the device. It was /dev/ttyS2 for me. Leave the network key blank for it to autogenerate the key. This step failed for me when I repeated the entire process on dietpi. I don’t know why.
  7. I actually had been trying to get this to work with dietpi and hassio and was failing. This had worked for me with openhabian and so I also installed openhab on this ubuntu image before installing HA to check that the z-wave radio worked or not. I think a better thing to do is to install OpenZWave Control Panel. This is an amazing tool that lets you add/remove devices in a UI that is better meant to handle zwave radios. I followed the instructions here for this: https://deviant.engineer/2016/09/hass-dietpi/ I only followed steps 3 and 4 because I didn’t want to mess with my working HA setup! You may have to do some additional setup before this. See the github page here: https://github.com/OpenZWave/python-openzwave. I added my lights and switches using this, exited the process and then started home assistant, which then loaded all the devices like magic. Garage door had to still be done using HA. The tool probably couldn’t handle the multiple z-wave entities this single device creates.

Hope this helps.

1 Like