Docker template for Home Assistant - Python 3 home automation


Recommended Posts

No worries! It's my fault for trying to adopt the latest and greatest before it is out. Hope it's all okay now.

 

I wish the beta tag would allow us to specify Docker tags (like these) so that we could offer channels a la chrome. "Release channel", "Nightly channel" etc.

You should be able to do that via appending the tag to the Repository
<Repository>homeassistant/home-assistant-dev:dev</Repository>

 

With no tag present, docker automatically appends :latest  (not sure if anyone has this in their templates, but it should work - if not, then its another bug report)

 

Unless you're talking about dockerMan / CA automatically appending something based upon some other criteria in the template

Link to comment

Oh and BTW, while CA did happen to go down this morning because of the changes you happened to have made, it wasn't because of this error in particular.  Rather it was because of how the appFeed happened to handle your template with only a single <Config> entry (and if that problem didn't happen this morning, it would have eventually happened with another template that was perfectly formed v2)

Link to comment

Thank you for the docker, it is working well for me. My theater now automatically turns off the lights when a movie plays in Plex, turns them to a dimmed status when paused, and turns them back on when Plex is stopped. Also added some lights in the living room that automatically turn on when the sun goes down for the dogs.

 

I do get an error when starting up Home Assistant, but it doesn't seem to affect anything I am using it for at this point. It appears to be related to the piece that you can use to track your router?

 

Error:

16-04-17 20:55:41 homeassistant.bootstrap: Error during setup of component device_tracker

Traceback (most recent call last):

  File "/usr/src/app/homeassistant/bootstrap.py", line 158, in _setup_component

    if not component.setup(hass, config):

  File "/usr/src/app/homeassistant/components/device_tracker/__init__.py", line 98, in setup

    conf = conf[0]

IndexError: list index out of range

Link to comment

You can ignore that error. It has been fixed in the next release.

 

Excellent! I actually have been on the gitter chat today to try to determine if you can speed up the polling between Plex and Home Assistant. The automation I have set up works, but it is fairly slow to actually react to changes from the plex media player.

Link to comment

FYI for anyone using this. It looks like you should point your repository to "homeassistant/home-assistant:latest" instead of "balloob/home-assistant:latest" to pull in updates now

 

Here is a note from the breaking changes of the recent update:

"The location of the Docker image has changed. There was no possibility for us to keep maintaining the old image (as it was bound to the GitHub repo under my name) or to make a redirect. So if you are using the Home Assistant Docker image, change it to run homeassistant/home-assistant:latest"

Link to comment

Would it be possible to use the built-in MQTT server in Home Assistant on this Docker? I've tried, but am getting an error.

 

16-04-23 06:54:50 homeassistant.bootstrap: Error during setup of component logger
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/bootstrap.py", line 158, in _setup_component
    if not component.setup(hass, config):
  File "/usr/src/app/homeassistant/components/logger.py", line 64, in setup
    for key, value in config.get(DOMAIN)[LOGGER_LOGS].items():
AttributeError: 'NoneType' object has no attribute 'items'
16-04-23 06:54:51 homeassistant.components.mqtt.server: Error initializing MQTT server
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/site-packages/hbmqtt/broker.py", line 184, in _build_listeners_config
    listeners_config = broker_config['listeners']
KeyError: 'listeners'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/app/homeassistant/components/mqtt/server.py", line 53, in start
    loop.run_until_complete(start_server)
  File "/usr/local/lib/python3.4/asyncio/base_events.py", line 325, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.4/asyncio/base_events.py", line 295, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.4/asyncio/base_events.py", line 1254, in _run_once
    handle._run()
  File "/usr/local/lib/python3.4/asyncio/events.py", line 125, in _run
    self._callback(*self._args)
  File "/usr/local/lib/python3.4/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/usr/src/app/homeassistant/components/mqtt/server.py", line 23, in broker_coro
    broker = Broker(config, loop)
  File "/usr/local/lib/python3.4/site-packages/hbmqtt/broker.py", line 156, in __init__
    self._build_listeners_config(self.config)
  File "/usr/local/lib/python3.4/site-packages/hbmqtt/broker.py", line 191, in _build_listeners_config
    raise BrokerException("Listener config not found invalid: %s" % ke)
hbmqtt.broker.BrokerException: Listener config not found invalid: 'listeners'
16-04-23 06:54:51 homeassistant.components.mqtt: Unable to start broker and auto-configure MQTT.
16-04-23 06:54:51 homeassistant.bootstrap: component mqtt failed to initialize
16-04-23 06:54:51 asyncio: Task exception was never retrieved
future: <Task finished coro=<broker_coro() done, defined at /usr/src/app/homeassistant/components/mqtt/server.py:19> exception=BrokerException("Listener config not found invalid: 'listeners'",)>
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/site-packages/hbmqtt/broker.py", line 184, in _build_listeners_config
    listeners_config = broker_config['listeners']
KeyError: 'listeners'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/app/homeassistant/components/mqtt/server.py", line 53, in start
    loop.run_until_complete(start_server)
  File "/usr/local/lib/python3.4/asyncio/base_events.py", line 325, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.4/asyncio/base_events.py", line 295, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.4/asyncio/base_events.py", line 1254, in _run_once
    handle._run()
  File "/usr/local/lib/python3.4/asyncio/events.py", line 125, in _run
    self._callback(*self._args)
  File "/usr/local/lib/python3.4/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/usr/src/app/homeassistant/components/mqtt/server.py", line 23, in broker_coro
    broker = Broker(config, loop)
  File "/usr/local/lib/python3.4/site-packages/hbmqtt/broker.py", line 156, in __init__
    self._build_listeners_config(self.config)
  File "/usr/local/lib/python3.4/site-packages/hbmqtt/broker.py", line 191, in _build_listeners_config
    raise BrokerException("Listener config not found invalid: %s" % ke)
hbmqtt.broker.BrokerException: Listener config not found invalid: 'listeners'
16-04-23 06:54:52 homeassistant.components.recorder: Found unfinished sessions

Link to comment

the mqtt client seems borked - it doesn't work with external mqtt server either.

 

 

Traceback (most recent call last):

File "/usr/local/lib/python3.4/threading.py", line 911, in _bootstrap_inner

self.run()

File "/usr/local/lib/python3.4/threading.py", line 859, in run

self._target(*self._args, **self._kwargs)

File "/usr/local/lib/python3.4/site-packages/paho/mqtt/client.py", line 2287, in _thread_main

self.loop_forever()

File "/usr/local/lib/python3.4/site-packages/paho/mqtt/client.py", line 1261, in loop_forever

rc = self.loop(timeout, max_packets)

File "/usr/local/lib/python3.4/site-packages/paho/mqtt/client.py", line 811, in loop

rc = self.loop_read(max_packets)

File "/usr/local/lib/python3.4/site-packages/paho/mqtt/client.py", line 1073, in loop_read

rc = self._packet_read()

File "/usr/local/lib/python3.4/site-packages/paho/mqtt/client.py", line 1475, in _packet_read

rc = self._packet_handle()

File "/usr/local/lib/python3.4/site-packages/paho/mqtt/client.py", line 1943, in _packet_handle

return self._handle_publish()

File "/usr/local/lib/python3.4/site-packages/paho/mqtt/client.py", line 2095, in _handle_publish

(message.topic, packet) = struct.unpack(pack_format, packet)

struct.error: bad char in struct format

 

Link to comment

For some reason my install stopped working. I didn't have much configured so I wanted to start with a clean install. That sounds easy, but I haven't been able to get a clean install. HA keeps finding my plex server and HA refuses to start. There isn't anything in the logs it just doesn't start.

 

What am I missing?

Link to comment
  • 3 weeks later...

Hey

 

I have just bought a TellStick Duo, but can't get it to work... Either by itself or with sensors.

I have added

# Tellstick
tellstick:
  signal_repetitions: 1

# Prediction of weather
sensor:
  platform: tellstick
  datatype_mask: 127

 

But it doesn't work... I get the following errors in the log.

16-05-14 15:22:38 homeassistant.bootstrap: Error during setup of component tellstick
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/bootstrap.py", line 157, in _setup_component
    if not component.setup(hass, config):
  File "/usr/src/app/homeassistant/components/tellstick.py", line 82, in setup
    core = telldus.TelldusCore(callback_dispatcher=DirectCallbackDispatcher())
  File "/usr/local/lib/python3.4/site-packages/tellcore/telldus.py", line 107, in __init__
    self.lib = Library(library_path, callback_dispatcher)
  File "/usr/local/lib/python3.4/site-packages/tellcore/library.py", line 312, in __init__
    lib = DllLoader.LoadLibrary(name)
  File "/usr/local/lib/python3.4/ctypes/__init__.py", line 429, in LoadLibrary
    return self._dlltype(name)
  File "/usr/local/lib/python3.4/ctypes/__init__.py", line 351, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libtelldus-core.so.2: cannot open shared object file: No such file or directory
16-05-14 15:22:38 homeassistant.components.sensor.tellstick: Could not initialize Tellstick.
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/components/sensor/tellstick.py", line 50, in setup_platform
    core = telldus.TelldusCore()
  File "/usr/local/lib/python3.4/site-packages/tellcore/telldus.py", line 107, in __init__
    self.lib = Library(library_path, callback_dispatcher)
  File "/usr/local/lib/python3.4/site-packages/tellcore/library.py", line 312, in __init__
    lib = DllLoader.LoadLibrary(name)
  File "/usr/local/lib/python3.4/ctypes/__init__.py", line 429, in LoadLibrary
    return self._dlltype(name)
  File "/usr/local/lib/python3.4/ctypes/__init__.py", line 351, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libtelldus-core.so.2: cannot open shared object file: No such file or directory
16-05-14 15:23:00 netdisco.ssdp: Error fetching description at 192.168.1.233

 

Please help... Do I need to install some TellStick Drivers or something more than just adding this in the config.yaml?

Do I need to install the TellDus.Core somehow? http://download.telldus.com/debian/pool/stable/

Link to comment
  • 1 month later...
  • 1 month later...

I've had this issue for a long time, but didn't quite understand what was going on. I would get countless number of "Received packet from invalid interface." from avahi-daemon in my syslogs. I have ruled the issue to being caused by the Home-Assistant docker.

 

I ran an strace on the avahi-daemon and am finding some interesting things. For some reason, three items in my house are being mentioned in the results from strace with that error message. My network printer, my philips hue bridge, and my vizio soundbar with GoogleCast. This is what the errors look like.

 

09:25:37 recvmsg(13, {msg_name(16)={sa_family=AF_INET, sin_port=htons(5353), sin_addr=inet_addr("172.27.231.1")}, msg_iov(1)=[{"\0\0\0\0\0\1\0\1\0\0\0\0\v_googlecast\4_tcp\5local\0\0\f\0\1\300\f\0\f\0\1\0\0\0\24\0(\17Vizio Sound Bar\v_googlecast\4_tcp\5local\0", 92}], msg_controllen=56, [{cmsg_len=28, cmsg_level=SOL_IP, cmsg_type=8, ...}, {cmsg_len=20, cmsg_level=SOL_IP, cmsg_type=2, ...}], msg_flags=0}, 0) = 92
09:25:37 sendto(3, "<28>Sep  4 09:25:37 avahi-daemon[14623]: Received packet from invalid interface.", 80, MSG_NOSIGNAL, NULL, 0) = 80

 

09:25:37 recvmsg(13, {msg_name(16)={sa_family=AF_INET, sin_port=htons(5353), sin_addr=inet_addr("172.27.234.1")}, msg_iov(1)=[{"\0\0\0\0\0\1\0\1\0\0\0\0\4_hap\4_tcp\5local\0\0\f\0\1\300\f\0\f\0\1\0\0\16|\0&\24Philips hue - 208A86\4_hap\4_tcp\5local\0", 83}], msg_controllen=56, [{cmsg_len=28, cmsg_level=SOL_IP, cmsg_type=8, ...}, {cmsg_len=20, cmsg_level=SOL_IP, cmsg_type=2, ...}], msg_flags=0}, 0) = 83
09:25:37 sendto(3, "<28>Sep  4 09:25:37 avahi-daemon[14623]: Received packet from invalid interface.", 80, MSG_NOSIGNAL, NULL, 0) = 80

 

09:25:37 recvmsg(13, {msg_name(16)={sa_family=AF_INET, sin_port=htons(5353), sin_addr=inet_addr("172.27.224.1")}, msg_iov(1)=[{"\0\0\0\0\0\1\0\1\0\0\0\0\5_http\4_tcp\5local\0\0\f\0\1\300\f\0\f\0\1\0\0\31\10\0$\21Brother MFC-7360N\5_http\4_tcp\5local\0", 82}], msg_controllen=56, [{cmsg_len=28, cmsg_level=SOL_IP, cmsg_type=8, ...}, {cmsg_len=20, cmsg_level=SOL_IP, cmsg_type=2, ...}], msg_flags=0}, 0) = 82
09:25:37 sendto(3, "<28>Sep  4 09:25:37 avahi-daemon[14623]: Received packet from invalid interface.", 80, MSG_NOSIGNAL, NULL, 0) = 80

Link to comment

Im curious, with this Docker (or any other Docker where config files are changed), how do you edit your files with a text editor?

 

Obviously vim can be used from terminal, but I'd rather mount my appdata share and use a decent text editor to make changes to config files. What is the best way of doing this? I was getting permission errors sometimes while mounting through SMB.

Link to comment
  • 1 month later...
  • 4 weeks later...

Just a heads up for anyone that is wondering...

 

I tried installing this on my Unraid 6.2.2 server, and the WebUI would fail to load. Finally had to add in an extra command when setting up the app.

 

--net=bridge -p 0.0.0.0:8123:8123

 

Found the solution here

 

https://community.home-assistant.io/t/docker-on-mac-install-front-end-nowhere-to-be-found/5553/5

 

I'm suffering from the same issue on 6.2.4. On the docker screens within the unRAID control panel, where do we input this? Or does this fix required the use of ssh?

 

Thanks for your help!

Link to comment

Just a heads up for anyone that is wondering...

 

I tried installing this on my Unraid 6.2.2 server, and the WebUI would fail to load. Finally had to add in an extra command when setting up the app.

 

--net=bridge -p 0.0.0.0:8123:8123

 

Found the solution here

 

https://community.home-assistant.io/t/docker-on-mac-install-front-end-nowhere-to-be-found/5553/5

 

I'm suffering from the same issue on 6.2.4. On the docker screens within the unRAID control panel, where do we input this? Or does this fix required the use of ssh?

 

Thanks for your help!

 

I was able to resolve my issue via the control panel. For this docker, I added an additional port that matched the port HA was trying to reach. I can only guess this is not setup as part of the template upon the docker's install; though I'm fairly new to unRAID and docker if I'm not explaining that accurately.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.