esphome / esphome/feature-requests

Add additional level in mqtt hierarchy for esp32_ble_tracker (might be useful for other applications as well)

Open
#1,171 4 comments 0 reactions 0 assignees View on GitHub
component: esp32_ble_tracker component: mqtt enhancement
Dominant language
No language data
Stars
450
Forks
29
PR merge metrics
No merged PRs in 30d

Description

**Describe the problem you have/What new integration you would like**

I am using the esp32_ble_tracker to collect data from multiple ble sensors. The sensors have multiple values. I would like to improve the layout of the mqtt messages by adding an extra layer in the mqtt label hierarchy using the sensor name.

Currently it look like this:
/node-name/sensor/atc_temperature_bathroom
/node-name/sensor/atc_humidity_bathroom
/node-name/sensor/atc_battry-voltage_bathroom
/node-name/sensor/atc_battry-level_bathroom
/node-name/sensor/atc_temperature_sleepingroom
/node-name/sensor/atc_humidity_sleepingroom
/node-name/sensor/atc_battry-voltage_sleepingroom
/node-name/sensor/atc_battry-level_sleepingroom

The desired structure is:
/node-name/sensor/bathroom/atc_temperature
/node-name/sensor/bathroom/atc_humidity
/node-name/sensor/bathroom/atc_battry-voltage
/node-name/sensor/bathroom/atc_battry-level
/node-name/sensor/bedroom/atc_temperature_
/node-name/sensor/bedroom/atc_humidity
/node-name/sensor/bedroom/atc_battry-voltage
/node-name/sensor/sbenoom/atc_battry-level

**Please describe your use case for this integration and alternatives you've tried:**

The mqtt label hierarchy is more clear in this way.

**Additional context**

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing how esp32_ble_tracker values are turned into MQTT topic labels. Compare the current flat examples with the requested sensor-name hierarchy, and define done as producing the requested nested topics without losing the existing sensor values or labels.

Written by the indexing model from the issue text.

Assessment

Domain
embedded-iot
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.