Jump to content
balloob

Docker template for Home Assistant - Python 3 home automation

117 posts in this topic Last Reply

Recommended Posts

Hi,

 

I have two questions regarding this docker:

 

1) Where can I store custom components? On an RPi Installation I can create a folder "custom_components" in the home directory of home-assistant

 

2) If I need pip3 packages: do I need to install them on the base unraid system or within the docker?

 

Br,

Johannes

 

Ok, It seems I was able to figure it out by try-and-error:

 

1) custom_components: placed them in the appdata-folder of the app

2) pip3 packages installed as user root

Edited by ebnerjoh

Share this post


Link to post

Ok, still struggeling with one component (BLNET for Home Assistant).

 

If I start home assistant I am getting the following error:

2018-05-10 08:20:46 ERROR (SyncWorker_4) [homeassistant.util.package] Unable to install package pyblnet==0.4.2: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-goivl1cr/html/
2018-05-10 08:20:46 ERROR (MainThread) [homeassistant.requirements] Not initializing blnet because could not install requirement pyblnet==0.4.2
2018-05-10 08:20:46 ERROR (MainThread) [homeassistant.setup] Setup failed for blnet: Could not install all requirements.

 

I have installed html and pyblnet via pip3:

root@UnRaid:/mnt/user/appdata# pip3 install html==1.0
Requirement already satisfied: html==1.0 in /usr/lib64/python3.6/site-packages

root@UnRaid:/mnt/user/appdata# pip3 install pyblnet==0.4.2
Requirement already satisfied: pyblnet==0.4.2 in /usr/lib64/python3.6/site-packages
Requirement already satisfied: requests in /usr/lib64/python3.6/site-packages (from pyblnet==0.4.2)
Requirement already satisfied: htmldom in /usr/lib64/python3.6/site-packages (from pyblnet==0.4.2)
Requirement already satisfied: html in /usr/lib64/python3.6/site-packages (from pyblnet==0.4.2)
Requirement already satisfied: idna<2.7,>=2.5 in /usr/lib64/python3.6/site-packages (from requests->pyblnet==0.4.2)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/lib64/python3.6/site-packages (from requests->pyblnet==0.4.2)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib64/python3.6/site-packages (from requests->pyblnet==0.4.2)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /usr/lib64/python3.6/site-packages (from requests->pyblnet==0.4.2)

 

Share this post


Link to post

@balloob: Do you have an idea in my issue?

 

I think I may need to install the PyBLNET within the docker, but I do not know how to do.

 

If I run pip3 install PyBLNET within the Docker, then I am getting the following error:

 

r

root@UnRaid:/usr/src/app# pip install PyBLNET==0.4.2
Collecting PyBLNET==0.4.2
  Using cached https://files.pythonhosted.org/packages/73/72/668f8ab18ed0291bd89430bc39784ffd19ffa0cacbc5dda30151b1a627bf/PyBLNET-0.4.2-py2.py3-none-any.whl
Collecting html (from PyBLNET==0.4.2)
  Using cached https://files.pythonhosted.org/packages/4a/df/0e3d22d50ee43274eb5116f49972a164d853bb3ab305a69a0540b6292252/html-1.16.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/usr/local/lib/python3.6/site-packages/setuptools/__init__.py", line 14, in <module>
        from setuptools.dist import Distribution, Feature
      File "/usr/local/lib/python3.6/site-packages/setuptools/dist.py", line 24, in <module>
        from setuptools.depends import Require
      File "/usr/local/lib/python3.6/site-packages/setuptools/depends.py", line 7, in <module>
        from .py33compat import Bytecode
      File "/usr/local/lib/python3.6/site-packages/setuptools/py33compat.py", line 11, in <module>
        from setuptools.extern.six.moves import html_parser
      File "/usr/local/lib/python3.6/site-packages/setuptools/_vendor/six.py", line 92, in __get__
        result = self._resolve()
      File "/usr/local/lib/python3.6/site-packages/setuptools/_vendor/six.py", line 115, in _resolve
        return _import_module(self.mod)
      File "/usr/local/lib/python3.6/site-packages/setuptools/_vendor/six.py", line 82, in _import_module
        __import__(name)
    ModuleNotFoundError: No module named 'html.parser'; 'html' is not a package

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-rzjxgfdy/html/

Best Regards,

Johannes

Share this post


Link to post

Hi,

 

It was an issue with the pyblnet-component. There is now a new version available and it is working.

 

Br,

Johannes

Share this post


Link to post

Thanks to this thread and container I'm hooked on HomeAssistant.  I've been adding quite a few containers to my war chest of containers.  After testing several for a while and getting the hang of making my own templates I've decided to share the work back to make is easy on the folks using things.  I'll be adding the MQTT Smartthings one soon as I myself were looking for this one in the thread.  I do have the TasmoAdmin and HA-Dockermon templates going up soon if not already.  

 

 

Share this post


Link to post

My first stab at this - installed docker ok brings up main screen but then when i follow the next step guide

 

!Hass.io main panel! is completly missing form the docker - anyone any ideas as that seems to be how one adds addons.

 

Cheers

 

Stuart

Share this post


Link to post

Hi, 

 

One request for the Docker.

 

Would it be possible to add 

pip3 install networkx

to the docker?

 

I am using it to print a graphical layout of my z-wave network.

 

Br,

Johannes

Share this post


Link to post

Hi,

 

I need to move my Z-Wave stick away from my unRaid server more centrally (with an Raspberry Pi). This should be possible with ser2net (on PI) and socat (on the HA Server).

 

Unfortunatly I have not seen any solution for Socat on Unraid, but I saw that there are dockers available with HomeAssistant + Socat:

 

https://github.com/vladbabii/homeassistant-socat

 

Any chance to get such a thing to the unRaid Docker?

 

Br,

Johannes

Share this post


Link to post
1 hour ago, ebnerjoh said:

Hi,

 

I need to move my Z-Wave stick away from my unRaid server more centrally (with an Raspberry Pi). This should be possible with ser2net (on PI) and socat (on the HA Server).

 

Unfortunatly I have not seen any solution for Socat on Unraid, but I saw that there are dockers available with HomeAssistant + Socat:

 

https://github.com/vladbabii/homeassistant-socat

 

Any chance to get such a thing to the unRaid Docker?

 

Br,

Johannes

 

Why not run everything on the Raspberry pi then? Or just buy an Z-wave Extender if it's the signal strength that is your issue. 

Share this post


Link to post
8 minutes ago, saarg said:

 

Why not run everything on the Raspberry pi then? Or just buy an Z-wave Extender if it's the signal strength that is your issue. 

 

I want to run as less as possible on the RPi, therefore I have the unraid server ?

 

With the range extenders I had no good experience, for me the wall plugs are working better in terms of signal repeating, but also for them I would need additional 4 to 5 devices to setup a proper coverage. 

 

Br,

Johannes

Share this post


Link to post
2 hours ago, ebnerjoh said:

 

I want to run as less as possible on the RPi, therefore I have the unraid server ?

 

With the range extenders I had no good experience, for me the wall plugs are working better in terms of signal repeating, but also for them I would need additional 4 to 5 devices to setup a proper coverage. 

 

Br,

Johannes

 

But if you already run the rpi, then why not also HA? Cheaper than buying many wallplug. 

You have a really big house or concrete walls? 

Edited by saarg

Share this post


Link to post

My HA container started acting weird after one of the recent updates.  I have it so I can access it through nginix and letsencrypt as detailed by SpaceInvaderOne.  For some reason the Port Mapping and port config went missing:

 

image.png.acba89d4fc6d7d9663fdf4d9c36987e7.png

 

image.thumb.png.5ab6e3b849dc9e11f76538a47dd77cb2.png

image.png.e13b1775955ce61abc931b5b88597e5f.png

 

 

The other containers in the "proxynet" network, NodeRed & Bitwarden, are working as intended.  

 

I've tried uninstalling, removing, re-installing the HA container multiple times.  Any ideas?

 

 

Edited by kimocal
image update

Share this post


Link to post
On 10/9/2018 at 10:56 PM, kimocal said:

My HA container started acting weird after one of the recent updates.  I have it so I can access it through nginix and letsencrypt as detailed by SpaceInvaderOne.  For some reason the Port Mapping and port config went missing:

 

image.png.acba89d4fc6d7d9663fdf4d9c36987e7.png

 

image.thumb.png.5ab6e3b849dc9e11f76538a47dd77cb2.png

image.png.e13b1775955ce61abc931b5b88597e5f.png

 

 

The other containers in the "proxynet" network, NodeRed & Bitwarden, are working as intended.  

 

I've tried uninstalling, removing, re-installing the HA container multiple times.  Any ideas?

 

 

I have this same problem

Share this post


Link to post

Anyone know how to roll back a version? 0.82 and onwards broke my AsusWRT presense detection and thats used for plenty of my automations. 

 

Share this post


Link to post

Uploaded a short video on setting up the basics on Home Assistant with unRaid.  I did it from start to show people how to quickly setup unRaid so most of you here can skip that part.

 

 

Share this post


Link to post

Hello,

 

I have Home-Assistant running on my unraid server.

Working fine! I do have a question. To be honnest, i'm not sure this is related to this docker or home-assistant.

I try to include some custome node.js files in my lovelace config. It does not seem to work...

Do I have to modify something in the docker config?

 

See my lovelace config below...

background: center / auto repeat url("/local/surfgirl.png") fixed
resources:
  - type: module
    url: /local/mini-media-player-bundle.js
  - type: js
    url: /local/clock-card.js
  - type: js
    url: /local/moment.js
  - type: js
    url: /local/slider-entity-row.js
  - type: js
    url: /local/card-tools.js
  - type: js
    url: /local/card-modder.js
  - type: module
    url: /local/button-card.js
title: Résidence Famille Guénette
views:
  - badges:
      - sun.sun
    cards:
      - entity: weather.dark_sky
        name: Météo
        type: weather-forecast
      - entities:
          - entity: light.chambre_maitre
          - entity: light.wall_switch_1
            name: Extérieur Avant
          - entity: light.wall_switch_2
            name: Extérieur Arrière
          - entity: light.veranda
        show_header_toggle: false
        title: Lumières
        type: entities
      - entities:
          - entity: switch.borne
          - entity: switch.cuisiniere
        show_header_toggle: false
        title: SonOff Borne / Cuisinière
        type: entities
      - entities:
          - entity: input_boolean.borne_tesla
          - entity: input_boolean.cuisiniere
          - entity: input_boolean.max_home
          - entity: input_boolean.nad_home
          - entity: input_boolean.siri_aurevoir
          - entity: input_boolean.siri_bonjour
          - entity: input_boolean.siri_nuit
        show_header_toggle: false
        title: Boolean
        type: entities
      - default_zoom: 10
        entities:
          - entity: device_tracker.max_iphone
        title: Location
        type: map
      - entity: media_player.cuisine_salon
        type: media-control
      - entity: input_boolean.borne_tesla
        hold_action:
          action: none
        tap_action:
          action: toggle
        theme: palms
        type: entity-button
    path: default_view
    title: Home
  - badges: []
    cards:
      - entity: alarm_control_panel.home_alarm
        name: Système d’alarme
        states:
          - arm_home
          - arm_away
        type: alarm-panel
    icon: ''
    title: Alarme

So, when I try to add a custom component, I have this error (see attached picture).

 

Any idea?

 

Tks!

 

Max

 

2019-03-18 14_19_06-Home Assistant.png

Share this post


Link to post

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.