Это видео недоступно.
Сожалеем об этом.

Installing And Running Home Assistant In A Docker Container, What You Need To Know! (How-To)

Поделиться
HTML-код
  • Опубликовано: 6 апр 2022
  • #HomeAssistant #Docker #BinaryTechLabs
    This video is a continuation of my previous Home Assistant install videos, and in this video, we will be installing Home Assistant in a container.
    If you want to try Home Assistant on a Raspberry Pi or any other single board computer but don't want to invest in the hardware or it's not available, why not try it in a container? If you're not sure what a container is, this video will walk you through the steps of containerising Home Assistant so you can experience it before you buy something.
    💖 ABOUT OUR CHANNEL
    Welcome to Binary Tech Labs, where we provide tutorials and reviews on Home Assistant, IoT devices, Raspberry Pi and other Single Board Computers, as well as other topics.
    Check out our channel here:
    / @binarytechlabs
    Don’t forget to subscribe!
    💻 SOFTWARE
    Install guides for Docker - docs.docker.co...
    Install guides for Docker-Compose - docs.docker.co...
    Portainer Install - docs.portainer...
    🔗 GitHub Links
    Docker Install Repo - github.com/Bin...
    FOLLOW US ON SOCIAL
    Get updates or reach out to Get updates on our Social Media Profiles!
    Twitter: @BinaryTechLabs
    Instagram: @BinaryTechLabs

Комментарии • 118

  • @philharris9631
    @philharris9631 Год назад +3

    This is an absolutely stunning piece of work ... I have totally avoided running Home Assistant in a docker container for exactly this reason - I will be trying this later today with a test setup. Thank you!

    • @BinaryTechLabs
      @BinaryTechLabs  Год назад

      Thank you for your generous words and you are most welcome

  • @mandeepmails
    @mandeepmails Год назад +2

    Finally, a decent plus on-the-ground level video that talks about how to do it properly. Amazing content and reasoning. Neither any BS nor any cosmetic effects.
    Appreciate your video. Very under rated channel, again who cares this early. Earned my sub. Respectfully Sir, "Super Thanks" again.

    • @BinaryTechLabs
      @BinaryTechLabs  Год назад +1

      Thanks very much for the compliment and kind words!

  • @enredao_electronico2737
    @enredao_electronico2737 Год назад +2

    Great video, consise and helpful . Suscessfully installed on a 4/64GB tvbox running armbian. subscribed !

  • @chrisjyoon
    @chrisjyoon 2 года назад +2

    very helpful video not only for home assistant but also about Portainer, thanks!

  • @buzhug35
    @buzhug35 Год назад

    A very good video! You have helped me a lot to undestand how to work without addon function. Thanks a lot for the time and the skills you share with us!
    Best regards from France 🇫🇷

    • @BinaryTechLabs
      @BinaryTechLabs  Год назад

      I am glad that I can help and it's awesome to hear that it's with people from all over the world

  • @celularyapuntocom
    @celularyapuntocom Год назад

    Awesome, thanks so much for taking the time to post. Subscribed and liked.

    • @BinaryTechLabs
      @BinaryTechLabs  Год назад

      Thanks for the support. Glad to hear this helped you! ❤️

  • @nadeemabbasi102
    @nadeemabbasi102 Год назад

    Superb. Nice, Easy and on the spot.

  • @ksoonsoon
    @ksoonsoon 2 года назад

    Fantastic group of videos you have created. I just happened on your channel today. I am a raspberry pi Fan and now a subscriber of your channel as well. Looking forward to understanding home assistant and the docker environment better. Thx

    • @BinaryTechLabs
      @BinaryTechLabs  2 года назад +1

      Thanks for subscribing and the compliment!

  • @johnarrington6292
    @johnarrington6292 Год назад

    Really excllent tutorial!!!

    • @BinaryTechLabs
      @BinaryTechLabs  Год назад

      Thanks for the support and your comment, it means a lot!

  • @yaseennaseer4034
    @yaseennaseer4034 2 года назад

    Damn.. this exactly what i have been looking for.

  • @Lunolux
    @Lunolux Год назад

    great video, thx

  • @stevecarlisle3323
    @stevecarlisle3323 Год назад

    Thanks Very Much for this Video.

  • @kirankalvagadda3075
    @kirankalvagadda3075 Год назад +1

    Thanks for video, it's really helpful. I just got sonoff zigbee device, Do you know how do you map device to container?

    • @BinaryTechLabs
      @BinaryTechLabs  Год назад

      Just add this to your compose yaml file:
      devices:
      - /dev/:/dev/
      You will have to find the device name, in Ubuntu I use this command :
      ls -l /dev/serial/by-id
      And I find my device name is
      /ttyUSB0
      So mine is
      devices:
      - /dev/ttyUSB0:/dev/ttyUSB0

  • @louisviciedo
    @louisviciedo Год назад +1

    What are the advantages of virtualizing vs local hardware install ?

    • @BinaryTechLabs
      @BinaryTechLabs  Год назад

      With docker, the biggest advantage is resources, your host isn't dedicated to one thing. If you want to test a new version, simply spin it up to test it against your config, to make sure it works. It's easier to get going for beginners or if you want to test it.

  • @fredzibulski3111
    @fredzibulski3111 2 года назад

    Question in into the round on this video.
    Not sure if I missed it I the video or didnt see, virbis this a supervised install ? I wanted to install the supervisor Home Assistant on my raspberry pi in docker so I can use the addon as well.
    I like your style very calm am knowledge good job.

    • @BinaryTechLabs
      @BinaryTechLabs  2 года назад +1

      Unfortunately this is not a supervisor install, but ty for the compliment

  • @ZA26
    @ZA26 Год назад +1

    How do I use influxDB 2.7 with Home Assistant?

    • @BinaryTechLabs
      @BinaryTechLabs  Год назад

      I should make a video for this, as I won't be able to explain through comments.
      But everything you need is here:
      www.home-assistant.io/integrations/influxdb/

  • @timafun
    @timafun Год назад +1

    Hi, thanks for your video, great job. But what about the backups?

    • @BinaryTechLabs
      @BinaryTechLabs  Год назад

      With software on the computer that you are running docker on, you can backup the directory or directories that you mapped to the container, also called your persistent data, then you can remove or reinstall your container at will

    • @timafun
      @timafun Год назад +1

      @@BinaryTechLabs yeah, that is also sprang to my mind. But mentioned it in the video, so I've waited for some other miracle:) Also checked your video about Duplicati, very useful, gonna stick to this way of backing up my containers.

    • @BinaryTechLabs
      @BinaryTechLabs  Год назад

      Thanks for your feedback and thanks

  • @arnauddubarry3588
    @arnauddubarry3588 Год назад +1

    hello
    Thanks for the video. very Helpful
    The solution to imbed portainer (e.g) in the menu in the left column does nost work if you HA is using https.
    Is there a work around for that.
    I may not use it for portainer but it's mandatory for vscode (at least for me).
    Thanks for your help

    • @BinaryTechLabs
      @BinaryTechLabs  Год назад

      Thanks, I'm glad I can help. The does not work with https as it states as a warning in the documentation.
      However, there usually is some work arounds. I have not attempted this but I came across a blog article about it, so depending on your use case and comfort level you can try this and see if it works for you. Not sure if it is still valid as this one was from 2019.
      dew-itwebservices.com.au/setting-home-assistant-up-for-secure-access-over-the-internet/

  • @vincentschaaf
    @vincentschaaf Год назад +1

    It would seem that docker compose is no longer available for Windows. Not sure whether there is an alternative.

    • @BinaryTechLabs
      @BinaryTechLabs  Год назад

      Thanks for the comment, you can still use docker compose through docker desktop for Windows. Just follow the link below for how to install it on Windows.
      docs.docker.com/compose/install/

  • @anh_nguyen_
    @anh_nguyen_ Год назад

    Hi, this is an excellent video. Could you make a video about Headscale, Tailscale with Homeassistant?

    • @BinaryTechLabs
      @BinaryTechLabs  Год назад +1

      Thanks for the suggestions, I will definitely add them to the list

    • @anh_nguyen_
      @anh_nguyen_ Год назад

      @@BinaryTechLabs thank for reply :)

    • @BinaryTechLabs
      @BinaryTechLabs  Год назад +1

      In the meantime you can look at the video I did on remote access using cloudflare, it's similar to tailscale, no open ports

    • @anh_nguyen_
      @anh_nguyen_ Год назад

      @@BinaryTechLabs Yes, but I want to have my own Server :D, but I am weak at Linux. I want to test Headscale

    • @BinaryTechLabs
      @BinaryTechLabs  Год назад +1

      I get it, me personally, I run a proxmox lxc container instance of home assistant as my production instance and use cloudflare, but I will do the tailscale video as it's always good to have options

  • @bernardoteixeira7721
    @bernardoteixeira7721 2 года назад +1

    hey, great video, I'm having a problem. I can pair devices with zigbee2mqtt. But I cant see them as entities in home assistant. do you know what is missing me?

    • @BinaryTechLabs
      @BinaryTechLabs  2 года назад

      There could be a few things that can cause this. This form should be a good starting point for you.
      community.home-assistant.io/t/zigbee2mqtt-device-not-shown-in-devices-or-entities-in-home-assistant/415649/9

  • @MyHeap
    @MyHeap Год назад +1

    Great tutorial. I have HA running in docker as well. Is there any way you would cover installing and using Rhaspy in this environment? I have been working on it for a while and am getting errors when Rhasspy sends and intent to HA. I get an unauthorized message in the logs from HA. Even though I have created an access token.
    Thanks again for all you do!
    Joe

    • @BinaryTechLabs
      @BinaryTechLabs  Год назад +1

      I've actually been researching this very thing, as it peaked my curiosity in November's release party I believe. So it's in the que, just can't say how long

    • @MyHeap
      @MyHeap Год назад +1

      @@BinaryTechLabs it actually looks like my rhasspy server is working as intended. The speech to text works and the intent handler does in fact try to send the data to my HA server. I get an error in the HA server that the request was unauthorized. I do have api and intent in the HA config. I tried doing a simple curl request and had the same problem. So my issue lies with my HA server somehow. I am by way using the token generated from my user profile on HA. I think I will exec into the HA container and try the curl test again.
      Now some differences between you install and mine. I am using the docker text from the install portion of HA docs. Your using the docker hub version. Only difference is where I pull the image but I think it is probably the same. My HA is set to run on the host network so no ports are mapped. I cannot remember if yours runs in the stack network created from compose or the host network. Other than that, I think ours are similar. I know it is later sown the pipe, but can you test your api with curl and let me know if your instance let's you connect? If you would like to collaborate off YT, my email is xavier at gtec dot com.
      Regards,
      Joe

    • @BinaryTechLabs
      @BinaryTechLabs  Год назад

      I'll try to look at it tonight and if the image isn't being pulled from the same place (home assistant that is) there could be any number of differences in how the container's were built. I'm using the network created by compose and not the host network

    • @BinaryTechLabs
      @BinaryTechLabs  Год назад +1

      Hey bud, I got it all working in my docker instance of Home Assistant. I'll update my compose yaml, but if you do reach out through email I can help you further. Btw I did send you an email

  • @zyghom
    @zyghom Год назад +1

    super nice guide, did you try also InfluxDB and Grafana in container? I succeeded with Grafana but no way for influxdb

    • @BinaryTechLabs
      @BinaryTechLabs  Год назад

      Thank you for your love. Yes I am running both in containers.
      version: '3'
      services:
      influxdb:
      image: influxdb:2.6-alpine
      env_file:
      - influxv2.env
      volumes:
      # Mount for influxdb data directory and configuration
      - influxdbv2:/var/lib/influxdb2:rw
      ports:
      - "8086:8086"
      telegraf:
      image: telegraf:1.25-alpine
      depends_on:
      - influxdb
      volumes:
      # Mount for telegraf config
      - ./telegraf/mytelegraf.conf:/etc/telegraf/telegraf.conf:ro
      env_file:
      - influxv2.env
      volumes:
      influxdbv2:

    • @zyghom
      @zyghom Год назад

      @@BinaryTechLabs thank you. I did not explain properly: HA guys still use version 1.x of influxdb together with telegraf and kapacitor. So Grafana is using that sql language as well. Now, from your info above (and what I also tried) you use 2.x. This is using totally different sql language, right? So Grafana is not compatible (between 1.x and 2.x). Or at least I am not able to somehow set it up properly so that I can easily use Grafana with InfluxDB version 2.x.
      I am not sure if you got my point ;)

    • @BinaryTechLabs
      @BinaryTechLabs  Год назад

      Yes I use version 2, it works fine with grafana, but it's a little harder to select as you have to use flux queries, but I find going into influxdb and making it that way, I can then copy it out and use in grafana.
      Hope that helps

    • @BinaryTechLabs
      @BinaryTechLabs  Год назад

      www.home-assistant.io/integrations/influxdb/

    • @zyghom
      @zyghom Год назад

      @@BinaryTechLabs this I know, the problem is query language in v2

  • @mouhssinemhe4194
    @mouhssinemhe4194 2 года назад

    Very helpful video, one point I have problems with changing the path to "/opt" can you please help me with that specially Pi-Hole. Thank you

    • @BinaryTechLabs
      @BinaryTechLabs  2 года назад

      Your running PiHole in docker and have installed it in the /opt directory? And your trying to give PiHole permissions for the directory?

    • @mouhssinemhe4194
      @mouhssinemhe4194 2 года назад

      @@BinaryTechLabs thanks for replying, running Docker on VM; found the problem is libvirt-dnsmasq using port 53 and 67 still no solution yet to overcome that

    • @BinaryTechLabs
      @BinaryTechLabs  2 года назад

      Yea, sorry I'm not completely sure of the problem and with how I can help

  • @MyHeap
    @MyHeap Год назад

    Looks like I figured out what was happening with the authorization. I would double click the token to highlight it and copy. Seems that it wasn't getting the whole token. After actually getting the complete token, HA authorized Rhasspy to connect. So in the end it was a PEBCAK. Thanks again for all your help. Still don't know why my posts idnt show up in the thread below.
    Again, I want to thank you for the great in-depth tutorials. They have been a wonderful help.
    Regards,
    Joe Hildreth

    • @BinaryTechLabs
      @BinaryTechLabs  Год назад

      I am very happy to hear that! Don't worry about the mistake, I've made quite a few palm to face moments.

  • @YouTubeDoxedMyRealName
    @YouTubeDoxedMyRealName Год назад +1

    The home assistant OS runs natively in docker.... As in its literally a docker installed over linux kernal running a container.... I dont understand why they dont just have have a container for download with full capability excluding the "managed OS" as thats just what ever OS ur using and ur managing it separately.... Isn't that partially the point of Docker to be able to transfer containers...?

    • @BinaryTechLabs
      @BinaryTechLabs  Год назад +1

      Yes, HAOS uses docker as a container engine and its addon modules like supervisor are containers, the base OS linux is "buildroot" which is meant to be an embedded system. It's just the direction that the Devs went.
      What's your use case for docker? You can use it and still end up having a very similar product or have you considered a virtual machine for home assistant?

    • @YouTubeDoxedMyRealName
      @YouTubeDoxedMyRealName Год назад

      @@BinaryTechLabs I wanted to use it on my rpi server. I am using Home Assistant to connect, control and somewhat automate my "smart devices." They generally require add-ons to run. I wish to keep them segmented on a separate network from my main network while keeping "cloud" completely out of the picture. Further I wish to utilize the supervisor. I dont want to run it on my desktop for security, privacy and stability reasons. The reason I do not install HAOS directly on the pi is because its an 8gb rpi 4 running Kali and I have it doing other things as well for the same reasons as mentioned before. Like for example if I wanted to update my DNS service from HAOS I would just update it from my router. Oh and thanks for the reply.

    • @BinaryTechLabs
      @BinaryTechLabs  Год назад

      You can use "supervised", that might accomplish what you want or grab a cheap laptop to install HAOS on.
      Good luck

  • @edbouhl3100
    @edbouhl3100 2 года назад +1

    Docker OS has a serious limitation: it only recognizes USB drives. Great if you’re using their hardware or a similar ‘thin client’ machine. Horrible if you’re trying to install it on bare metal such as an old server with internal drives. That’s why I’m here watching how to use the Docker Container version.

    • @BinaryTechLabs
      @BinaryTechLabs  2 года назад +1

      Yea the docker container version has increased its abilities lately making it a real contender to a stand alone RPI or thin client

  • @fredarmstrong6418
    @fredarmstrong6418 2 года назад +1

    Great video. Do you know if it is possible for the Zigbee2MQTT container to communicate when the Zigbee hub is plugged into a different physical device (a rpi for instance). My server is too far away from the rest of the house to effectively communicate with the zigbee network - I am trying to explore alternative solutions.

    • @BinaryTechLabs
      @BinaryTechLabs  2 года назад

      Thanks, and yes as long as it is on the same network the two can talk to each other

    • @fredarmstrong6418
      @fredarmstrong6418 2 года назад

      @@BinaryTechLabs If the USB device was locally connected - I think I would just have to add these 2 lines in my Docker compose file:
      devices:
      - /dev/ttyUSB0:/dev/ttyUSB0
      How does that change when the USB device is connected on another machine.
      Sorry if this is a dumb question, I am hoping you could just point me to the concepts I need to research, I think I am close, but I am not a power User on Linux and I have not wrapped my head around this problem yet.

    • @BinaryTechLabs
      @BinaryTechLabs  2 года назад

      Ok, I understand now, sorry. Can you clarify what zigbee hub you are using on your raspberry pi

    • @fredarmstrong6418
      @fredarmstrong6418 2 года назад

      @@BinaryTechLabs Sure- I am using the Nortek HUSBZB (originally planning to use ZHA - but If I can make Zigbee2MQTT, that is fine too). It is one of the listed supported devices for ZHA (identifier = 10C4:8A2A). It's the only USB device in the system but as it also has a zwave controller, it shows as being on "/dev/ttyUSB0" and "/dev/ttyUSB1"

    • @BinaryTechLabs
      @BinaryTechLabs  2 года назад

      Yea, you won't be able to connect that hub somewhere else and expose it to your container. But it is zigbee, so put it in the system using home assistant and if you drop a couple zigbee routers around you can expand your zigbee mesh network and cover further distances.
      This is a great site for reference and compatibility
      zigbee.blakadder.com/

  • @lemoncryptonfa4980
    @lemoncryptonfa4980 10 месяцев назад +1

    Is it possible to add tailscale to Home Assistsnt container version?

    • @BinaryTechLabs
      @BinaryTechLabs  10 месяцев назад

      Yes it is, just like the other "add-ons" you can find the docker-compose setup for tailscale

  • @Danish3Cubed
    @Danish3Cubed 6 месяцев назад +1

    You need to ad more details about the folders and how to do that, because all noobs like me dont know how to deal with that in Linux...

    • @BinaryTechLabs
      @BinaryTechLabs  6 месяцев назад

      Thank you for that opportunity and feedback. I will definitely add that into future updates. What specifically were you struggling with?

    • @Danish3Cubed
      @Danish3Cubed 5 месяцев назад +1

      @@BinaryTechLabs Well, I was trying to install Home assistant, mqtt and zigbee2mqtt on a dietpi installation. Where docker and mqtt was installed along the DietpiOS. I managed to get Homeassistant running, but adding the others and making it function with the Mqtt installed by the installer, turned out to be to much with ZERO Linux experience and trying to make the containers talk to each other was just to hard without a reasent guide on setting this stuff up. After working pretty much 2 days straight I had to giveup and install Home Assistant OS instead. This is also pretty hard and not as easy as I was expecting, but I'm all ready further along then I was with the dietpi installation. I was watching your video to try to understand how linux is working about file structure and so on, but was missing stuff like how to navigate around in the folders how to view folders and so on. All the basics, understanding the structure without being able to use the knowledge is only painfull. 🙂

    • @BinaryTechLabs
      @BinaryTechLabs  5 месяцев назад

      Thanks for sharing this, I'll try to add some more information on navigation and file structure for future videos

  • @emmanuelauffray8292
    @emmanuelauffray8292 2 года назад

    Hi there
    Thank you very much for the repo and video.
    I have a question though on how to successfully register ESPHome devices in Home Assistant in this setup.
    I managed to get the ESPHome devices recognised after adding the ESPHOME_DASHBOARD_USE_PING=true as environment var but still can't get to disccover the ESPHome devices in HA..
    Any clue to what I am missing?
    Cheers

    • @BinaryTechLabs
      @BinaryTechLabs  2 года назад

      Hey there, thank you. Now have you tried adding the esphome devices from the integrations page, found from configuration - > integrations

    • @emmanuelauffray8292
      @emmanuelauffray8292 2 года назад

      @@BinaryTechLabs yep
      Fails regardless of the name or IP provided for the ESPHome server. From memory, the error message returned complains about API although I do have an online device with homeassistant integration enabled I.
      e. an API section in it's config.

    • @BinaryTechLabs
      @BinaryTechLabs  2 года назад

      Maybe I am miss understanding your question. Can you explain in detail what your trying to do, please.

    • @emmanuelauffray8292
      @emmanuelauffray8292 2 года назад

      @@BinaryTechLabs Sure
      So context first, I am setting this up on my Windows Device (win 11 WSL2) before migrating this to another host.
      So I have the docker-compose running with as mentioned the follwoing added for the esphome container:
      environment:
      - ESPHOME_DASHBOARD_USE_PING=true
      The rest is as per your video. So in ESPHome I managed to get an online device and then try to hook ESPHome to HomeAssistant.
      So In integrations, I try to add ESPHome to get the native API integration (hopefully) by trying to set the IP address of the ESPHome container and port.
      And then now I realise that I need to set the ip of my ESP and not of ESPHome itself.
      So in a nutshell I thank you very much :D

    • @BinaryTechLabs
      @BinaryTechLabs  2 года назад

      😁 well I'm glad to hear that you got it working, and I even learned from you about the ping=True thing.

  • @bostjanvovk6022
    @bostjanvovk6022 2 года назад +2

    Thanks for the video, I followed through and I seem to be able to make everything work apart from usb port mapping/location.
    I tried the modification of compose file as suggested somewhere:
    devices:
    - /dev/ttyACM0:/dev/ttyACM0
    I can find the ID of port, but not the port name itself btw.
    In your demo this issue was not mentioned. What wrong?

    • @BinaryTechLabs
      @BinaryTechLabs  2 года назад

      What OS are you running for docker?

    • @bostjanvovk6022
      @bostjanvovk6022 2 года назад

      @@BinaryTechLabs Ubuntu 22.04

    • @BinaryTechLabs
      @BinaryTechLabs  2 года назад

      Ok you have tried to open terminal and type: ls /dev/tty*

  • @mostafamenshawy3488
    @mostafamenshawy3488 Год назад

    I'm new to HASS and Docker. I had a previous set up with all images in a docker-compose.yaml file including Portainer itself and so as a result I saw that Portainer had a limited functionality over the other containers so I went with the stack method. Since I'm using the community edition of Portainer, I believe I won't be able to automatically pull new images and update containers and I will have to do this manually in Portainer. Question is, is this still doable using docker compose pull and up?

  • @praca1736
    @praca1736 Год назад

    I followed the instructions, but with a deploy = error, where can I find the error log?
    I have it exactly according to the instructions, but I don't have containers

    • @BinaryTechLabs
      @BinaryTechLabs  Год назад

      What is the exact error message?

    • @praca1736
      @praca1736 Год назад

      @@BinaryTechLabs
      deployment error
      failed to deploy a stack.
      this
      i do you need to create those directories? for example, when I wrote the road
      /home/pi/dockconf/homeassistant
      thanx

    • @BinaryTechLabs
      @BinaryTechLabs  Год назад

      Yes, those directories need to be created

    • @BinaryTechLabs
      @BinaryTechLabs  Год назад

      And typically it will give more on the error. If it's a stack, comment out the additional images and uncomment them one by one, stopping and redeploying them to see which is causing the problem.

    • @praca1736
      @praca1736 Год назад

      @@BinaryTechLabs no, it only gives one message, that's why I asked if there is another log somewhere
      I'm going to create directories