Presence Detection System Broken After Updating Home Assistant

Hello,

I need some help because I've been stuck for several days trying to fix a presence detection system that had been working reliably for months and suddenly broke after updating Home Assistant.

My knowledge level is fairly limited. I originally built this system months ago by following tutorials and through a lot of trial and error. The problem is that I no longer remember exactly what I modified, which parts are still necessary, and which parts might now be obsolete.

How the system worked

I use ESPresense for room-level presence detection, but I also use it to determine whether someone is inside or outside the house.

The main logic is that it should never mark someone as not_home simply because BLE detection is lost. Before considering someone to have left the house, I also check additional conditions, especially whether the main door has been opened recently.

This setup worked reliably for months.

The problem after the update

After updating Home Assistant, the system started behaving erratically. Devices are now being marked as not_home when they shouldn't be, even when none of the conditions required to determine that someone has left the house have been met.

In addition, Home Assistant reports errors related to the following configuration:

device_tracker:
  - platform: mqtt
    devices:
      persona1_cocina: 'espresence/cocina/persona1'
      dispositivo_ble_cocina: 'espresence/cocina/dispositivo_ble'
    payload_home: 'home'
    payload_not_home: 'not_home'
    availability_topic: 'espresence/cocina/availability'
    payload_available: 'online'
    payload_not_available: 'offline'

  - platform: mqtt
    devices:
      persona1_habitacion: 'espresence/habitacion/persona1'
      dispositivo_ble_habitacion: 'espresence/habitacion/dispositivo_ble'
    payload_home: 'home'
    payload_not_home: 'not_home'
    availability_topic: 'espresence/habitacion/availability'
    payload_available: 'online'
    payload_not_available: 'offline'

  - platform: mqtt
    devices:
      persona1_dormitorio: 'espresence/dormitorio/persona1'
      dispositivo_ble_dormitorio: 'espresence/dormitorio/dispositivo_ble'
    payload_home: 'home'
    payload_not_home: 'not_home'
    availability_topic: 'espresence/dormitorio/availability'
    payload_available: 'online'
    payload_not_available: 'offline'

  - platform: mqtt
    devices:
      persona1_salon: 'espresence/salon/persona1'
      dispositivo_ble_salon: 'espresence/salon/dispositivo_ble'
    payload_home: 'home'
    payload_not_home: 'not_home'
    availability_topic: 'espresence/salon/availability'
    payload_available: 'online'
    payload_not_available: 'offline'

From what I've read, it appears that this method of creating MQTT device trackers using platform: mqtt has either been deprecated or removed recently.

What I don't know is whether this configuration is still affecting my setup or whether it has effectively become dead code.

MQTT Room Sensors

I also use the following MQTT Room sensors:

- platform: mqtt_room
  device_id: "iBeacon:XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
  name: 'BLE Person 1'
  state_topic: 'espresense/devices/iBeacon:XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'
  timeout: 10
  away_timeout: 60

- platform: mqtt_room
  device_id: "iBeacon:YYYYYYYY-YYYY-YYYY-YYYY-YYYYYYYYYYYY"
  name: 'BLE Person 2'
  state_topic: 'espresense/devices/iBeacon:YYYYYYYY-YYYY-YYYY-YYYY-YYYYYYYYYYYY'
  timeout: 10
  away_timeout: 60

These sensors still seem to detect rooms correctly, but the final presence state is no longer reliable.

Main Automation

This automation listens for BLE room changes and updates the device tracker:

alias: Update BLE Device Tracker
description: ""
triggers:
  - entity_id:
      - sensor.ble_persona1
    trigger: state

conditions:
  - condition: template
    value_template: "{{ trigger.from_state.state != trigger.to_state.state }}"

actions:
  - data:
      dev_id: dispositivo_ble
      location_name: >
        {% set puerta_reciente = (now() -
        states.binary_sensor.puerta_principal.last_changed).total_seconds()
        < 180 %}

        {% if trigger.to_state.state in ['habitacion1', 'habitacion2',
        'habitacion3', 'habitacion4'] %}
          home
        {% elif puerta_reciente and trigger.to_state.state in ['not_home',
        'unknown'] %}
          not_home
        {% else %}
          unknown
        {% endif %}
    action: device_tracker.see

mode: single

Correction Automation

When the BLE tracker remains in unknown for too long, I use Wi-Fi and GPS information to correct the state:

alias: Correct Unknown BLE State
description: |
  If BLE remains unknown for more than 3 minutes, use Wi-Fi and GPS to correct the state.

triggers:
  - entity_id:
      - device_tracker.dispositivo_ble
    to:
      - unknown
    for:
      minutes: 3
    trigger: state

conditions:
  - condition: or
    conditions:
      - condition: not
        conditions:
          - condition: zone
            entity_id: person.persona1
            zone: zone.home

      - condition: template
        value_template: >
          {{ (now() -
          states.binary_sensor.puerta_principal.last_changed).total_seconds()
          > 180 }}

actions:
  - choose:
      - conditions:
          - condition: or
            conditions:
              - condition: state
                entity_id: sensor.movil_wifi
                state: Disconnected

              - condition: not
                conditions:
                  - condition: zone
                    entity_id: person.persona1
                    zone: zone.home

        sequence:
          - data:
              dev_id: dispositivo_ble
              location_name: not_home
            action: device_tracker.see

      - conditions:
          - condition: state
            entity_id: sensor.movil_wifi
            state: MY_WIFI_NAME

          - condition: zone
            entity_id: person.persona1
            zone: zone.home

        sequence:
          - data:
              dev_id: dispositivo_ble
              location_name: home
            action: device_tracker.see

mode: single

What I Need Help Understanding

  1. Could the removal of device_tracker: platform: mqtt explain this behavior?
  2. Is that configuration still being used by my automations, or is it effectively ignored now?
  3. Is there a way to identify which automations, scripts, or entities still depend on those old MQTT device trackers?
  4. Could recent changes in Home Assistant's MQTT or Device Tracker integrations cause device_tracker.dispositivo_ble to be set to not_home while bypassing the logic shown above?
  5. Do you see any obvious issues in these automations that could explain the behavior?

At the moment, I have reverted to a Home Assistant 2026.5.4 backup because after updating to 2026.6.x the presence system becomes unreliable.

Any guidance would be greatly appreciated. I've spent several days trying to track down the root cause and I'm no longer sure whether I'm looking in the right place or if the entire setup needs to be migrated to a newer approach.

Thank you.

I believe that action has either already been removed, or is scheduled to be removed. The same goes for the underlying known_devices.yaml file it relies on.


Those should be configured under the mqtt integration, not the device_tracker integration.... see the examples in the docs:


There is now the option to create device_tracker entities through the template integration. If you want them to update based on MQTT, you would just include an MQTT trigger and you could add other triggers if needed.

Trigger-based Template Entities

Not removed, just deprecated.
We have 11 months left...

The legacy device tracker platform bluetooth_le_tracker.device_tracker is being set up; legacy device trackers are deprecated and will be removed in Home Assistant Core 2027.5, please migrate to an integration which uses a modern config entry based device tracker

Well, it's finally solved. In the end, the problem wasn't related to ESPresense at all, and I hadn't been able to test things properly.

What was actually happening was that, after the update, my phone's GPS location was not being updated correctly. The Companion app had all the required permissions and was still publishing the location data, but Home Assistant was not processing or reading that information properly.

I have an automation that sets the device_tracker I use to "unknown" whenever Home Assistant restarts. If it remains in that state for too long, it checks the phone's GPS location and Wi-Fi connection. Since the Companion app integration was not working correctly, it ended up marking me as away from home, which triggered the alarm and cameras. That was the point when I decided to roll back to a stable version. XD

I would like to apologize for my behavior over the last few days. I was quite frustrated with a presence detection system that I had set up months ago, which had been working reliably for a long time with very few issues. Seeing it apparently break after an update made me feel as though everything had suddenly stopped working, and that was understandably frustrating.

At least I've learned something useful from all of this: in the coming months I'll need to migrate part of my configuration, and I now have a much better understanding of what needs to be changed and fixed when that time comes.

I'm considering this issue resolved and the topic closed.