Yeelight not appear in HA using docker in synology NAS. The same with xiaomi Smart home

Hi,

I’m using HA from time ago in a raspberry pi 3, and all works well. Recently i migrate HA to a docker of synology NAS, and there are some components that doesn’t work as yeelight bulbs or the xiaomi smart home devices (motion sensor, door sensor, etc) when i say that this devices not work, i mean that not appear in the website of HA in a group components.

I think the problem must be to open some ports in NAS. Does someone know how to resolve this? Can soeone help me?

thanks

what command do you use for start the docker container on the synology?

try to use this command:

sudo docker run -d --name=“home-assistant” -v /volume1/docker/homeassistant/config:/config -v /etc/localtime:/etc/localtime:ro --net=host --restart=always homeassistant/home-assistant

Hi,

what command do you use for start the docker container on the synology?

i’m really new with using docker and starting container in synology, i just click button start and that’s all

Also when i open HA, i have this error message about xiaomi is not configured correctly, but when was working in raspberry all worked ok.

thanks

ok… I think the problem is that the docker container not running as -net host or with privilege… are you able to connect to your synology with an SSH session? With Windows you can user Putty.exe with linux a normal prompt.

then when you login to your synology put user and password then run the command

sudo -i
put the password and then run the command:

sudo docker run -d --name=“home-assistant” -v /volume1/docker/homeassistant/config:/config -v /etc/localtime:/etc/localtime:ro --net=host --restart=always homeassistant/home-assistant

you must change this value:

/volume1/docker/homeassistant/config:/config

with your correct path to the config folder on your synology

Also! xiaomi is not a valid component (officially included in HA) unless you have copied it from the Xiaomi thread in this forum to your custom_components folder?

yes it can be possible him have to download and add the components to the custom folder for the xiaomi gateway sensors… but the yeelight bulbs are implemented in hass so if him on’t see it there is a problem, or in config or in the docker installation.

Hi @jcastro and @Ciquattro ,

Also! xiaomi is not a valid component (officially included in HA) unless you have copied it from the Xiaomi thread in this forum to your custom_components folder?

Thanks for reply. I know that xiaomi is not official component already and yes i have folder custom_component with files, concretely with @Danielhiversen file’s.

As i said before all configuration in raspberry worked well.

@Ciquattro,

ok… I think the problem is that the docker container not running as -net host or with privilege… are you able to connect to your synology with an SSH session? With Windows you can user Putty.exe with linux a normal prompt.

then when you login to your synology put user and password then run the command

sudo -i
put the password and then run the command:

sudo docker run -d --name="home-assistant" -v /volume1/docker/homeassistant/config:/config -v /etc/localtime:/etc/localtime:ro --net=host --restart=always homeassistant/home-assistant

you must change this value:

/volume1/docker/homeassistant/config:/config

with your correct path to the config folder on your synology

I need to check this option, because now starting docker from website interface i see only this logs in ther terminal docker.

Tomorrow i will check your option i will tell results.

thanks both!

Hi,

I have these logs:

2017-06-09 18:00:12 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.netatmo
2017-06-09 18:00:12 ERROR (MainThread) [homeassistant.components.climate] Error while setting up platform netatmo
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/helpers/entity_component.py", line 155, in _async_setup_platform
    entity_platform.schedule_add_entities, discovery_info
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/app/homeassistant/components/climate/netatmo.py", line 47, in setup_platform
    for module_name in data.get_module_names():
  File "/usr/src/app/homeassistant/components/climate/netatmo.py", line 162, in get_module_names
    for module in self.thermostatdata.modules[self.device].values():
KeyError: 'relay_T'
2017-06-09 18:00:15 WARNING (MainThread) [homeassistant.setup] Setup of xiaomi is taking over 10 seconds.
2017-06-09 18:00:20 ERROR (<concurrent.futures.thread.ThreadPoolExecutor object at 0x7ff48bfb7a90>_9) [custom_components.xiaomi] No gateway discovered
2017-06-09 18:00:20 ERROR (MainThread) [homeassistant.setup] Setup failed for xiaomi: Component failed to initialize.

But in configuration xiaomi i have the key code… maybe is pycrypto package in synology?

What about bulbs? any help?

Hi @Ciquattro,

This solved my problem!

Now i can see my xiaomi devices and and yeelight bulbs!

thanks

your welcome… so the problem was the --net=host?

yes, was this. So now i start container from ssh command.

yes I always start it from ssh… if you don’t delete the conteiner after the first start from ssh you can start and stop from the GUI.
By the way when there is an update you need to stop and delete the container and run again with SSH.

Hi, I had the exact same problem, you can simply tick “Use the same network as Docker Host”.
see my post Xiaomi Gateway Integration

Hi @Nikopol,

Thanks for reply. During this week i will try to install version 0.50 in docker, so i will try to do it as you say.