Tried and failed multiple attempts at room detection for just ONE device

I have a Olimex ESP32 POE board and tried to use it as a Bluetooth Proxy and as a ESPresense device that is located in the living room and all I want is for it to be able to trigger an automation when my phone (an Android, but can also be a Tile device or a Blue Charm Bluetooth device).

I tried following the concept of ESPresence, but I ultimately became confused as it seems as though there are overlaps between that an Room Presence / MQTT Rooms.

Currently, I have the MQTT add-on enabled and Room Presence enabled and in my config file for HA, I have:

sensor:
  - platform: mqtt_room
    name: "IronFoldable"
    device_id: "iBeacon:519199c9-ca2b-4e33-8f54-48d22607f684_100_1"
    state_topic: "espresense/devices/ironfoldable"

I tried changing the state topic to espresense/devices and that auto discovery never kicked in.

On the devices page, I have added MQTT and configured it to point to my HA instance, and so far it just shows “changeme” and “ESPresense basement” (which is the name of my Olimex ESPresense device). If I click on it, it shows information.

I’ve also tried enrolling my phone on the ESPresense device.

Knowing me, I’ve overcomplicated this somehow and got my signals crossed and have too much going on. I feel so close though as the ESPresense device tells me, by device, how many meters away another device is. And at the end of the day, I just want to trigger an automation when a device is less than X meters and when it’s more than X meters.

Any help/advice/clarity would be greatly appreciated.

Thanks,
AJ

So, I downloaded MQTT Explorer and logged in and found that there are several subscribers/publishers:

  1. homeassistant
  2. room-assistant
  3. espresense

homeassistant has a room-assistant and espresense-783c90 topic.

The espresense has what I’m looking for, I think, in espresense/devices/ironfoldable as within that it has JSON with the distance value.

What I’m confused about is that the espresence device is configured with “homeassistant” as the discovery topic prefix.

Anyway, based on the path in MQTT Explorer, I added the following sensor, but nothing shows up:

  - platform: mqtt_room
    name: "IronFoldable"
    device_id: "ironfoldable"
    state_topic: "espresense/devices/ironfoldable"

One thing is that the variable under ironfoldable that’s being assigned the JSON value is called “basement” so I’m not sure if that’s messing things up somehow.