Home Assistant on your Synology NAS

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome life with Matthew here previously I showed you how to run home assistant as an app bring on trunass but maybe you don't have a server just lying around that you could use or you don't want to dedicate the space to a server when all you really want is a basic file server that's a little more powerful than a Raspberry Pi and a little more power friendly than converting an entire old workstation into a dedicated true Nest box so today I'm going to show you how to get home assistant setup on a Synology Nas I've used Synology devices for around seven years now and I like them quite a bit I'm currently using the ds918 plus and let me just apologize real quick I hate it when I watch a video like this and find out the device they use can't be bought anymore like the Raspberry Pi or is outrageously expensive the ds918 plus is actually both of those things I bought this three years ago before a pandemic and rampant inflation hit if you're looking to get your first network attached storage device I can highly recommend this knowledge device there are models that are cheaper and actually in stock than the one I used just don't get a model that ends in a j or SE those are the low end models and they're not going to work very well for you the plus models are the top of their home or small office devices line and if you don't like the price tag I got good news for you just grab an old desktop and install trueness on it then you can use this video in the info card that I previously made to get you through but hey you didn't click on this video to listen to me tell you to use something else you're here to install home assistant on your Synology device so pull up your Synology devices web interface by going to the IP address of your device followed by colon and 5001 then log in until the past year you could install home assistant in a dock container using the official Synology Docker app in fact I use this method for my very first install of Home assistant however Synology released an update earlier in 2022 that disabled the USB ports on Synology devices for all except a very limited number of USB devices this means you cannot pass through any USB zigbee or Z-Wave or matter or thread or whatever device that you have into a darker container using the official Docker app there are some third-party repositories available to get back a slightly expanded amount of usability but I couldn't get this to work with my Z-Wave device and a future update could disable this bypass rendering your smart home frustratingly dumb thankfully there is a staple workaround that is not subject to braking and that is to create a virtual machine using the virtual machine manager app and run home assistant inside a virtual machine either as a Docker container or as a standalone install if if you haven't already set up virtual machine manager on your Synology device open up your package Center search for virtual machine manager and install the virtual machine manager package if for any reason you don't see this package I'm afraid it means your Synology device cannot run a virtual machine and you'll need to look into a different option for running home assistant considering how rare Raspberry Pi's are and how little CPU power they have when you can get them I would actually recommend getting something like the wise 5070 for around 120 dollars you can get a computer power supply and a small nvm.edrive and have a small solution for earning home assistant that uses barely more power than Raspberry Pi does for me I've already set up the virtual machine manager on my Synology device but if it's your first time launching it you'll probably need to set up a cluster and it's okay if you only have once knowledge device it's just going to be a cluster of one you'll also need to set up your storage location for your virtual machines and add in a network option if that isn't already Auto populated for you I'm just using the default VM Network now like I said we have two options for installing home assistant in the next section I'll install a VM to run Docker and you could skip to that section and install the AMD 64 hash i o supervisor Docker container this container is supposed to be the full home assistant operating system and a Docker container which means you could use that and actually use add-ons in home assistant in the stalker container which is basically letting you make a Docker containers inside the home assistant Docker container it's like a Russian nesting doll with Docker containers however when I set up this install of Home Assistant two months ago that Docker container did not work work at all and it was still a work in progress maybe it does by the time you watch this video but since that's not an option for me I'm going to use the second option of just making a VM to run home assistant on I could certainly run the regular home assistant Docker container but I'd like the extra control I get over my home assistant install by using a full virtual machine instance I don't have to wait for the docker maintainers to update the container when I want to install the latest version I just install it myself so I'm going to get the latest version of Home assistant by going to home Dash assistant dot IO and click on the getting started option then expand the installation option at the top click on the alternative entry on the table contents area on the right hand side of the screen click on the alternative entry again in the middle of the screen and download the home assistant operating system that is in the dot OVA format used by VMware esxi vsphere you can see that I've already downloaded the 8.1 version and that was back when I first set up home assistant this time I'm downloading 9.2 but since I did all this a couple months ago the version you're gonna download is probably newer don't worry about that since the process of installing it will be the same with the dot OVA file downloaded we're going to go back to the Synology web interface and return the virtual machine manager then click on the download Arrow by create and select Import in the window that pops up make sure the import from OVA files option is selected and click on next I'm going to upload this for my PC so I'll browse the location I saved the file to select the OVA file and click open next select the storage location you want to import the VM into and click next I'm going to let it use two CPUs and two gigabytes which is the minimum recommended values home assistant listed on their site for virtual machine install far I haven't had any issues with performance or delays in my automations but as your automation Network grows if you notice a slow down and responsiveness you can always increase the resources you've allocated to it everything else is fine so click on next since I'm importing the VM I have to leave the disk size as 32 gigabytes so hopefully you have plenty of spare room in your Synology device I'll leave the network as my default VM Network and entering the advanced options I need to make sure that the E1000 option is selected on my driver the VM being imported won't have networking otherwise for my other settings I'm going to make sure that auto set is set to yes and the firmware tide is set to UEFI now if you plan on using the built-in mqtt broker and zigbee or Z-Wave add-ons within home assistant then you're going to need to enable a virtual USB controller and select your USB device to pass into the virtual machine for me I'm going to use a separate VM running Docker container so I won't be passing in any USB devices so I'm going to leave the USB controller disabled I've created an automation user that I'll get permission to control the power state of the VM along with my own personal account and click on next to confirm the settings for this VM after making sure the power on the virtual machine after creation box is checked I'll click done to start the import of the home assistant OS VM once it's done importing it'll take a while to finish setting up the VM you can tell it's not done because no IPS are listed and it will be using a high amount of the cpu's processing power still you can connect to it at this point and watch as it starts up for the first time if you feel like it once it's done you'll be able to pull up the home assistant web interface by going to the IP address of the VM followed by colon and 8123 as you can see on the first boot it goes through quite a bit of setup so grab a bite to eat and come back when it's done when it's finished you'll see that home assistant uses much less the processing power of your knowledge device for me it idles around 1.7 percent go ahead and run through the first time settings of Home assistant like creating your username setting your home location and default units of measurement it will show you a list of devices it has already found that they can integrate with but all you need to do is Click finish to get into home assistant proper and that's how to install home assistant on a Synology device but personally I don't consider a home assistant install really complete until your setup control or get data from some kind of smart device so let's set up a second virtual machine that will run docker now I'm going to go over this section in a lot of detail while explaining what each command I put up on the screen does I want to make sure that you understand why I'm using the commands I use so that you can change them to fit your needs best and not just give you a magic combination of letters and symbols that don't work in a week when something changes leaving you stuck and frustrated if you don't need the extra information be sure to pay attention to chapter names and just skip to the parts that you need to get this going I need to create an additional virtual machine to host Docker remember I could have run home assistant from a Docker container or installed home assistant on top of Linux next to Docker but I chose to separate this into two parts specifically because I wanted to install the home assistant operating system that gives me the maximum flexibility and controlled over my home assistant setup and the software I'll need to control my smart devices such as zigbee to mqtt or z-wave.js to mqtt using Docker containers over the built-in add-ons with home assistant is only a personal preference of mine and not one you have to use personally I find the benefits of using dedicated software through docker containers over the easier home assistant add-on just outweighs the cons for my personal needs to set up your docker's virtual machine you'll need to add an ISO file to use as your operating system installer in synology's virtual machine manager you can either click on the add button and upload an ISO to your virtual machine manager for future use or you can copy over the file to a folder that the Synology device has access to for this install I'm going to be using Ubuntu 22.04.1 server to make the virtual machine you're going to click on create then select which operating system you will be using for Ubuntu that'll be Linux on the next screen select where you want to store the VM I only have one storage location in my cluster so I'm just going to click on next then I'm going to name my virtual machine Docker because I'm completely unimaginative if you plan on installing home assistant as a Docker container in this virtual machine instead of on its own dedicated virtual machine I'd give it access to two CPUs and two gigabytes of RAM minimum since I'm only using this VM for Docker containers with low resource needs I'll drop this down to one CPU and one gigabyte of RAM for Ubuntu make sure you change the video card from vmga to VGA vmga will crash Ubuntu every single time you can give it a description if you want but just click on next I like to get my virtual machine eight gigabytes of space because I'm not going to be using really anything on this VM but the minimum amount is 10 gigabytes so of course I'm going to give it 20 Gigabytes I don't know why my brain works the way it does click on the gear icon and make sure it's using the virtual iOS controller this should be selected by default but it never hurts to double check then click OK and next for Network I'm going to let it use the default VM Network which for me will Bridge it to my main Network as if the virtual machine was just another computer on my network if you click on the gear icon you can see it randomly assigns a MAC address and it's using the virtual i o driver for the network card the 1000 option like we used in the docker virtual machine emulates an Intel network card and is typically only used for older operating systems such as Windows 98 or when importing a VM that specifically requires it the rtl8139 option emulates A Realtek card that has a very wide range of compatibility that could be useful to try at the virtual i o option isn't being recognized by your virtual machine however both the E1000 and rtl8139 options come with additional overhead so whenever possible use the virtual i o option once you confirm these settings click on OK then next it's going to ask us for the ISO file used for the initial boot if you've added the iso to the virtual machine manager then click on the drop down menu will show you a list of all the isos you've added that you can select from alternatively you can click on browse and select your ISO from a folder that your Synology device has access to make sure you set auto start to yes this will make sure your Docker container actually starts back up after shutdown it makes for a very frustrating afternoon when the family is asking you when their lights will be able to turn back on only for you to realize that your zigbee to mqtt Docker isn't running keeping your zigbee devices from communicating with home assistant not that I've ever personally experienced that of course since the docker virtual machine will be used to communicate with our smart devices we need to pass in our USB adapter I'm using a Z-Wave USB adapter this time but the process is the same regardless of if you're using a Z-Wave zigbee thread matter or whatever device for the virtual USB controller I'm going to set this to USB 2.0 the reason for this is the Z-Wave USB dongle I'm using is USB 2.0 and I've noticed that sometimes USB 2.0 devices act a little janky if the virtual USB controller is set to USB 3.0 after selecting the USB controller type I'll get a new drop down menu option the number of options you see here will be depending on your Synology model my ds918 plus has two USB ports one on the front and one on the back there's nothing in the front USB port which is why it's currently saying unmounted I'll select the Silicon lab cp210x uart option as that's my Z-Wave USB dongle then I'm going to click on next it's going to ask which users are allowed to turn this VM on and off so just like the home assistant virtual machine I'm going to select the automation user that I've set up as well as the user account I made for myself the next screen is a summary of what you've selected so give it a quick review make sure everything's okay check the box that says power on the virtual machine after creation and then click on done it will take just a minute to create the virtual machine but once it shows powering on click on connect to launch a terminal session so you can walk through the installation process the Synology disk stations are definitely not powerhouses and this will take a few minutes to boot up into the installer but what it does it's a pretty straightforward install of a Linux distro you're going to select your language Let It update to a new installer if one is available select your keyboard layout and then select which version of button to you want to install I'm going to select the minimize version as I'm only running Docker on it any additional pieces of software I need I can install as the need of Rises elegant wait as it detects my network except I find weird since it just downloaded an updated version of the installer but whatever if you're using a proxy I assume you know how to enter this part but for me I'm not using any proxy so I'm going to leave it blank the default mirror address is fine so I'll click on done and I'll tell it to use the entire disk for the install but deselect set up this disk as an lvm group because I'm an old man who doesn't understand this newfangled lvm nonsense and I'm sticking to what I know for the time being the installer will give me a chance to confirm how I want my drive partitioned and this looks fine to me so I'll click on done and continued to let get on with the installation set up a username that you'll use to log into the virtual machine and give the computer a name while you're at it I'm putting this device at my mom's house and decided to name all the equipment at her place using Kardashian names so this guy's going to be terak Noor I'll select install openssh server to make working on this remotely a lot easier on me and on the next screen I'm going to select which software I want the installer to include which very nicely includes Docker itself you may have noticed that it also includes mosquito steel with two T's but that I didn't select it that's because I'm going to run it in a Docker container along with anything else I need for my home automation so having selected what I want to install on this VM all I have to do is hit done and then wait while it installs I suggest you go grab a cup of coffee or see your loved ones one last time before home automation takes over your entire life because for me this took 10 minutes also pay close attention to the top of the screen it doesn't make a big deal that it's done so you might sit there waiting for the screen to significantly change when the install is complete but it won't it just changes the top bar from installing system to install complete the last part of installing Ubuntu go ahead and let it reboot so we can get on with installing Docker containers on it just before it fully reboots however it's going to prompt you to remove the installation media and then press enter to do this you need to go back to your web interface on your Synology device and the virtual machine manager select your VM click action and then edit in the pop-up window select the others option and unmount the ISO file for boot up option then you can return to your terminal session hit enter and allow to reboot when it's done rebooting log in and run sudo apt update in sudo apt upgrade to get your system fully up to speed once it's done updating you'll need to install a few extra software packages enter sudo apt install git curl dialogue apt-utils qemu Dash guest Dash agent and your choice of editing software such as V or Nano personally I find that Nano is a bit easier to use for Miner edits so that's the one I'm going to go with Git and curler technically optional we're not going to be using them today but whenever I'm using a headless server like what we just set up I end up needing them so I installed them out of habit dialogue is also technically optional but it will prevent a bunch of annoying warning messages during the install process so you might as well get it once all the basic packages are installed the first thing I'll want to install is portaner because I like having the option of a web interface for managing my Docker containers over how to do everything from the shell script this makes making minor changes to your containers extremely easy so you don't have to save every Docker run command you use to install a container or lower in Docker compose but if you don't want pertainer then using Docker run or Docker compose files are both really great options as well before we install pertainer we need to make sure that the user account we've set up has access to slash bar run slash Docker dot sock but currently it's owned by root so we have no way of accessing it as things stands now I could add my user to the root group but a more secure way to do this is to create a new group and then change the ownership of Docker dot sock to that new group and then I'm going to add my user to the new group so that's exactly what I'm going to do first up run sudo group AD Docker to create a new group called Docker then run sudo change group Docker slash bar run slash docker.sock this changes the group ownership of the file docker.sock to the group name docker finally add the user you are logged in as to the docker Group by running sudo user mod Dash a dash capital G Docker then the username you want to add to the docker group for me they'll end up being sudo user mod Dash a dash capital G Docker Matthew then just be on the safe side I'm going to reboot the system to make sure that all the packages I've added and the groups created are fully in effect I'm also going to log in over SSH now instead of through the synology's web interface for the virtual machine as element copying and paste commands a lot easier on me once I'm logged in in my home directory I'm going to run maketer Dash p Docker pertainer the dash P option will create any directory that doesn't already exist all the way down to the final subdirectory which is portaner in this case then I'm going to enter the command to download and create my portaner Docker container this command is an encryption of the video and the command prompt truncated the third line for some reason so don't try to read this off the screen right now just go to the description of the video and copy and paste the command from there now if you're familiar with Docker you might want to skip to the next section but for anyone who's never used it before here's what the command is doing Docker run is going to create a new container with a name of portainer it doesn't really matter what you name it as this won't affect the operation of the container but I prefer to give it the same name as the container I'm downloading then we pass in two ports using the dash P flag they're going to be ports eight thousand and nine thousand these are the ports pertainer uses for its operation nine thousand specifically support will need to access pertainer's web interface if you want to access the web interface using https you'll also need to pass in Port 9443 you'll notice when passing import 9000 to The Container we list the port number twice with a colon in between everything on the left side of the colon is the port used on the host and everything on the right hand side of the colon is a port used on the docker container itself so in this instance we're going to map Port 8000 from the host and Route it to Port 8000 on the docker container this is just like port forwarding on your router this is a convenient feature in the event that several different containers use the same port number for instance imagine if two containers use port 80 to host a web interface I can map Port 80 for my host to Port 80 on the first container and then map Port 81 of my host to Port 80 of the second container from The Continuous perspective both are using Port 80 to host the web interface but from our perspective we're using ports 80 and 81 to access container 1 and 2 respectively next we're going to pass in two volumes with a dash V flag first we'll map slash VAR slash run slash Docker dot sock from the host to slash VAR slash run slash Docker dot sock in the container like the ports everything on the left hand side of the colon is used to reference the file or folder that exists on the host machine that Docker is installed on while everything on the right hand side is used to reference the file or folder inside the docker container that we are creating the next volume We'll add is a Docker pertainer folder we just made on the host and we're going to map it into the docker data folder one of the fundamental things about Docker containers is that they are designed to be created and destroyed on an as needed basis but as is creating destroyed and recreated you might want to keep some things the same like usernames and passwords used to manage pertainer I mean it wouldn't be very convenient if every time we updated our Port enter container we had to go through the setup process all over again by getting a folder to save key data to on the host instead of only storing it in the docker container we can keep certain settings consistent between Creations the same container next we're going to tell Docker that we want this container restarted always this so make sure that the container always starts back up after power loss or say a critical error crashes it now this can be a questionable setting in the event that a container is causing Docker to crash over and over again however I trust the containers that I'm going to be installing today so I'm using the restart always option the last thing we need to do with the docker run command is tell Docker the exact container we want to download and install and that's portaner pertainer Dash CE once the command is entered and you've made any changes that you deem necessary go ahead and hit return and Docker will download the latest version of the portaner container foreign you can check to make sure it started up correctly by entering Docker logs pertainer assuming you actually named your container pertainer if you named your portainer container something else you'll need to put in whatever name you used instead of pertainer for your container in the logs I can see that it successfully started the web server on ports 9000 and 9443 with no issues so I'm going to go ahead and pull up a new web page and browse to the IP of my Docker VM and Port 9000 to access the portaner web interface the first time you access it you'll have to set up a username and password that is at least 12 characters long and is almost absolutely guaranteed to be something ultimately useless that you'll never remember or it's going to be something that you let your web browser generate that has lost forever when you move to a different computer not that I have strong feelings about how modern password requirements make everything less secure or anything mind you anyways I don't need to add another environment as I'll only be working locally so we'll just click on local now I actually miss a step here that cost me a lot of problems later on but thanks to the power of movie Magic we'll just splice in that fix right now click on the pencil in the right hand corner and enter the IP address of your virtual machine that is running Docker without that IP address being correct you won't be able to access your containers through portaner so you better make sure this point that you've either assigned a static IP to your virtual machine or you've set up a DHCP reservation on your router for this virtual machine once you're done hit update environment anyways I'm going to hand things back off to pass Matt now that poor rube he has no idea what's in store for him with Docker installed and pertainer configured it's time to start setting up the docker containers that we will use to communicate with home assistant and our smart devices the first one that I really like to start off with is the mqtt broker called mosquitoes spelled with two T's it's an easy one to get going and it makes for a good litmus test to make sure everything is configured correctly so in pertainer click on ADD container and for the name put in mosquito spelled with two T's for the image I'll type in mosquito steel with two T's and click on search this will pull up hub.docker.io and find any container with the name you're searching for I want Eclipse Dash mosquito so I'll copy that Docker name exactly and paste it in where it says image it's vital that you copy and paste this exactly as it is on Docker Hub if you don't then portaner will not be able to find the docker image to download for network configuration I'm going to leave the option of publish all exposed Network ports to random host ports disabled and instead manually enter the ports I want by clicking on the publish a new network Port option and the port forwarding field that is now available I'll pass in Port 1883 from the host to Port 1883 on the container this is the default Port used by mqtt checking the configuration information for the mosquito container on Docker Hub I see that the docker run example it provides also passes in Port 9001 so I'm going to add that Port as well I can also see on the docker page that the docker run example they provided has the flag Dash it set which means that under command and logging I want to change the console options from none to interactive and ttty now one of the things I like about Docker Hub is that many of the containers give very detailed information about configuring their containers some give no information which is very annoying yes but mosquito gives you all the information you're going to need and here I see that there are three directories I want to map into the docker container so I'm going to remote into my virtual machine running Docker and create a folder that I can map into the docker container for mosquito currently I only had the pertainer directory so let's make a new directory in my Docker folder and we'll call that mosquito of course with two T's then in the newly created mosquito directory I'm going to create three more folders they're going to be config data and logs to match the three folder names we see in the docker Hub configuration example one last thing I need to do before returning to pertainer to finish setting up my mosquito Docker container is to create a configuration file for mosquito to use I need to places in config directory and use the text editor I installed earlier to create a file named mosquito.conf for me that means I'll enter Nano mosquito.conf then I'll paste the following into the newly created file of course I've included this in the description of the video if you want to copy and paste it instead of trying to write this out yourself by reading the screen for those interested in what this configuration file is going to do persistence true will make it save the configuration information to the directories we just created so that it persists even if you destroy and recreate your mosquito container persistence underscore location tells mosquito where it is towards files to persist this location is relative to the docker container and not to the host the mosquito Docker container has no way of knowing about the file structure of the host computer everything we've put here can only reference files and folders inside the container itself listener will set the port mosquito will listen for mqt messages on and lets you limit the networks that mosquito will listen for those commands from changing this to your network such as 192.168.1.0 24 is a basic security step to make sure Agents from outside your network cannot interact with your mqtt broker but personally I tend to take the stance that you have bigger issues if someone can enter your network and keeping it at 0.0.0.0 just makes your life easier at the very least I suggest only changing this after you have it up and running that way if it stops working you know exactly where you need to focus your troubleshooting efforts allow underscore Anonymous will either allow or block mqtt connections without a username and password like The Listener settings I prefer to leave it as true at first make sure I can connect to it and then set it to false and connect to it using a username and password that will set up here shortly that way I know it's working without having to worry you that maybe the reason it's not working is because I've set up the username and password incorrectly finally the password underscore file option tells mosquito where I'll be putting my username and password that will be used to allow devices to connect to Mosquito don't worry that this file doesn't exist yet we'll be creating it in just a minute but for now I'm going to change allow underscore Anonymous to true and comment out the password underscore file line to avoid any errors to save this file if you're using Nano hit control and O together and then control an X together to exit out Nano with the configuration file created go back to protainer and scroll down to the bottom and select volumes I'm going to click on map additional volumes three times to map the three folders We just made into my mosquito container for each volume we want to change it from volume to bind in the field for container we want to tell it the full path for the folder inside the container we want to map this will be the three folders that were listed on Docker Hub and our slash mosquito config slash mosquito slash data and slash mosquito log in the field for host we want to tell the full path for the folder on my host machine we want to map now since I'm using my home directory it might be tempting to enter the path as tilde slash Docker slash mosquito slash config but don't do this protainer does not allow the tilde in the folder path you'll need to put in the full or absolute folder path for this to work so for me this is going to be slash home slash Matthew slash Docker slash mosquito config slash home Matthew slash Docker mosquito data and home Matthew Docker mosquito log though be sure to change Matthew to whatever user account you've set up obviously now some containers let you add an environmental variable of TZ or TZ data to specify your time zone but it can be hit or miss to the best of my knowledge this is not a requirement that every container has to implement so instead I'm going to add in one more volume and pass slash Etc time zone for my host to the same folder in my mosquito container this will make sure that whatever time zone I set on my host will automatically become the time zone used in my container now I did mistakenly leave the volume as writable but I think it would make a lot more sense for it to be read only I want my container to have its time zone information updated by the host and I want some container randomly changing the time zone of my host going to the restart policy area I want to make sure that the container is set to always restart and with that everything should be set correctly so click on deploy the container it's possible that since the time I've made this either portaner Docker or the eclipse container itself has changed and requires a slightly different setting so if you get a failure message pay close attention to why it failed and check the container documentation on Docker hub for examples and information on what the container needs to deploy successfully if everything is set correctly after clicking on deploy the container portainer should return you to The Container list screen after a minute or two once it's done downloading the new Docker container and give you a success message before we actually set up a username and password to use when connecting to Mosquito let's make sure we can connect to it at all go back to home assistant and select settings then devices and services click on the add integration button in the bottom right hand corner and search for mqtt after clicking on mqtt it's going to give you several mqtt options we want the option that only says mqtt for broker enter the IP address of the virtual machine running Docker leave the port as 1883 and leave the username and password Fields blank click on submit and as long as you follow the steps in this video you should get a success message if you don't make sure you've entered the IP address of the virtual machine correctly and that you've routed Port 1883 from your host into the mosquito Docker container of course we're not going to leave the mqtt broker and secure like this so click on the ellipses for the mqtt entry and select delete it's time to set up a username and password I could do this through pertainer and connecting to the console like we just did but there's a second option that's good to know I've remoted into the virtual machine that hosts Docker and I'm going to enter the command Docker container exec Dash it mosquito slash bin slash sh this command opens an interactive shell session to the docker container with the name mosquito inside the mosquito container use the command mosquito underscore password Dash C for create slash mosquito slash config slash password.txt mqtt underscore user and of course this command will be in the description of this video if you just want to copy and paste it once you hit the enter button it's going to prompt you for password so enter something and then confirm that password for the user you're creating this will create a user called mqtt underscore user and it will store an encrypted version of the password you just entered into the text file password.txt enter exit to leave the docker container and edit the configuration file for mosquito by entering sudo Nano Docker slash mosquitoes slash config mosquito.com then change allow Anonymous from True to false and remove the comment from the password file line press Ctrl and O to save and then control the next to exit Nano then restart the mosquito container to apply the new configuration by entering Docker stop mosquito followed by a Docker start mosquito or you can do it from the portaner web interface back at home assistant re-add the mqtt integration as you did previously however this time enter mqtt underscore user where it says username enter the password you created for the user where it says password as long as you did everything correct you'll get the success message again alright guys we're in the home stretch now go back to pertainer's web interface since I'm using a Z-Wave device I'm going to install the z-wave.js to mqtt but if you're using zigbee the process for installing zigbee to mqtt is very similar I don't want to pay special attention to the part where we map in the Z-Wave USB stick into the Container first up click on the add container button in the top right of the screen the name I'll call it z-wave.js to mqtt and then copy and paste that into the image field to search for a container with that name now I thought the image I wanted was labeled z-wave.js slash z-wave.js2mqtt but when I clicked on it I got a warning that this image was depreciated so click on the link to go to the newer container named z-wave.js slash Z-Wave Dash JS Dash UI and copy and paste the container name and put that full name into the image field now unfortunately they don't provide any information on Docker hub for configuring this Docker container but if you click on the project documentation link under getting started there's an option for using Docker that provides a Docker run command that will provide me with everything I put into this section of the video back in Port tainer for restart policy I'll set it to always restart for command and logging I'll set the console type to TTY under environment there are two environment variables you can add the first will be session underscore secret which honestly I'm not 100 sure on what this does I've read through the documentation it says and I quote it is a secret used assign the session ID cookie it can either be a string for a single session or arrays of multiple Secrets if an array is provided only the first element will be used to sign the session ID cookie and the rest of the array elements will be used to verify the signature this is an optional environment variable and if it's not use the default value will be used all right I'm not a big fan of default values but I'm even less of a fan of entering configuration options that are poorly documented and I don't understand so I'm going to eventually delete this entry the second environment variable and one that is absolutely necessary will be z-wave.js underscore external underscore config it will be set to slash user slash Source slash app slash store slash dot config Dash DB which like the name States says the directory that will be used to store the configuration they'll let the files be saved external to the container we'll map that directory to a folder on the host in just a minute here there are also two ports that we want to forward the first portal forward is 8091 from the host to Port 8091 on the container this will be the port we use to access the web interface the second Port is Port 3000 on the host and we're going to afford that to Port 3000 on the container and that'll be used for communication from home assistant to z-wave.js2mqtt using websockets instead of mqtt under volumes click map additional volume change the type from volume to bind and then pass in ETC time zone from the host to the same folder on the container so our time zones remain synchronized between the host and container for the next volume we first need to create the folder on the host just like we did for the mosquito container so I'll pull up my remote session to the virtual machine hosting Docker enter the folder I've set up for holding my persistent data that I have imaginatively named Docker create a new directory called z-wave.js to mqtt and finally inside that directory create one more directory called store back in pertainer add another volume and we'll map in the full path to the folder we just made so for me that will be slash home slash Matthew slash Docker slash Z-Wave js2mqtt store and we'll want to change the type to bind and I just realized I put that in the wrong field like the name implies you want to put the folder that exists on your host system where it says host and the folder path for the folder that exists in the container where it says container so we'll just swap that around real quick to fix it and where it says container we'll want to put in slash user slash Source slash app slash door the last thing we need to do is go to runtime and resources and pass in our Z-Wave USB stick to do this we need to get the serial ID of our Z-Wave USB stick by using serial IDs instead of something like slash Dev tgy USB and then a number we make sure that the correct device is always passed into the Container even if the USB device number is connected to ends up changing somehow to get the serial ID go back to the remote session we've logged into on the virtual machine running Docker enter ls-l Dev serial slash buy Dash ID here you can see that everything in blue is the serial ID for my Z-Wave stick it's the only USB device on this machine since it's the only thing I passed into the virtual machine if you do not see your advice go back to the part of the video where I set up the docker virtual machine and look at the part where I pass in my USB device into the virtual machine to make sure you did it correctly once you do see it copy everything in blue and go back to the portaner web interface then under the runtime and resources tab click on ADD device if you haven't done so already and in the field next to host enter slash Dev slash serial slash buy Dash ID slash and then paste in the entire string you just copied in the field to the right of where it says container enter slash Dev slash Z-Wave this is the default location z-wave.js to mqtt uses for connecting to a Z-Wave USB stick so as long as you use it it will automatically connect to our Z-Wave USB stick without any additional modifications everything should be good to go so click on deploy container assuming everything is configured correctly it will take a few minutes to download the image before returning you to The Container list screen with a success message if there's an error you'll get a failure notification see what it doesn't like and fix it then try redeploying the container until it works and with that we've caught back up to the error I made when setting up portainer yay by not entering the environment variables that I'm sure you already did if you've been following along with this video password is trying to figure out why it's trying to connect to Z-Wave gs2mqtt using the IP of 0.0.0.0 on Port 8091 you can't tell how long this took for me to solve since I paused the recording of the video while I troubleshooted the issue but the answer is much longer than it should have if I had been paying attention anyways we'll skip over past Matt figuring out the problem and once he does and becomes present mat he can go back and laugh at pass math the same way we already have with the IP address correctly set I can now return to my container list and next to the Z-Wave GS to mqtt container I can click on the port number 1891 to launch a new window taking me to the web interface for z-wave.js to mqtt and you can see in the upper right hand corner that because I configured my USB stick correctly it already shows that z-wave.js to mqtt is connected to my Z-Wave USB stick I'm going to click on the gear icon to open up settings and change the UI to dark mode so I'm not being blinded then under the home assistant area I'm going to enable the Ws server or websocket server I'll leave the rest as it is for now and click on Save then in home assistant I'm going to return to settings then devices and services and click on add-on integration I'll search for Z-Wave and in the box that comes up deselect the checkbox that says use the z-wave.js supervisor add-on and click submit for URL change only the option that says localhost and put in the IP address of your virtual machine that is running Docker it should immediately find your Z-Wave USB controller and any device you add to Z-Wave gsmqtt in the future will automatically show up in home assistant now honestly there's a part of me that doesn't like how easy this is I would personally prefer an option to require authentication but to be fair I haven't had as much time to mess around with z-wave.js to mqtt the same way that I have with zigbee to mqtt so maybe it does exist and I just haven't found it if you'd prefer to use mqtt and require authentication instead of using the websockets back in the z-wave.js to mqtt web portal disable the Ws server then under mqtt change the host UL from localhost to the IP address of the virtual machine running Docker and toggle the auth option enter the the username and password you set up previously and hit save oh and I forgot to record this bit but under home assistant make sure that you've enabled mqtt Discovery and hit save again or else none of your devices will actually show up at home assistant which kind of feeds the purpose of setting all this up but honestly this is entirely optional you can use the websockets with no worries with that you're done you have successfully set up home assistant on Synology device along with several containers that will get you up and running for adding smart devices to your home assistant application and start automating your life which I guess now I think about it I should do a video showing some useful stuff to do with home assistant so look forward to that one that will come out Sunday whenever life allows be sure to subscribe for more and until the next time may the Lord bless you and keep you may the Lord make his face shine upon you and be gracious to you may the Lord lift up his comments upon you and give you peace amen foreign [Music]
Info
Channel: Life With Matthew
Views: 3,438
Rating: undefined out of 5
Keywords: home assistant, zigbee, z-wave, zwave, matter, nas, homeassistant, ha, mosquitto, mqtt, zigbee2mqtt, how to, how-to, tutorial, set up, detail, 3.0, z wave, zwavejs2mqtt docker install, docker install, docker, portainer, portainter docker install, zwavejs2mqtt, mosquitto docker install, Zooz 700, ZST10, ws, web socket, in depth, explain, explination, thorough
Id: kfiNWe4S1m4
Channel Id: undefined
Length: 45min 12sec (2712 seconds)
Published: Fri Jan 06 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.