У домашней автоматизации есть умное устройство
Действительно предполагает последний
Кажется несколько лет
Каждое устройство, которое вы покупаете, имеет тип устройства
С умными навыками и этими устройствами
Различные приложения и услуги и
Хотя некоторые из них преуспели
Почему ты не используешь это?
Сегодня в этом доме называется помощник
Видео мы настраиваем как домашний помощник
Но не традиционным способом
Я установлю его на малиновый торт или
Давайте установим виртуальную машину
Сейчас доктор а потом
Kubernetes с фермером, так что вы можете
Автоматизируйте свой дом, как это
Переведите этот офис в темный режим
[Музыка]
С возвращением, так что я технический Тим и сегодня
Поговорим о домашней автоматизации
Используйте Home Assistant как быстрое напоминание
Я транслирую каждый вторник и четверг
Saturday so if you want to continue the
conversation about home automation there
we can so let's talk about homeless
system so home assistant is an
open-source home automation platform it
puts your privacy first by allowing you
to connect and control your devices on
your local network and because it's open
source it's powered by a community of
enthusiasts and DIY tinker's it has
support for lots of devices has a great
UI and a mobile companion app and allows
you to do some of the things that even
the big companies won't let you do so
join me in this tutorial as I walk
through setting up home assistant first
we'll start by spinning up a docker
container and then we'll move on to
Cooper Nettie's using something called
Rancher now if you need help setting up
docker kubernetes and Rancher I've got a
complete tutorial on how to set this up
it will walk you through all the
necessary steps to get started and it
only takes about 15 minutes to get going
but if you just want to use docker I'm
gonna cover that too so with that out of
the way let's get started so once you
have doctor running you'll want to SSH
into your server then you want to create
a directory for your home assistant
config so we'll M cater all assistant
make sure it's there next we'll want to
go out to the home assistant website and
look at the docker commands we'll see
right here the docker commands for Linux
it's pretty straightforward
so first we're gonna run docker as a
daemon then we're gonna name this
container home assistant then we're
gonna set a time zone and then we're
gonna link a volume so a path on our
server to the config to the containers
config folder then we'll want to use
host based networking this is really
important and then we're gonna use the
docker image home assistant with the tag
of stable and so if we wanted to run
this right now we would tailor this to
our needs and hit enter and we would
have home assistant up and running and
you're more than welcome to do that now
but I'm gonna cover a little bit of
docker kubernetes and Rancher and then
I'll hop back into some configuration so
if you're running Rancher you'll want to
go into the UI they will want to go into
our cluster into the default namespace
and here we'll want to deploy a new
workload so we'll click deploy so let's
map this docker command to a kubernetes
in Rancher workload so first we're gonna
name a home assistant next we're gonna
set the docker image that's right here
it's home assistant slash home -
assistant using the tag of stable we'll
keep this on the default namespace and
on port mapping we aren't gonna map
anything here that's because we're gonna
use host based networking so this will
expose all of the ports needed on the
host that we're running which is nubu -
server so we'll skip that for now next
is environment variables so let's add
one looks like we only have one here
which is our timezone is one TC Amerika
Amerika Amerika
/ chicago and you'll want to tailor this
for your needs next we'll need to add
some volumes what santa volume so I'm
gonna choose by mount a directory from
the node you can add a persistent claim
or anything else here but this is the
easiest path for me so by mount a
directory from the node let's name this
own assistant so path on node this is
gonna be the folder that we created so
let's look at our server and see where
that lives
PWD okay so it's slash home slash techno
Tim slash home assistant let's paste
that in here and then the mount point
this is going to be the mount point
inside of the container and that's right
here it's slash config
so scaling an upgrade policy I usually
set this to kill all pods then start new
and then we're missing one more piece
it's the host based networking and you
don't see it here but it's in the
Advanced section let's go to show
Advanced Options go into networking and
right here use host network namespace
set that to yes no that's really
important so be sure and do that so if
everything's set we can click Launch and
it's spitting this up let's go into the
events and it looks like it's already
running so now we'll go out to the IP
address of our Rancher server so for me
it's 192 168 0 to 11 and then we'll use
the default port for home assistant
which is 8 1 2 3 so once you land there
you'll be greeted with the onboarding
screen so let's set our name here and
let's set our username and a password
next we can name our home and we can
choose our location you can have it auto
detect but I'm just gonna use the map
some way over here
here we go Minnesota so you want to set
the elevation
I think we're 866 meters up and then
you'll want to choose your unit system
if you're in the US we use Imperial so
in this descri Nant already discovered
some of the services that I'm using so I
do use Wemo devices
I do use Google owned devices and I do
use Phillip too so you can choose more
here and set up some manually but I'm
gonna choose finish ok so very quickly
we have home assistant setup and we're
on our dashboard I'm gonna choose yes
here to stay logged in so on the
previous screen you'll notice that it
discovered some devices and some
ecosystems that I use here in my
household so let's finish configuring
those so go to configuration will go to
integrations and here you'll see the
integrations so first I'm gonna
configure my Wemo devices I have quite a
few here in my house so let's click
configure submit ok so it created the
Wemo configuration so let's see if it
discovered any of our devices going
devices nothing there
entities nothing there so this seems to
be common with Wemo devices but it's
pretty easy to fix so let's go back into
our server into
home assistant folder and you'll notice
we have a bunch of files now you'll see
your configuration yam will file let's
actually edit that so if we edit this
file we can see a little bit of
configuration the way I have fixed Wemo
devices is to actually add a little bit
more configuration here and here's how I
figured it out
I went to the home assistant
integrations page I searched for Wemo
found this integration and looked at
some of the documentation so here it
looks like we need to set a Wemo
property and then set discovery to true
so let's copy this out let's add it here
to a configuration yamo file save it
exit and then let's restart our home
assistant that's right here in
configuration server controls and
restart ok if we go back into
configuration go to integration and you
can see here that even after that I
still don't have any devices and I've
run into this before seems like some
Wemo devices kind of need a kickstart so
let's list one manually and see if that
fixes it so if we go back to the
documentation so we can set the Wemo
property discovery flag of false and
then a static list of IP addresses so
let's do that
this is edit this again and you'll want
to be sure to set the IP address to one
of your Wemo devices save that will
restart your server again and a really
quick tip if we want to see what our
servers doing we can go into Rancher we
can open up this pod and we can go to
view logs and we can watch and see what
it's doing if we go back to the devices
hey there's one of my devices
there's my garage door but it's still
not discovering all of them so here's
what I did in this case go back into the
configuration and now I'm gonna set the
discovery to true
close that we start again let's look at
the logs we see some Wemo stuff listed
here and we'll still see one device now
this isn't typical of home assistant I
noticed that we more devices can be
flaky sometimes but we'll continue with
this and we'll see if it fixes itself so
it did notice that sometimes you have to
actually configure your rooms before
these get discovered so I'm gonna
configure my Google devices and it
should auto discover some rooms
let's hit configure yes so it discovered
some of my devices okay so this is in a
living room this office hub is actually
in the office which I don't have the
bathroom display yes we have a Google
home in the bathroom it's to listen to
music so let's add one bathroom and then
our kitchen display which is kitchen so
that's configured so we added four
additional devices now okay and so if we
wait long enough I think the home
assistant Wemo plug-in will discover all
of our devices so here they are so you
can see a lot of my devices listed here
you can see my gaming lights if I click
this button it should have kicked on my
gaming lights back there we turn it off
turn them off and we can do the same for
these other devices here but let's go
back to our integrations so if we go to
configuration integration so you see it
just discovered my samsung tv
now we need to press the button on this
and this is way in the basement so I'll
be right back
see if that worked okay so I realized
you have to be very fast on that step I
tried that three times and it still
didn't work so it doesn't seem to be a
problem with home assistant or Phillip -
you just have to be really fast a lot
faster than normal
Phillip to time outs so anyways after
it's configured you'll see Phillip - now
has some devices and entities and so if
we go into this entities we can see all
of our devices so I have three globe
lamps I have a huge play left and right
and I have a table lamp and so if we go
back to overview we'll see our lights
listed here so I can toggle this table
lamp which is right behind me there it
goes toggle it back on and then I can
toggle all the lights off and toggle
them back on or individuals or I can
adjust the colors so the table lamp
color wheel go green lowish purple pink
red orange yellow green or just the
color temperature or the brightness
so now that we have all of these new
devices discovered let's add them to
rooms so let's go into configuration go
into devices and you can see that some
of these devices don't have an area so
let's fix that so we'll go into
configuration will go into devices and
we'll click each device well click on
this gear and let's add it to an area so
I don't have an area for my outdoor
lights so let's add a new area just call
it outdoors and we'll want to do this
for each device
okay it looks like I got all of them
assigned so now that we have all those
set let's create some automation I want
to create an automation for this room
called dark boat in light mode in dark
mode I'll want to turn on a few Wemo
devices I want to change the scene and
Philips hue and in light mode I want to
turn off one of the Wemo devices and
then change the scene again and so both
Phillip - and home assistant both have
concepts of scenes
personally I don't want to recreate my
scenes within home assistant I'd rather
use the scenes that are created in
Philips hue now you're free to create
your own scenes but I have some already
that I'm going to use so here's how you
use a Philips hue scene with in houma
system okay so in order to set up that
seam with Phillip - we're gonna do this
we're gonna go into scripts we're gonna
create a new script I'm going to call
this one dark mode for action type we're
gonna set this to call service and so
the service is hue-hue activate scene
and so the surface data we're gonna pass
in a few things we want this to be the
group from our Philips hue group as well
as this scene from our Philips hue scene
so this would be group in your score
name it's office and they sing
underscore name gaming and we'll save
this and now if we go back into our
scripts we should be able to trigger the
script there it goes okay so let's make
our light mode scene do the same thing
new script light mode we're going to
call a service and this is hue hue
activates scene and the service data is
going to be group underscore name office
and the same name
energize let's say that we go back to
here we should be able to trigger a
light mode now
there we go light mode dark mode so one
more thing I'll need to add to my dark
mode is actually triggering my lights to
soive the Wemo switch back there with
some RGB lights that actually turn on so
let's configure that going to edit we'll
add an action device gaming lights and
we'll turn them on
save that and for our light mode we'll
go in here we'll edit this add action
the device gaming lights and we'll turn
on okay so let's go back let's say dark
mode there we go now the lights turned
on switch to our light mode those lights
turned off and back to our dark mode and
those turn on and if we go back to our
dashboard we can see the script right
here and we can execute it from here to
dark mode
in light mode okay now that we got all
of that out of the way there's plenty
you can do you can configure individual
rooms scenes scripts and really tailor
this to the automation you want at home
so one last thing I wanted to show was
actually configuring this with your
mobile device so I have an iOS device
here so let's install it so we'll go
into the App Store and we'll search our
home assistant will download house out
okay once we get the app we'll open it
up you want to be sure you're on your
home Wi-Fi network here and you can see
it's suggesting our URL for our home
assistant server we'll click that we'll
click connect then we'll sign in using
our home assistant password
next you'll need to choose if you want
to give it access to your location so
I'm not sure why it's asking us to add
rooms when we have locations already but
let's add one name it office say that
next we'll add some devices now I'm not
sure why we need to add devices we
already have been set up must be a bug
in the app but for now let's just add
our two scripts light mode in dark mode
and there we go right on a device now we
can trigger these so if we say dark mode
there's our dark mode script and for
light mode there's a light mode script
so one quick call out here is that
you'll only be able to use this on your
local area network when connected to
your Wi-Fi now if you want to set this
up with a reverse proxy like traffic and
then add your own certificates using
let's encrypt and possibly your own DNS
using duck DNS you can go ahead and do
that but for me personally I'm gonna
access this over SSL VPN I already have
SSL VPN setup on my virtual appliance
and if you want to do that too I've got
a guide on that so to test this out it's
actually disconnect from Wi-Fi I'll open
up my open VPN client I will connect
wait for it to connect to my own VPN and
I'm using my mobile data right now not
my home Wi-Fi so now we're connected
let's open up home assistant again and
we should be able to trigger these start
mode and there's light mode so this is
going over the internet over SSL VPN
back into my home network and my home
assistant docker container and so you
can see how easy it is to set up home
assistant we got it running on docker
and neap in kubernetes and rancher in
just a couple of minutes and while it's
very easy to setup in your own home lab
and in your own home environment you're
probably gonna spend most of your time
configuring home assistant to meet your
needs but once you have it set up and
going you'll have a connected home and
it's very easy to add new devices so are
you using home assistant was there
something I missed or you'd like to see
in this video if so let me know in the
comments below and
as a reminder I stream every Tuesday
Thursday and Saturday so if you have a
question about this video or any of my
other videos hop in my stream and I'd
love to have you so thanks so much for
watching and till next time
Stream all my friends first time I ever
saw someone doing that I think was not
bit wet but it was level one text and so
I saw Wendell and level 1 Tex I think he
was setting it up with Nexus gamers and
then that's when I was like that looks
awesome I don't want to like Jam like
all kinds of hard drives in my server I
can just buy this thing and grow as a go
camera Jesus totally he is this neat huh
but uh I saw that in level one tax it
was awesome and then I was like I need
to know more and then I stumbled onto
the bit wit one where Wendell was
helping bit wit I was like this is
awesome
I wish window would help me because I
have no idea what I'm doing and then
then all of a sudden like snazzy you
know snazzy labs Quinn came out with one
I'm like ok now there's all these people
doing it I totally got to do it I think
Wendell helped him too um I had zero
help from Wendell I wish you would help
me cuz I have a lot of questions about
it but