Runaway Trigger on presence detection

Long-time Homeseer user and HA neophyte here… Starting to get some traction with HA and am working on reliable presence detection. I had a pretty bullet proof setup with HS until my RFID solution plugin quit working and was no longer supported.

The variety of presence options supported by HA is one of the reasons I started the move over. One of my frustrations with HA is the loss of state of my Geofency device_tracker. And because it is setup with an integration, I can’t use the device_tracker.see service call to reset it using a input boolean on HA restart (which I’m seeing lots of right now, but that’s a different topic)

I have ESPresense setup and running well with 11 nodes in the house for future room occupancy integration but I’m also trying to use if for the more macro, home occupancy. I am using the following automation to update an ESP device_tracker on any state change in MQTT for devices, which needless to say is crazy quick on resetting the device_tracker to the correct state on a YAML reload or HA restart… But it is triggering A LOT. There are 5 people in my household and with that and 11 nodes there is always state change MQTT traffic showing up and the automation basically sits at last_triggered NOW all the time.

I don’t know if this is causing my HA restart issues or not, but trying to slow it down just a little bit or come up with a better way to tackle this issue. Basically the automation is working as intended, reset the device_tracker state, but is there a better way to go about this. I do have a binary_sensor setup for all the devices I’m tracking using similar IF THEN ELSE state logic, but it wouldn’t be useful as a trigger as it doesn’t change state unless someone leaves the house.

alias: DeviceTracker - ESP Sensor to Device
description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.thelma_iphone_esp
    id: esp_state_update_thelma
  - platform: state
    entity_id:
      - sensor.louise_iphone_esp
    id: esp_state_update_louise
    enabled: true
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: esp_state_update_thelma
        sequence:
          - service: device_tracker.see
            data:
              dev_id: thelma_iphone_esp
              location_name: |
                {% if trigger.to_state.state == 'not_home' %}
                  not_home
                {% elif trigger.to_state.state == 'unknown' %}
                  unknown
                {% else %}
                   home
                {% endif %}
              source_type: router
            alias: ESP2DT - thelma
    alias: ESP2DT - thelma
  - choose:
      - conditions:
          - condition: trigger
            id: esp_state_update_louise
        sequence:
          - service: device_tracker.see
            data:
              dev_id: louise_iphone_esp
              location_name: |
                {% if trigger.to_state.state == 'not_home' %}
                  not_home
                {% elif trigger.to_state.state == 'unknown' %}
                  unknown
                {% else %}
                   home
                {% endif %}
              source_type: router
            alias: ESP2DT - louise
    alias: ESP2DT - louise
mode: parallel
max: 10