Installing Home Assistant with Docker on a Synology NAS with support for Z-wave and Bluetooth

Hi guys,

I’ve been a happy Home Assistant user, running Home Assistant on my Synology Diskstation NAS for most of 2016 now. After trying the custom Synology Package installation and having to fluff around with Python packages etc, I finally bit the bullet and used Docker to install Home Assistant.

For those interested, I’ve written a guide with the commands to use, and there’s a couple of walkthrough videos as well. If you have any questions, please let me know!

Nice guide! For what it’s worth, I was able to get everything going in Synology & Docker without using the command prompt. This includes running Z-Wave, too. I created a Synology Docker config file, so getting the container running is as easy as Settings->Import. It makes upgrades super simple, too. If you are interested, let me know.

Nice one! I wasn’t sure if this feature supported some of the commands needed like host etc.

I’m pretty confident with the command line, but would love to see your config file incase someone else finds them useful!

Here is what I came up with that works for me. I would have attached it, but JSON is not an allowed extension. :frowning:

You’ll want to save this as something like hass.json and edit the following:

  • “image” should contain the image in your repository. I understand Synology has a bug in it where the UI won’t pull the correct tags. I actually wrote a work-around for that which I posted here.

  • “devices” should be your zWave path

  • “volume_bindings” are your volume mappings. I saw someone mapped the local time; I should probably add that, too.


    {
  "cap_add": [
    
  ],
  "cap_drop": [
    
  ],
  "cmd": "",
  "cpu_priority": 0,
  "ddsm_bind_share": "",
  "devices": [
    {
      "device": "\/dev\/ttyACM0"
    }
  ],
  "enable_publish_all_ports": false,
  "enable_restart_policy": true,
  "enabled": false,
  "env_variables": [
    
  ],
  "exporting": false,
  "id": "876b1ad029ac7729dbfc0125832fee0256cae6ebaad7574a3d40929d9553b042",
  "image": "homeassistant\/home-assistant",
  "is_ddsm": false,
  "is_package": false,
  "links": [
    
  ],
  "memory_limit": 0,
  "name": "homeassistant-latest",
  "network": [
    
  ],
  "port_bindings": [
    
  ],
  "privileged": true,
  "shortcut": {
    "enable_shortcut": false
  },
  "use_host_network": true,
  "volume_bindings": [
    {
      "host_volume_file": "\/docker\/hass\/config",
      "mount_point": "\/config",
      "type": "rw"
    },
    {
      "host_volume_file": "\/docker\/hass\/scripts",
      "mount_point": "\/scripts",
      "type": "rw"
    },
    {
      "host_volume_file": "\/docker\/hass\/.ssh",
      "mount_point": "\/root\/.ssh",
      "type": "rw"
    }
  ]
}
2 Likes

Great job! I like your workaround for the Synology issue

Just a curiosity, did you ever managed to install Python3-Dev packages on Synology?

I didn’t.

One of the reasons for moving to Docker was that I found it hard getting all the packages I needed to install Home Assistant. Docker was the best way to get Home Assistant running with all the required dependencies it needs. I don’t have to worry about needing a Synology package installed, because Docker takes care of that by running everything in its own container.

I agree, Docker seems great but I have a very simple problem that I cannot solve.

KODI add-in does not work in Docker. No idea why

Does your home assistant log give any clues?

I found the Bluetooth tracker wouldn’t work until I changed the dockerfile to include some Bluetooth libraries.

There could be a missing library or module that needs to be included in the container for that component to work.

Hi,

I am having some issues reading bluetooth sensor data in my Synology 1515+ with a ble usb

I followed the instructions and have HA running. I used a configuration.yaml file from my raspberry pi, where I know that the sensor data was being populated, which leads me to believe that the bluetooth is not being registered within the docker container.

Could someone point me in the right direction?

Thanks

Are you able to post the applicable parts of your configuration.yaml file, and also the docker run statement you’re using?

Hi, I got it working again through a couple of combination Synology and Container restarts… it would appear that if the Syno box starts using bluetooth then it is not available to the container…

Now just trying the upgrade…

Hi guys, trying to debug this issue:

Can anyone tell me how to check that the blinkpy package and its dependencies are installed correctly within docker? I presumably need something like sudo docker XXXXXX --name home-assistant pip install blinkpy ?
Thanks!

It is a nice guide! But I got an issue I don’t know how to resolve it.

I am running DSM 6.0 on a Dell PowerEdge T20 server. The USB controller is Intel 8 / C220.

I was trying to use a Aeotec Z-Stick Gen5 as z-wave controller. But it looks like HomeAssistant will think that /dev/ttyACM0 is a normal serial port. I think there is a driver missing? Or if we have any other way to bypass this? I know for raspberry pi 3, even if I saw /dev/ttyACM0 there, I still can use it. But here I got the following error:

2018-01-07 08:20:49.368 Always, OpenZwave Version 1.4.2586 Starting Up
2018-01-07 08:20:51.348 Info, Setting Up Provided Network Key for Secure Communications
2018-01-07 08:20:51.348 Warning, Failed - Network Key Not Set
2018-01-07 08:20:51.348 Info, mgr,     Added driver for controller /dev/ttyACM0
2018-01-07 08:20:51.348 Info,   Opening controller /dev/ttyACM0
2018-01-07 08:20:51.348 Info, Trying to open serial port /dev/ttyACM0 (attempt 1)
2018-01-07 08:20:51.348 Info, Serial port /dev/ttyACM0 opened (attempt 1)
2018-01-07 08:20:51.348 Detail, contrlr, Queuing (Command) FUNC_ID_ZW_GET_VERSION: 0x01, 0x03, 0x00, 0x15, 0xe9
2018-01-07 08:20:51.348 Detail, contrlr, Queuing (Command) FUNC_ID_ZW_MEMORY_GET_ID: 0x01, 0x03, 0x00, 0x20, 0xdc
2018-01-07 08:20:51.348 Detail, contrlr, Queuing (Command) FUNC_ID_ZW_GET_CONTROLLER_CAPABILITIES: 0x01, 0x03, 0x00, 0x05, 0xf9
2018-01-07 08:20:51.348 Detail, contrlr, Queuing (Command) FUNC_ID_SERIAL_API_GET_CAPABILITIES: 0x01, 0x03, 0x00, 0x07, 0xfb
2018-01-07 08:20:51.348 Detail, contrlr, Queuing (Command) FUNC_ID_ZW_GET_SUC_NODE_ID: 0x01, 0x03, 0x00, 0x56, 0xaa
2018-01-07 08:20:51.348 Detail, 
2018-01-07 08:20:51.348 Info, contrlr, Sending (Command) message (Callback ID=0x00, Expected Reply=0x15) - FUNC_ID_ZW_GET_VERSION: 0x01, 0x03, 0x00, 0x15, 0xe9
2018-01-07 08:20:52.348 Error, contrlr, ERROR: Dropping command, expected response not received after 1 attempt(s)
2018-01-07 08:20:52.348 Detail, contrlr, Removing current message
2018-01-07 08:20:52.348 Detail, contrlr, Notification: Notification - TimeOut
2018-01-07 08:20:52.348 Detail, 
2018-01-07 08:20:52.348 Info, contrlr, Sending (Command) message (Callback ID=0x00, Expected Reply=0x20) - FUNC_ID_ZW_MEMORY_GET_ID: 0x01, 0x03, 0x00, 0x20, 0xdc
2018-01-07 08:20:53.348 Error, contrlr, ERROR: Dropping command, expected response not received after 1 attempt(s)
2018-01-07 08:20:53.348 Detail, contrlr, Removing current message
2018-01-07 08:20:53.348 Detail, contrlr, Notification: Notification - TimeOut
2018-01-07 08:20:53.348 Detail, 
2018-01-07 08:20:53.348 Info, contrlr, Sending (Command) message (Callback ID=0x00, Expected Reply=0x05) - FUNC_ID_ZW_GET_CONTROLLER_CAPABILITIES: 0x01, 0x03, 0x00, 0x05, 0xf9
2018-01-07 08:20:54.349 Error, contrlr, ERROR: Dropping command, expected response not received after 1 attempt(s)
2018-01-07 08:20:54.349 Detail, contrlr, Removing current message
2018-01-07 08:20:54.349 Detail, contrlr, Notification: Notification - TimeOut
2018-01-07 08:20:54.349 Detail, 
2018-01-07 08:20:54.349 Info, contrlr, Sending (Command) message (Callback ID=0x00, Expected Reply=0x07) - FUNC_ID_SERIAL_API_GET_CAPABILITIES: 0x01, 0x03, 0x00, 0x07, 0xfb
2018-01-07 08:20:55.349 Error, contrlr, ERROR: Dropping command, expected response not received after 1 attempt(s)
2018-01-07 08:20:55.349 Detail, contrlr, Removing current message
2018-01-07 08:20:55.349 Detail, contrlr, Notification: Notification - TimeOut
2018-01-07 08:20:55.349 Detail, 
2018-01-07 08:20:55.349 Info, contrlr, Sending (Command) message (Callback ID=0x00, Expected Reply=0x56) - FUNC_ID_ZW_GET_SUC_NODE_ID: 0x01, 0x03, 0x00, 0x56, 0xaa
2018-01-07 08:20:56.349 Error, contrlr, ERROR: Dropping command, expected response not received after 1 attempt(s)
2018-01-07 08:20:56.349 Detail, contrlr, Removing current message
2018-01-07 08:20:56.349 Detail, contrlr, Notification: Notification - TimeOut
2018-01-07 08:21:30.722 Error, mgr,     Manager::GetDriver failed - Home ID 0x00000000 is unknown
2018-01-07 08:21:30.722 Warning, Exception: Manager.cpp:373 - 100 - Invalid HomeId passed to GetDriver
2018-01-07 08:21:30.722 Info, mgr,     Manager::WriteConfig failed - _homeId 0 not found
2018-01-07 08:21:31.723 Detail, Notification: DriverRemoved
2018-01-07 08:21:31.723 Always, ***************************************************************************
2018-01-07 08:21:31.723 Always, *********************  Cumulative Network Statistics  *********************
2018-01-07 08:21:31.723 Always, *** General
2018-01-07 08:21:31.723 Always, Driver run time: . .  . 0 days, 0 hours, 0 minutes
2018-01-07 08:21:31.723 Always, Frames processed: . . . . . . . . . . . . . . . . . . . . 0
2018-01-07 08:21:31.723 Always, Total messages successfully received: . . . . . . . . . . 0
2018-01-07 08:21:31.723 Always, Total Messages successfully sent: . . . . . . . . . . . . 5
2018-01-07 08:21:31.723 Always, ACKs received from controller:  . . . . . . . . . . . . . 0
2018-01-07 08:21:31.723 Always, *** Errors
2018-01-07 08:21:31.723 Always, Unsolicited messages received while waiting for ACK:  . . 0
2018-01-07 08:21:31.723 Always, Reads aborted due to timeouts:  . . . . . . . . . . . . . 0
2018-01-07 08:21:31.723 Always, Bad checksum errors:  . . . . . . . . . . . . . . . . . . 0
2018-01-07 08:21:31.723 Always, CANs received from controller:  . . . . . . . . . . . . . 0
2018-01-07 08:21:31.723 Always, NAKs received from controller:  . . . . . . . . . . . . . 0
2018-01-07 08:21:31.723 Always, Out of frame data flow errors:  . . . . . . . . . . . . . 0
2018-01-07 08:21:31.723 Always, Messages retransmitted: . . . . . . . . . . . . . . . . . 0
2018-01-07 08:21:31.723 Always, Messages dropped and not delivered: . . . . . . . . . . . 5
2018-01-07 08:21:31.723 Always, ***************************************************************************
2018-01-07 08:21:31.723 Warning, WARNING: Tried to write driver config with no home ID set
2018-01-07 08:21:33.723 Info, mgr,     Driver for controller /dev/ttyACM0 removed

Are you able to provide your docker run command you’re using? Also the zwave settings you’re parsing through in your configuration.yaml file.

I have a package installed USBSerialDrivers for DSM 5.2. I am not sure where I found this package, but you might be able to install this to see if it solves the issue for you (just look for a DSM6 version).

Docker command :
sudo docker run --name home-assistant --restart=always --net=host --privileged -itd -v /volume1/main/ha-config:/config --device /dev/ttyACM0 homeassistant/home-assistant

configuration.yaml
zwave:
usb_path: /dev/ttyACM0

I guess the USBSerialDriver file will not resolve the problem. I did google and the author said he only put synology related hardware drivers inside. My case is using intel hardware

there is not the problem, like in Qnap, that after restart you may have to change the address of the USB stick in configuration?

All right, I eventually resolved the problem.

There is a pub source intel ftdi driver for linux available at http://www.ftdichip.com/Drivers/D2XX.htm. just install the driver. the device is still /dev/ttyACM0. everything works fine.

Hi to everyone,

Which BLE USB dongle you recomend me to plug into my synology nas?

thanks

I used this one: Kinivo BTD-400 Bluetooth 4.0 USB Adapter