Deprecated: Function jetpack_form_register_pattern is deprecated since version jetpack-13.4! Use Automattic\Jetpack\Forms\ContactForm\Util::register_pattern instead. in /var/www/html/wp-includes/functions.php on line 6078 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-includes/functions.php:6078) in /var/www/html/wp-includes/feed-rss2.php on line 8 Docker – D Khaz https://khaz.me Things that I spend my time on... Thu, 08 Apr 2021 03:46:15 +0000 en-US hourly 1 https://khaz.me/wp-content/uploads/2018/05/DK_logo_square___100x100.png Docker – D Khaz https://khaz.me 32 32 147286311 Using a Z-Wave or ZigBee stick on Synology DSM for use with HomeAssistant and Docker https://khaz.me/using-a-z-wave-or-zigbee-stick-on-synology-dsm-for-use-with-homeassistant-and-docker/ https://khaz.me/using-a-z-wave-or-zigbee-stick-on-synology-dsm-for-use-with-homeassistant-and-docker/#comments Mon, 15 Apr 2019 04:13:53 +0000 https://khaz.me/?p=209 If you want to run or are already running HomeAssistant on your Synology NAS DSM 6.2, it’s possible that you’d want to use a Z-Wave or ZigBee stick to communicate with their respective devices. When I initially got my HA running in a docker on the NAS, I was disappointed when HA created errors when I configured the stick as I previously had it working on my previous docker host.  With a bit of digging, it turns out the Synology NAS was not recognizing the USB stick as a serial communication device.  This is because out-of-box, there are no cp210x drivers installed that are necessary for my combo Z-Wave/Zigbee stick.  Similarly, if you plan on using the Aeotec, you will need the cdcacm driver and Conbee will require ftdi_sio.  If you haven’t purchased your stick of choice yet, I’d recommend the GoControl stick as it does in one what the others do together, for less money than either of the other sticks.  (Disclaimer: I’ve only physically tested this on my combo stick, so if you run into issues or find other solutions, ping me so I can update this post)

While I’ve got a ton of Windows experiences (20+ year), a lot of Mac experience (10ish years), I’m basically a newb when it comes to Linux.  So for me, the next challenge was figuring out what/how the drivers would be packaged and how to obtain and install them.  After more time googling than I’d like to admit, I came across www.jadahl.com that is managed by Jumbotroll.  He has figured out how to create custom packages with drivers for most if not all versions of Synology hardware.  Feel free to drop him a donation through his paypal as his efforts shouldn’t go unnoticed.

Hardware:

  • GoControl Z-Wave + Zigbee HUSBZB-1 [ Amazon ]
  • Aeotec Z-Stick Gen5 [ Amazon ]
  • Conbee ZigBee gateway [ Amazon ]

Steps to get it working:

  1. Goto Jumbotroll’s website and download the drivers for your DSM version, currently 6.2 (make sure your DSM matches the minimum DSM version he has listed on the download page).
    You will need the model of your Synology hardware.  To get this, you can look at the box that you probably threw away, the receipt that buried in some email, or by SSH’ing into the NAS and running uname -a  which will output something like Linux Hyperion 4.4.59+ #23824 SMP PREEMPT Tue Dec 25 18:27:57 CST 2018 x86_64 GNU/Linux synology_broadwellnk_3018xs.
    Save the file to whatever device you will be running the commands from, in my case, it’s my Macbook.
  2.  Log into your DSM through the webpage (typically <LAN IP>:5000).  Open the Package Center, then click on Manual Install, and select the file you just downloaded on your local machine.  Click Next and install the package.
  3. Plugin the USB stick into the NAS and reboot it.
  4. If all goes as planned, you will have a working and recognized USB stick.

Integration into the HomeAssistant docker

  1. Find out which ports your USB stick is mounted to
    1. SSH into the NAS
    2. Execute dmesg | grep tty which will show you where the drivers were mounted
      [  188.836041] usb 1-3: cp210x converter now attached to ttyUSB0
      [  188.848238] usb 1-3: cp210x converter now attached to ttyUSB1

      Now you know it’s ttyUSB0  and ttyUSB1.
  2. Next, you need to add the mapping for these to your container.
    1. If you are starting your containers via docker-compose (and you should), edit your docker-compose.yaml file and add the following
      devices:
      - "/dev/ttyUSB0:/zwaveusbstick:rwm"
      - "/dev/ttyUSB1:/zigbeestick:rwm"
    2. If you are starting your containers via docker run, stop it and go learn about docker-compose.  If you are a masochist and hate change, then just add the following to your run command:
      --device /dev/ttyUSB0:/zwaveusbstick --device /dev/ttyUSB1:/zigbeestick
    3. Some users have reported errors that may require you to add --privileged  flag.

Configuring HomeAssistant

  1. Edit your configuration.yaml file and add the following:
    zwave:
      usb_path: /zwaveusbstick
      network_key: <your secret key here>
    zha:
      usb_path: /zigbeestick
      database_path: /config/zigbee.db

     
  2. Restart HomeAssistant and enjoy all the grief that Z-Wave + Zigbee can provide

Some troubleshooting steps

  1. SSH into the NAS and confirm it is recognized as a device by running lsusb -ciu :
    $ lsusb -ciu
    |__usb1          1d6b:0002:0404 09  2.00  480MBit/s 0mA 1IF  (Linux 4.4.59+ xhci-hcd xHCI Host Controller 0000:00:14.0) hub
      |__1-2         1a40:0101:0100 09  2.00  480MBit/s 100mA 1IF  ( ffffffe9ffffffbdffffffe9ffffffa4) hub
        |__1-2.4     10c4:8a2a:0100 00  2.00   12MBit/s 100mA 2IFs (Silicon Labs HubZ Smart Home Controller 312003D6)
       1-2.4:1.0      (IF) ff:00:00 2EPs ()
       1-2.4:1.1      (IF) ff:00:00 2EPs ()
  2. If you still do not see it, try searching in your  dmesg log for any other clues.
]]>
https://khaz.me/using-a-z-wave-or-zigbee-stick-on-synology-dsm-for-use-with-homeassistant-and-docker/feed/ 37 209