0% found this document useful (0 votes)
212 views20 pages

Home Assistant, The One To Rule Them All. An Advanced Guide - 10 Steps - Instructables

This document provides instructions for installing Home Assistant, an open source home automation software. It can be installed on a Raspberry Pi or old laptop. The Raspberry Pi is recommended for beginners as it has a simple installation process. Home Assistant allows users to integrate different smart home devices and automate controls in one interface. It provides many options for automating lights, security cameras, and other devices to create a smart home system.

Uploaded by

RochmatBinSalim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
212 views20 pages

Home Assistant, The One To Rule Them All. An Advanced Guide - 10 Steps - Instructables

This document provides instructions for installing Home Assistant, an open source home automation software. It can be installed on a Raspberry Pi or old laptop. The Raspberry Pi is recommended for beginners as it has a simple installation process. Home Assistant allows users to integrate different smart home devices and automate controls in one interface. It provides many options for automating lights, security cameras, and other devices to create a smart home system.

Uploaded by

RochmatBinSalim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

23 Days Until

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)

Home Assistant, the One to Rule Them All. an


Advanced Guide
By farmer1998h (/member/farmer1998h/) in Circuits (/circuits/) > Remote Control (/circuits/remote-
control/projects/)

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:

Introducing Home Assistant.

Home assistant is an open source, self-hosted software package that runs on


many different platforms, giving you control over all supported smart home
devices at one place, giving you the option to combine multiple different IOT
devices,
Home Assistant, the One to Rule Themautomate then,Guide
All. an Advanced and by
also giving you
farmer1998h a pretty interfaceFollow
(/member/farmer1998h/) where you can
see and control it all.
Download Favorite w I Made It

Want to combine a Tuya power socket switch connected to a space heater


with a Sonoff Zigbee temperature/humidity sensor for an easy room Flag

thermostat setup? Done.


Add To Collection

Want to make sure the lights are on in the house when you get home Add To Contest
(without also telling google/amazon)? Done.

Want a text to speech message at 1 pm telling you your favourite cactus


needs more water? Done.

Combining your expensive security camera’s with a cheap wireless camera or


a usb webcam into 1 interface. Done.

The options with home assistant are unlimited, and most products don’t
even require any scary coding. They do however require some configuration.

 Add Tip V Ask Question | Comment Download

Step 1: Installing Home Assistant


Installing home assistant (Hassio) tends to change a bit through the years.
This guide will therefore not explain the full process, it will only point you in
the right directions.

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/)

Installing Hassio can be pretty simple, or pretty hard, depending on which


platform you choose. For most people the choice lies between using either a
raspberry pi (3b+ or 4) or an old laptop . There are also options to install
Hassio on an capable nas or regular daily driver pc, but I won’t cover those
there. Luckily the guys as Home Assistant got you covered and all
information can be found on their respective installation pages.

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.

Choice 1: Raspberry pi flavour (Beginners, non-Linux users)

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

· Good Power supply with a proper cable Download Favorite w I Made It

· Ethernet cable (Wi-Fi is possible, but not discussed or advised) Flag

· 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)

Simply follow the instructions under “Install home assistant operating


system” and you’re good to go.

Some things to keep in mind:

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)

Choice 2: PC master race (advanced)

A better but more advanced solution is using an old desktop or laptop as


your main system. It can also give a new purpose to your old PC collecting
dust in the corner.

Installing Hassio on a PC however requires some skills and some knowledge


of Linux and its terminal. While installing on windows or MacOS is also
possible, it either uses an inefficient virtual machine running Linux, or the
windows subsystem for Linux.

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

· Debian (preinstalled) Download Favorite w I Made It

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

An added benefit of installing on a PC is that changing the system is as easy


as swapping the drive.

Once again the installation guide is provided by the Hassio crew at:

https://github.com/home-assistant/supervised-installer

Some things to keep in mind:

In my experience the supervised installation is all you’ll need for Hassio,


without the hassle of using the linux system itself later on. It does however
require some occasional maintenance and updating.

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.

 Add Tip V Ask Question | Comment Download

Step 2: Setting Up the System

(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

overview will bring you back to the main screen.


Flag

Installing a configuration editor


Add To Collection

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.

To edit the configuration.yaml there are 2 choices of software, the more


simple “file editor” addon and the “studio code server” addon. Both are
perfectly capable of editing files, only the studio code server uses visual
studio code as its base giving it a clearer interface, but comes at the cost of
performance as its quite heavy to run (especially on the pi 4, and it not
supported by the pi 3).

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

 Add Tip V Ask Question | Comment Download

Step 3: Setting Up Your First Device


Home Assistant, the One to Rule Them All. an Advanced Guide by farmer1998h (/member/farmer1998h/) Follow

Download Favorite w I Made It

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

 Add Tip V Ask Question | Comment Download

Step 4: Adding a Card

(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

 Add Tip V Ask Question | Comment Download


Step 5: Zigbee
Home Assistant, the One to Rule Them All. an Advanced Guide by farmer1998h (/member/farmer1998h/) Follow

Download Favorite w I Made It

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.

Setting up the network

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.

I myself chose to reflash a Sonoff ZigBee bridge with Tasmota according to


this guide: https://www.digiblur.com/2020/07/how-to-use-sonof...
(https://www.digiblur.com/2020/07/how-to-use-sonoff-zigbee-bridge-
with.html)
Home Assistant, the One to Rule Them All. an Advanced Guide by farmer1998h (/member/farmer1998h/) Follow

Sonoff ZigBee bridge: aliexpress.com/item/1005002390399376.html


Download (€18,77)
Favorite w I Made It

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.

Adding a ZigBee device

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.

SNZB-02 Temperature and Humidity sensor (€9,27)

SNZB-03 Motion sensor (€10,36)

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.

 Add Tip V Ask Question | Comment Download

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

Download Favorite w I Made It

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.

WARNING: this part requires uploading code and soldering

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)

or make your own.

Receiver: aliexpress.com/item/4000065229076.html

Transmitter: aliexpress.com/item/4000018571977.html

Arduino mega: aliexpress.com/item/1005001621715914.html


The Them
Home Assistant, the One to Rule transmitter here also
All. an Advanced comes
Guide with a receiver
by farmer1998h module, but inFollow
(/member/farmer1998h/) my
experience its completely unusable.
Download Favorite w I Made It

Now connect both modules according to the schematic above. More


information can be found at https://www.rflink.nl/wires.php Flag

(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.

 Add Tip V Ask Question | Comment Download

Step 7: Automating Your Home


Home Assistant, the One to Rule Them All. an Advanced Guide by farmer1998h (/member/farmer1998h/) Follow

Download Favorite w I Made It

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.

This will bring you to a new menu with 4 sections, named:

· 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.

· Single Ignore new triggers while running:

· Restart Restart the automation if triggered while running:

· Queued Wait till finished and then run again:

· Parallel Run both old and new instance of automation.

Most cases require only the single mode, so leave it at that.

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

My bedroom has some quite hard to reach light switches, so I needed


another solution. I combined a Sonoff motion sensor as seen earlier to a light
I made. I only need the light to turn on in the dark, so I limited to night-time
only. After a few minutes on the light slowly fades off.

 Add Tip V Ask Question | Comment Download

Step 8: Climate Automation


Home Assistant, the One to Rule Them All. an Advanced Guide by farmer1998h (/member/farmer1998h/) Follow

Download Favorite w I Made It

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

system. For example to combine a temperature sensor and a wall power


switch connected to a space heater into 1 thermostat.
Download Favorite w I Made It

This can be done by adding the following to your configuration.yaml (replace Flag

the ** with your sensors):


Add To Collection

climate:
- platform: generic_thermostat
Add To Contest
name: *name*
target_sensor: sensor.*temperature_sensor*
heater: switch.*electric_plug*<br>

Save the config and restart the server.

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.

 Add Tip V Ask Question | Comment Download

Step 9: Going Further With ESPHome

(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

Download Favorite w I Made It

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

ESPHome is a tool built around the Espressif series of microcontrollers, the


ESP8266 and the ESP32. Both are wifi capable microcontrollers, with the
ESP32 also having Bluetooth and BLE capabilities. The possibilities with
ESPHome are endless, so i cant explain them all here. Luckely ESPHome has a
nice list of example projects for you to follow:
https://esphome.io/guides/diy.html (https://esphome.io/guides/diy.html)

Installing ESPHome

To install ESPHome you simply need go to the add-on menu (Configuration -


> Add-ons, Backups & Supervisor), go to the add on store and find the
ESPHome add-on. Click install, turn on "Start on boot" and "Show in sidebar"
and make sure the add-on is started. From now on the ESPHome interface
can be found on the sidebar.

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.

How to use ESPHome


Before
Home Assistant, the One to Rule you
Them All.can start using
an Advanced ESPHome
Guide you'll
by farmer1998h need a ESP8266 or Follow
(/member/farmer1998h/) ESP32 enabled
device. These can be standalone prototyping boards like the NodeMCU, or a
Download
premade ESP enabled device like a ESP Relay module or the various LilyGO
Favorite w I Made It

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

for Home Assistant.


Add To Contest

switch:<br> - platform: gpio


pin: 4
name: "Plug_3"
id: relay

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.

 Add Tip V Ask Question | Comment Download

Step 10: The Finishing Touches


Home Assistant has endless possibilities for home automation, and is in my
opinion the best of its kind. It has lots of support and a large userbase, and is
finding its way into more and more homes all over the world.

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.

Accessing Home assistant beyond your home network:

https://www.home-assistant.io/integrations/duckdns... (https://www.home-
assistant.io/integrations/duckdns/)

Integrating Google Assistant / Alexa into Home Assistant:

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 Tip V Ask Question | Comment Download


Home Assistant, the One to Rule Them All. an Advanced Guide by farmer1998h (/member/farmer1998h/) Follow

Be the First to Share


Download Favorite w I Made It

Did you make this project? Share it with us! Flag

I Made It! Add To Collection

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

We have a be nice policy.


Please be positive and constructive.

Add Images Post

Categories About Us Resources


 Circuits  Living Who We Are Sitemap (/sitemap/)
(/circuits/) (/living/) (/about/) Help (/how-to-write-a-
 Workshop  Outside Why Publish? great-instructable/)
(/workshop/) (/outside/) (/create/) Contact (/contact/)
 Craft  Teachers
(/craft/) (/teachers/)
 Cooking
(/cooking/)
Find Us
(https://www.instagram.com/instructables/)
Home Assistant, the One to Rule Them (https://www.tiktok.com/@instructables)
All. an Advanced Guide by farmer1998h (/member/farmer1998h/) Follow

© 2023 Autodesk, Inc.


Download
Terms of Service (http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=21959721)
Favorite wI Made It
(http://www.autodesk.com)
Privacy Statement (http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=21292079)
Flag
Privacy settings
Legal Notices & Trademarks (http://usa.autodesk.com/legal-notices-trademarks/)
Add To Collection

Add To Contest

You might also like