I decided it was time for a spring clean, so out with the SmartThings hub and in with a ZigBee controller from Elelabs. I also decided to perform a fresh install on my Raspberry Pi 4 Model B.
I installed Hass.IO using the install notes from here: https://github.com/home-assistant/hassio-installer.
However, no matter what I have tried, I cannot get the new Hass.IO instance to communicate with the Elelabs Zigbee controller. Reading the install instructions on https://elelabs.com/products/elelabs-zigbee-shield.html
and in particular the instructions in their PDF:
https://elelabs.com/wp-content/uploads/2019/12/ELR022_UG_21_HomeAssistant.pdf
I see I need to allow the docker container to connect to the /dev/ttyAMA0 device.
I tried stopping the Home Assistant container with
docker stop xxxxx
only to find that the container was running again a few seconds later. This had me baffled. Some posts on this community implied that it was due to the docker --restart flag.
Looking at the Home Assistant install script, https://raw.githubusercontent.com/home-assistant/hassio-installer/master/hassio_install.sh I can see that the Home Assistant Supervisor process is installed as a service. So I guessed that this is what keeps restarting the Home Assistant container.
I fixed this using the command:
systemctl stop hassio-supervisor.service
The following web page mentions how to expose devices to
So I took a snapshot of my container using:
docker commit homeassistant home-assistant-all-but-zigbee
I then renamed the original container so I could replace it and the supervisor service would work with it correctly:
docker container rename homeassistant homeassistant_old
I then ran up my new instance of Hass.IO using:
docker run --init -d --name="homeassistant" -v /config:/config \
-e "TZ=Europe/London" \
--device /dev/ttyAMA0:/dev/ttyAMA0 \
--privileged \
--net=host home-assistant-all-but-zigbee
However, the problem persists. Note that the user running the docker container is pi (as far as I know) and pi is a member of dialout group. Permissions on that device as follows.
crw-rw---- 1 root dialout 204, 64 Jan 20 23:46 /dev/ttyAMA0
Note that Hass.IO shows the serial device /dev/ttyAMA0 in the hardware list.
This is the log from Home Assistant:
2020-01-20 23:46:16 DEBUG (MainThread) [bellows.ezsp] Resetting EZSP
2020-01-20 23:46:16 DEBUG (bellows.thread_0) [bellows.uart] Resetting ASH
2020-01-20 23:46:16 DEBUG (bellows.thread_0) [bellows.uart] Sending: b'1ac038bc7e'
2020-01-20 23:46:21 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry /dev/ttyAMA0 for zha
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 215, in async_setup
hass, self
File "/usr/src/homeassistant/homeassistant/components/zha/__init__.py", line 103, in async_setup_entry
await zha_gateway.async_initialize()
File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 124, in async_initialize
await self.application_controller.startup(auto_form=True)
File "/usr/local/lib/python3.7/site-packages/bellows/zigbee/application.py", line 135, in startup
await self.initialize()
File "/usr/local/lib/python3.7/site-packages/bellows/zigbee/application.py", line 72, in initialize
await e.reset()
File "/usr/local/lib/python3.7/site-packages/bellows/ezsp.py", line 57, in reset
await self._gw.reset()
File "/usr/local/lib/python3.7/site-packages/bellows/uart.py", line 222, in reset
return await asyncio.wait_for(self._reset_future, timeout=RESET_TIMEOUT)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 449, in wait_for
raise futures.TimeoutError()
concurrent.futures._base.TimeoutError
2020-01-20 23:47:57 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.2892257104] Received invalid command: zha/devices
2020-01-20 23:48:13 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.2892257104] Received invalid command: zha/devices/permit