esphome yaml file for multi presence sensors using bluetooth and LD2410 sensor.
This project use esp32 with LD2410 sensor attached to enhance capabilities.
- LD2410 sensor
- MQTT Room Presence integartion using bluetooth to mqtt.
- Bluetooth Proxy
- BLE gateway to use with Passive BLE Monitor integration
- 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.
- 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
- 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
- Install
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.
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)