yohaybn / esphome-multi-presence

esphome yaml file for multi presence sensors.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

esphome-multi-presence

esphome yaml file for multi presence sensors using bluetooth and LD2410 sensor.

This project use esp32 with LD2410 sensor attached to enhance capabilities.

  1. LD2410 sensor
  2. MQTT Room Presence integartion using bluetooth to mqtt.
  3. Bluetooth Proxy
  4. BLE gateway to use with Passive BLE Monitor integration

How to install

  1. Add the file bluetooth-proxy-with-ld2410.yaml to your esphome folder. you can rename the file and add a dot before the name to hide this file from esphome dashboard.

esphome folder

  1. Create new device in esphome and add the following. (change the substitutions variables and api key)
substitutions:
  name: your device name
  devicename: your device name # (lower-case) hostname, ap
  friendlyname: your device friendlyname # mqtt, sensors.
  topic: your mqtt topic
  gateway_id: your gateway id
api:
  encryption:
     key: your key

<<: !include .bluetooth-proxy-with-ld2410.yaml
  1. add the following to ESPHOME secrets. (change the values...)
wifi_ssid: "wifi_ssid"
wifi_password: "wifi_password"
mqtt_broker: mqtt_broker ip
mqtt_username: username
mqtt_password: password
  1. Install

Wiring

ESP32                 LD2410
5V ------------------ VCC
GND ----------------- GND
RX ------------------- Uart-Tx
TX ------------------- Uart-Rx 

In my file ESP32 TX pin is 17 and RX pin is 16, its depend on the borad, so maybe need to change it.

Configuration

This project aim to replicate the abiltities of espresence or openmqttgateway with the addittional LD2410 sensor and bluetooth proxy.

After the installation you can configure it in Home Assistant.

Config the LD2410 as described in ESPHOME docs. you can uncomment the end of file (g0-g8 sensors)and turn on engineering mode switch to calibrate the gates threshold/

Config the bluetooth presence settings using the mqtt_room_distance measured_power environmental_factor sensors.

  • mqtt_room_distance for room size in meters.
  • To calibrate measured_power put your ble device 1 meter from the esp32 device and check the average rssi.
  • To calibrate the environmental_factor you need to play with it to get distance of 1 meter in the mqtt response. (thanks to this)

About

esphome yaml file for multi presence sensors.