ESPresense/docs/index.md

4.3 KiB

Cover Image

An ESP32 based presence detection node for use with the Home Assistant mqtt_room component for localized device presence detection.

Requirements

You're going to need the following items:

Getting Started

Flashing the Hardware (ESP32)

You can get started by cloning this repository to your local machine using git. Alternatively, you can download the zip. To get the code onto your device, thanks to some great work by kylegordon, you can now build and upload using PlatformIO.

Define your settings

Create a copy of the Settings.h file, and rename it to Settings_local.h or something similar. Any variation of the name Settings followed by an underscore will be ignored by git. This will allow you to set your own configuration without the risk of any commits to the repository of sensitive information. It can also be helpful to keep a settings file for each device you will run, as they will differ.

Flashing the device via USB

Open the project folder in Atom, using the open project option in the PlatformIO Home screen. Modify the settings in the Settings_local.h file to match your environment. Set the correct port in the platformio.ini file (or remove the line to use auto-detection), and upload to the board. Open the serial monitor after successful upload to check for success.

Flashing/updating via OTA

It is possible to update the device using "Over the Air" (OTA) updates from the command line interface of PlatformIO. You will need to know the IP address of the device itself (check your router). From the command line, enter the command platformio run -t upload --upload-port {{Device IP Address}}. During the update process, you will see the on-board LED blinking slowly. Once the update has completed, you should see the device reconnect and update its telemetry.

Home Assistant Configuration

See the section on configuring Home Assistant.

Trackable Devices

Beacon Hardware

See the section on tracking beacon hardware

Tracking Android Phone

Read more here about getting your Android phone configured and tracked.

Tracking iPhone

Unfortunately, Apple does not allow devices to advertise iBeacon data in the background. As I do not own an iPhone, I will not attempt to implement scanning and reporting by device name, but I welcome pull requests.

Credits

This depends heavily on the hard work done by a number of people.