How Does Presence Detection work?

There are various ways to detect presence in Home Assistant and trigger automation.

One of the most popular ways is via Wi-Fi data pipe connection.

Google Pixel Modes Feature

However, it requires a supported Wi-Fi router or data pipe devices.

Thats where Bluetooth technology comes in.

After drivers are installed, restart the system.

detect room presence using esp32 for home automation

Then connect the ESP32 board to your PC or MAC computer using a micro USB cable.

Then, select ESP32 from the drop-down and clickConnect.

Choose the serial port where ESP32 is connected.

connect esp32 to pc mac for web firmware flash

It usually displays the chip name (CP2102 or CH340) orSer!

Once connected, clickINSTALL ESPRESENSE.

Then, click theErase devicecheckbox and selectNext.

flash espresense firmware

After doing the above, selectInstalland wait for the installation to finish.

After the firmware is flashed, clickNextand then clickLOGS & CONSOLE.

This opens theLogswindow, where you might see the status of the module.

flash espresense firmware esp32 using esphome flasher tool

Step 3: Using ESPFlasher Tool

Download the latestESPresense firmwareand theESPHome-Flashertool.

Launch theESPHome-Flashertool, chooseCOMport, select theesp32.binfile and clickFlash ESP.

After the firmware is flashed, the ESPHome-Flasher tool will start displaying logs.

setup configure espresense detection sensor

launch the web online window on your phone and visit the 192.168.4.1 IP address, before doing the following.

Leave rest of configs as default.

ClickSaveand reconnect the unit USB cable to restart the ESP32.

add espresense detection sensor to home assistant

The ESP32 will connect to the Wi-Fi connection and start scanning nearby Bluetooth devices.

The information is displayed in theLogs.

Then, click thexx DevicesunderMosquitto broker.

check logs to find and copy device id

To verify the equipment, you’re able to install annRF Connector for the Mobileapp.

The app displays the Mac address of nearby Bluetooth devices.

Match the mac address in-app with the one displayed in the Logs.

add bluetooth device id to configuration yaml file

Afterwards, tap on theSaveicon.

Go toConfiguration > Settingsand clickCheck Configuration.

If theConfigurationis valid, clickRestart.

restart home assistant

After the restart, go toDevelopers Toolsand enter the name of the machine.

It should display the distance.

You may also the rig entity on your dashboard.

check espresense device in developers tools

Afterwards, selectStart with empty automation.

InAction, choose the gear or devices you want to turn on or off.

add automation in home assistant based on presence