Home Assistant, The One To Rule Them All. An Advanced Guide - 10 Steps - Instructables
Home Assistant, The One To Rule Them All. An Advanced Guide - 10 Steps - Instructables
Home Halloween
Assistant, - Aretoyou
the One brave
Rule Themenough to join us Guide
All. an Advanced for a month of scares
by farmer1998h (https://www.instructables.com/halloween/)?
(/member/farmer1998h/) Follow
Projects
(/projects)
Contests
(/contest)
Teachers
(/teachers)
Download Favorite w I Made It
Log In(https://www.instructables.com/account/login/?nxtPg=) Sign U
(/) (/search)
Flag
Add To Collection
Add To Contest
(https://www.instructables.com/contest/classroom2023/?instructables)
3,519 13
Download Favorite
auto=webp&frame=1&width=1024&height=1024&fit=bounds&md=2139daa588e96677d5dd1f077a16b2a9)
(https://content instructables com/F83/5UCM/KZO52KED/F835UCMKZO52KED png? auto=webp&frame=1&width=1024&h
(https://content instructable
This instuctable was written as part of an assignment for the HAN University
of Applied Sciences.
Nowadays more and more devices in our homes become smart. Lights,
switches, vacuums, basically everything electric. Only alle these devices are
either made by different companies, all using different apps and servers. Or
the devices are too expensive for the average user, while they could be easily
made by yourself.
If only we could combine all these devices from different manufacturers, and
also add our own DIY devices… oh wait we can:
Want to make sure the lights are on in the house when you get home Add To Contest
(without also telling google/amazon)? Done.
The options with home assistant are unlimited, and most products don’t
even require any scary coding. They do however require some configuration.
Before going any further it’s wise to read through the official installation
guide from Hassio so you can get a better idea of the possible platforms from
which to choose:
https://www.home-assistant.io/installation/ (https://www.home-
assistant.io/installation/)
Keep in mind that home assistant has an excellent backup and transfer
system built in. This means that in case your chosen platform wasn’t as great
as you thought, transferring it to another system only takes a few minutes,
installation not considered.
For beginners and people not familiar with Linux the best way to start with
Home assistant is going with a raspberry pi.
Requirements:
· Raspberry pi 3 or 4 (4 is better)
· Quality
Home Assistant, the One to Rule Them (!)
All.SD
an card, 32Gb
Advanced or more
Guide by farmer1998h (/member/farmer1998h/) Follow
· Installation tools (PC with SD card reader and some patience) Add To Collection
The folks at Hassio have already made an excellent guide, so explaining it Add To Contest
here would be pointless. https://www.home-assistant.io/installation/raspbe...
(https://www.home-assistant.io/installation/raspberrypi)
While the Pi is an excellent starting point, it isn’t exactly a solid solution for all
users over a long time (2+ years). In my experience once your installation
starts to grow as you add more and more devices and services, the pi simply
can’t keep up anymore. Added to the fact that SD cards only have so many
read/write cycles which can run out fast with a setup running 24/7, replacing
the pi with a more robust solution is a must once you’ll get the hang of it.
For the users that only connected a few lights and sensors and aren’t
planning on going large there is also the option to switch out the SD card for
a USB hard drive or SSD as explained over at Tomshardware:
https://www.tomshardware.com/how-to/boot-raspberr...
(https://www.tomshardware.com/how-to/boot-raspberry-pi-4-usb)
There are multiple ways to install Hassio on a PC, I however advise to use the
supervised version. While the installation might be a bit harder, it makes
usage later a lot easier as you don’t need to mess with linux settings or
docker containers and get the same exact experience of a raspberry pi
installation with the added benefit of more computing power and storage.
Requirements:
The requirements for this type of installation are a bit more vague, and also
depend on the usage. I suggest a machine with at least:
· Dual-core CPU
· 4 Gb of DDR3 RAM
· 32Gb
Home Assistant, the One to Rule of All.
Them HDD/SSD storage.
an Advanced Guide by farmer1998h (/member/farmer1998h/) Follow
I myself use my old acer aspire 7560 laptop with an SSD. Using a laptop Flag
decreases the footprint and noise of the machine quite a lot. Keep in mind
however that closing the lid of a laptop in most cases puts the system in Add To Collection
sleep mode, so either disable it in the linux settings or keep it open. Add To Contest
Once again the installation guide is provided by the Hassio crew at:
https://github.com/home-assistant/supervised-installer
An added benefit of going the PC way it that you can use it for other things
too. As the supervised installation uses docker at its base, you can also install
other docker containers (as long as the system can keep up with the
combined load). I myself have also installed a Plex server on the system for all
my stored movies and series. And before you wonder, yes you can add plex
too as a sensor in Hassio.
(https://content
auto=webp&frame=1&fit=bounds&md=d2b94f1ff8c614a52ba0fcf0e613ccf9)
instructables com/F2L/YTEX/KZPKGN6V/F2LYTEXKZPKGN6V png?
If the installation went successful you’ll now see a pretty interface at either
homeassistant.local:8123 or http://(ip_address_of_device):8123. Follow the
instructions on screen and create a login account, give your installation a
name and select your location on the map. Skip adding devices for now, as
we can do that later. If everything went well you’ll now see the main page.
Before
Home Assistant, the One to Rule going
Them All. anfurther,
Advancedclick onbythe
Guide user in the
farmer1998h bottom left corner.
(/member/farmer1998h/) This
Follow
will
bring you to the user settings. Here select your preferred light/dark mode
Download
and interface colours, and enable the advanced mode setting. Clicking on
Favorite w I Made It
Sometimes to get stuff working in Home Assistant we need to edit the Add To Contest
configuration.yaml file. This can be found somewhere on the server, but its
easier to add a file editor straight to the dashboard.
Click on the configuration menu(gear icon). This will bring you to the menu.
Select Add-ons, Backups & supervisor. Now click the bottom right “add-on
store” button. This will give you a list of available add-ons. I definitely advise
you to take a look at all the add-ons later on, as explaining them all here will
take days.
For now the file editor addon will do just fine, so install it by clicking on it and
pressing install.
After installation make sure both start on boot and show in sidebar are
turned on.
To edit the configuration.yaml simply press on the wrench addon on the left
bar, click the map in the top left and select the configuration.yaml
Flag
Add To Collection
Add To Contest
(https://content
auto=webp&frame=1&fit=bounds&md=ed58e4a60
instructables com/FMX/26UC/KZPKGN
(https://content
auto=webp&frame=1&fit=bounds&md=15c24c34643368775cbb56407dfd44cd)
instructables com/FWY/RVMU/KZPKGN6Y/FWYRVMUKZPKGN6Y png? (https://content
auto=webp&frame=1&fit=bounds&md=ed58e4a60
instructables com/FH7/LXOZ/KZPKGN
Most of the non-DIY devices you’ll add will be done through the integrations
tab (found under configuration -> devices and services or
{ip}:8123/config/integrations). Some devices might already been found by
the system,
Home Assistant, the One to Rule Them All. others needGuide
an Advanced to bebyadded through
farmer1998h the add integration
(/member/farmer1998h/) Follow
button.
Here you can find a list of devices that can be added out of the box through
the interface. Simply click through the settings and you’re done.
Download Favorite w I Made It
All these devices or services are based on internet communication. However Flag
some devices are too simple for Wi-Fi, or don’t have the battery capacity to
Add To Collection
run Wi-Fi for months on end using only a little battery. For these devices we
can use other protocols, which we'll discuss later. Add To Contest
(https://content
auto=webp&frame=1&fit=bound
instructables com/FZ
auto=webp&frame=1&width=1024&height=1024&fit=bounds&md=de22aad527573ae5528b2de4612ba4b0)
(https://content instructables com/FE2/GIXV/KZQZVRWA/FE2GIXVKZQZVRWA png? (https://content
auto=webp&frame=1&fit=bound
instructables com/F
To make controlling your devices from the interface easy, you can add cards
to your dashboard. This can be done by pressing the 3 dots on the top left of
your main menu -> Edit Dashboard. Now Press the "Add card" button in the
bottom left corner. This will present you with all different card options (Note:
every card can only work with certain entities). for now select the "Entities"
card. Under "Entities (Required)" you can select the desired entities. Press
save after you're done! The card will automatically turn it into a switch or a
state if needed
Flag
Add To Collection
Add To Contest
(https://content
auto=webp&frame=1&fit=bounds&md=836397f5b
instructables com/FUX/VGDK/KZPKG
2 More Images
(https://content
auto=webp&frame=1&fit=bounds&md=c1251fc3a48712918a5577a869e2fbac)
instructables com/F78/QFMR/KZPKGNGY/F78QFMRKZPKGNGY png? auto=webp&frame=1&width=1024&fit=bounds&md=c08
(https://content instructables com/FNS/Z3WT/KZPKG
Nowadays more and more devices use the ZigBee protocol. It works
somewhat like Wi-Fi, with multiple devices talking to a central receiver, only
the devices can also relay each other’s signals. This means devices can be way
out of reach of the main receiver, as long as there are devices in between.
Zigbee is also built around power efficiency, battery powered devices can
run for months of a single battery, transmitting only when needed.
To use ZigBee with your home assistant network, you’ll need a receiver. This
can be either an USB-stick connected to your server, or a standalone device
connected to Wi-Fi.
On https://www.home-assistant.io/integrations/zha/ (https://www.home-
assistant.io/integrations/zha/) you’ll find a list of supported devices for the
ZigBee integration. Choosing the right receiver is a bit of a personal choice.
The USB-sticks can be easily set up and require no modifications, but are
expensive and their location is dependant on the Hassio servers location. The
standalone devices often require more setting up (some need to be opened
up and reflashed), but are cheaper and can be placed wherever there is
power and wifi.
As my home assistant server is in the very corner of my house. However, for Flag
most people I recommend simple using one of the USB-devices listed.
Add To Collection
To install the Zigbee system simply select the ZigBee integration in the
Add To Contest
integration menu, and select the correct USB device from the drop down
menu.
If you decided to use zigbee in your home assistant setup I highly advise you
to buy some ZigBee Sonoff motion and temperature/humidity sensors, as
they can be very useful later in automation, and are very cheap and small.
aliexpress.com/item/1005002390399376.html
To add a new ZigBee device click the configuration button in the integration
menu, then click ‘Add device’ in the bottom left.
Put the device you like to add in pairing mode (this depends on the
manufacturer), For the Sonoff devices this can be done by removing the
battery isolation strip, reinserting the battery, and holding the reset button
for 5 seconds till a red led starts flashing. After a few seconds a new device
should appear on screen and the devices is added to your system. In the
popup you can also assign a room and change the name of the devices.
Step 6: RFLink
(https://content
auto=webp&frame=1&fit=bounds&md=c50d21
instructables com/FYV/B4BL/KZPKG
Home Assistant, the One to Rule Them All. an Advanced Guide by farmer1998h (/member/farmer1998h/) Follow
Flag
Add To Collection
Add To Contest
5 More Images
Another way to control your smart home devices is by using RFLink. You
already might know devices that use this communication protocol, mostly as
433/868MHz transmitters/receivers like KlikAanKlikUit or those generic
remote controlled power sockets.
These too can be controlled by Home Assistant (with the right equipment),
and you’ll probably already have some in your house right now. And its not
only the sockets that can be used, the remote too can be connected to Home
Assistant to be used for all kind of useful things.
Getting it running
To send and receive RFLink commands you’ll need a transmitter. This will be
achieved by uploading some code to an Arduino Mega, with an appropriate
transmitter/receiver shield.
To build the transmitter, you can either choose to buy a kit provided by the
developers:
https://www.nodo-shop.nl/nl/rflink-/159-rflink-ard... (https://www.nodo-
shop.nl/nl/rflink-/159-rflink-arduino-dipool.html)
Receiver: aliexpress.com/item/4000065229076.html
Transmitter: aliexpress.com/item/4000018571977.html
(https://www.rflink.nl/wires.php)
Add To Collection
You can simply connect some wires to the modules and the arduino, or use Add To Contest
some protoboard and turn it into a shield like I did.
To upload the code to the arduino mega, simply download the latest version
on https://www.rflink.nl/download.php
(https://www.rflink.nl/download.php). Unzip the file and launch the
RFLinkLoader.exe, select the correct Serial Port for your device and press
Upload. After the process is done you can disconnect the transmitter and
connect it to your Home assistant server’s USB-port.
Now, open the configuration.yaml as discussed earlier and add the following:
rflink:
port: **usb-port**
wait_for_ack: false
Replace **usb-port**by the correct usb port for your RFLink. This can be
found by going to Configuration->Add-ons, Backups & supervisor -> System
(top), then press the 3 dots under the “Host section and click hardware. Your
device will be found under ttyUSB.
To reload the configuration.yaml and enable RFLink simply restart the device
(Configuration->settings->restart, or do it manually from the machine itself ).
After this any device that sends a signal and is supported by RFLink will
appear (under a somewhat random name) in the device list. To save the
device to your system, find the name of the signal (configuration -> Devices
& Services -> Entities(top)) and add it to your configuration.yaml like in the
image.
Flag
Add To Collection
Add To Contest
2 More Images
(https://content
auto=webp&frame=1&fit=bounds&md=471c52cb472
instructables com/FT9/6O9B/KZQZVQZ
While it’s fun to have all your devices at one place, in the end you’re only
moving the switch to turn it on. The real fun of Home Automation comes
with, well… automating it.
Introducing automations
Home assistant has a lovely automation system built in. it can be found
under the configuration settings -> Automations & scenes.
To begin your first automation, you can press the add automation button in
the bottom right cornet of the automation menu, after which a popup will
show asking you to either use a blueprint or start with an empty automation.
Select the empty automation.
· New Automation;
· Triggers;
· Conditions;
· Actions.
Setting
Home Assistant, the One to Rule up
Them All.an
anautomation might
Advanced Guide look complicated,
by farmer1998h but once you’ll
(/member/farmer1998h/) Follow
get the
hang of it its quite easy.
Download Favorite w I Made It
New automation.
Flag
Here you can give your automation a name and a description. Be sure to give
it a proper recognizable name, cause once you’ll get the hang of it the list of Add To Collection
automations can get Quite big. Here you can also select a mode. The mode Add To Contest
dictates what happens to the automation if it gets triggered again while it’s
still running.
Triggers
Here you select the trigger what triggers the automation. This can be a
sensor value, time, the sun and a number of other things.
Conditions
This is a condition that needs to be passed before the automation will run.
For example, the automation can be a timeframe, or the state of another
sensor.
Actions
This is what the automation will do if triggered and the conditions are
passed. This can be turning on or off a device, change a colour of a lamp, wait
some time and more.
An example
Flag
Add To Collection
Add To Contest
(https://content
auto=webp&frame=1&fit=bounds&md=e2964478a5
instructables com/FVJ/9I7L/KZQZVS
(https://content
auto=webp&frame=1&fit=bounds&md=fce15e9d8ec350180559b53cf8d4c031)
instructables com/F69/EE2B/KZQZVSWZ/F69EE2BKZQZVSWZ png? (https://content
auto=webp&frame=1&fit=bounds&md=fa5f56aa0c
instructables com/FGS/AOUN/KZWPOS
Another
Home Assistant, the One to Rule Them way
All. antoAdvanced
automate your
Guide home is to(/member/farmer1998h/)
by farmer1998h combine sensors into a climate
Follow
This can be done by adding the following to your configuration.yaml (replace Flag
climate:
- platform: generic_thermostat
Add To Contest
name: *name*
target_sensor: sensor.*temperature_sensor*
heater: switch.*electric_plug*<br>
Now you can add the thermostat by adding a thermostat card to your
dashboard and control the room temperature from there. This system will
now act as a normal house thermostat, keeping a room at the set
temperature.
(https://content
auto=webp&frame=1&fit=bounds&md=3bb439
instructables com/FUH/BFA6/KZWP
Home Assistant, the One to Rule Them All. an Advanced Guide by farmer1998h (/member/farmer1998h/) Follow
Flag
Add To Collection
Add To Contest
12 More Imag
While home assistant supports a lot of devices, it still can’t overcome the
main problem with smart home: the price. A simple 5 meter led strip for in
your room can easily cost between 50 upwards to 220 euro (looking at you
Philips). As a person that likes to cover every room in their pretty, purple
light. This is simply too much. So we need a better solution, and what better
solution is there than going DIY.
Introducing ESPHome
Installing ESPHome
Getting your first sensor set up can be a bit complex, so it might be useful to
take a look at their examples on:
https://esphome.io/guides/getting_started_hassio.h...
(https://esphome.io/guides/getting_started_hassio.html#adding-some-ba-
sic-features.) This should easily get you going with ESPHome.
TTGO boards.
Flag
Before starting you need to set up your Wi-Fi network. Do this by clicking the
Add To Collection
"Secrets" button in the top left. Here enter the following:
Add To Contest
wifi_ssid: "YourWiFi"
wifi_password: "YourPassword"
To start using ESPHome simply connect your chosen ESP to your computer
and start a new project by pressing the "New device" button in the bottom
left. This gives you a popup where you can give the device a name. After this
press Next, and then connect. ESPHome will then attempt to upload the
basic code to the ESP. A popup will show up where you can select the com
port for the ESP. If installation went well you should now be able to add the
required code to make your sensors work. You can ofter easily find the code
by simply googling the sensor + ESPHome.Once the code is added press
install, then either "wirelessly" or "Plugged into this computer". A bunch of
text should now appear on screen. Wait untill a green text, followed by a
purple text shows up. Should any red errors appear, check if the code is
correct, or the device connected to power and retry. After some time some
blue debug information should appear with the sensor data as seen in the
image. Check if these are within limits so see if your sensors are connected
correctly.
You should now also see a new notification at the bell icon. Click it and select
"Check it out". You should now see the newly discovered device on your
system. Press configure, then submit. Select the room the device will be in (or
skip it), and press finish. The device should now be done and the sensors
should show up.
An example
I bought some Tuya enabled Wi-Fi plugs. Nowadays these come with other
chips which makes then unusable in this case, but back then they used
simple ESP8266 chips inside. To Get them off of the Tuya cloud and into my
local system i reflashed the Chip inside with ESPHome. To get it working i
used the following bits of code:
binary_sensor:
- platform: gpio
pin:
number: GPIO5
mode: INPUT_PULLUP
inverted: True
name: "plug_3_switch"
internal: true
on_press:
- switch.toggle: relay<br>
This creates an binary sensor input on pin 5 of the ESP, which is connected to
a button. The button pulls the pin to ground when pressed, so we invert it
and make the default state positive with a pullup. The name set here is the
name
Home Assistant, the One to Rule under
Them which
All. an the Guide
Advanced button can be found
by farmer1998h in Home Assistant.
(/member/farmer1998h/) Internal:
Follow
true
makes the button invisible, so the status can't be read by Home Assistant.
Download
Remove this line if you want to read out the button anyways. on_press makes
Favorite w I Made It
it that the button executes a commend when triggered. In this case the
Flag
button should trigger the relay. If desired you can remove these 2 lines
together with the internal line and use the button as a regular switch sensor Add To Collection
This creates an output on pin 4, which is connected to the relay. Here the
name is the external name you'll see in Home Assistant, and id the internal
name used for the binary sensor.
status_led:<br> pin:
number: GPIO13
inverted: yes
This attaches the status led of the device to pin 13. The status led gives
information about the connection of the device.
Adding these 3 bits of code to the .yaml file for your device should turn it into
a simple controllable wifi switch.
Unfortunately even this guide only scratches the surface of Home Assistant,
so i definently recommend taking a look at their website https://www.home-
assistant.io/ (https://www.home-assistant.io/)
Below are some of the other things i definently recommend to take a look at,
that i unfortunately couldn't discuss over here.
https://www.home-assistant.io/integrations/duckdns... (https://www.home-
assistant.io/integrations/duckdns/)
https://www.home-assistant.io/integrations/google_... (https://www.home-
assistant.io/integrations/google_assistant/)
https://www.home-assistant.io/integrations/alexa/ (https://www.home-
assistant.io/integrations/alexa/)
Add To Contest
Recommendations
(/Build-a-DIGITAL-MAGIC-MIRROR/) (/How-to-Make-a-RC-P-51D-Mustang-Scaled-
Model-With-F/)
Build a DIGITAL MAGIC MIRROR (/Build-
a-DIGITAL-MAGIC-MIRROR/) by DIY How to Make a RC P-51D Mustang Scaled
Machines (/member/DIY+Machines/) in 3D Model With Fusion 360 (/How-to-Make-a-
8 29 1.8K
RC-P-51D-Mustang-Scaled-Model-With-
8 13 2.4K
(/contest/robotics2023/) (/contest/wood2023/)
Add Tip
V Ask Question
| Post Comment
Add To Contest