BLE Beacon tracking problem with power failure

hello, i have a problem with my garage automation with ble beacon trackers.
when the beacon is absent, the garage closes, when i come home it opens, but now the problem: power failure…the power is back and the garage opens by itself, because the beacon recognises that i have come home. how can i avoid such a problem? the server is connected to a usv, the shelly bluetooth repeater was without power.
thanks!

Please post your automation

description: ""
mode: single
trigger:
  - platform: state
    entity_id:
      - device_tracker.seat_xxx
    from: not_home
    to: home
condition: []
action:
  - service: cover.open_cover
    metadata: {}
    data: {}
    target:
      entity_id: cover.garage_xxx

just this simple code