Help setting up a custom device tracker

I want to setup a custom device tracker for when family members visit. Sometimes they visit to feed pets when I am away etc etc. In this instance, I am not going to install the companion app on their phones as that’s overkill.

I have a Deco x20 router which doesn’t give API access. I have been able to setup an automation to send a notification to my phone when a device joins or leaves the network and I have setup the “last_message” sensor via the companion app to feed the join/leave notification to Home Assistant.

On HA Logbook
[Ben LG Last Notification] changed to G8S-ThinQ has disconnected from the WKF’s network.

Wish this, how can I create a tracker which I can then allocate to a user in Home Assistant?

Many thanks,

They have all connected to my WIFI in the past, so this method should be the most exact until I get a coded door lock.

you can manually create a device tracker using the known_devices.yaml file.

then once you create the device tracker you can use the device_tracker.see service to update the status of the device tracker to the home location.

But I’m not sure how you could use the data above to trigger an automation to update the device tracker.

Here is the automation I use to set the location of my vehicle for location of where I parked:

- alias: Set Tacoma Location
  trigger:
    - platform: state
      entity_id: sensor.my_mobile_app_bluetooth_connection
    - platform: state
      entity_id: person.me
      to: 'home'
  action:
    choose:
      - conditions:
          - "{{ trigger.entity_id == 'sensor.my_mobile_app_bluetooth_connection' }}"
          - "{{ 'the mac of my phone' in trigger.from_state.attributes.connected_paired_devices }}"
          - "{{ 'the mac of my phone' not in trigger.to_state.attributes.connected_paired_devices }}"
        sequence:
          - service: device_tracker.see
            data:
              dev_id: toyota_tacoma
              location_name: "{{ states('device_tracker.my_mobile_app') }}"
              gps: 
                - "{{ state_attr('device_tracker.my_mobile_app', 'latitude') }}"
                - "{{ state_attr('device_tracker.my_mobile_app', 'longitude') }}"
          - delay:
              seconds: 10
          - service: variable.set_variable
            data:
              variable: tacoma_location_saved
              value: "{{ states.device_tracker.toyota_tacoma.state }}"
              attributes:
                latitude: "{{ states.device_tracker.toyota_tacoma.attributes.latitude }}"
                longitude: "{{ states.device_tracker.toyota_tacoma.attributes.longitude }}"
      - conditions:
          - "{{trigger.entity_id == 'person.me'}}"
        sequence:
          - service: device_tracker.see
            data:
              dev_id: toyota_tacoma
              location_name: home
              gps: [my home location in coordinates]
          - delay:
              seconds: 10
          - service: variable.set_variable
            data:
              variable: tacoma_location_saved
              value: "{{ states.device_tracker.toyota_tacoma.state }}"
              attributes:
                latitude: "{{ states.device_tracker.toyota_tacoma.attributes.latitude }}"
                longitude: "{{ states.device_tracker.toyota_tacoma.attributes.longitude }}"
1 Like

alias: g8s Home
description: ‘’
trigger:

  • platform: state
    entity_id: sensor.ben_lg_last_notification
    to: G8S-ThinQ has joined the WKF’s network.
    condition: []
    action:
  • device_id: 295d8675ec780c17b0049933f9bf2f0d
    domain: mobile_app
    type: notify
    title: ‘’
    message: TEST Join
    mode: single

I’d use that to update the see. Will try the known devices

Sorry I just updated my post above with an example I used.

What does your known_devices yaml look like for this example?

toyota_tacoma:
  icon:
  mac: 66:AA:33:55:FF:EE <fake mac of my phone bluetooth>
  name: Toyota Tacoma
  picture: /local/tacoma.jpg
  track: true

I don’t think it matters what the mac is that you use as long as it’s not the same as any other on your network.

thanks! looks nice and minimal!

You could also reserve the IPs on the router and use ping

1 Like

Thank you all above. My person automation is working great! How nice it would be for Decos to not be locked behind an app though. Sigh.

Hi @ben0551
I’m in exactly the same situation as you - Deco X20, and wanting to update an individual’s presence based on them joining WiFi.
Could you explain what you did to enable this, in terms someone who has been using HomeAssistant for about a week ( :slight_smile: :wave:), might understand, please?

Thanks!

This was flaky and I did not continue with it

  • Set X20 to send connection notifications.
  • Enable last notification sensor on the HA app on mobile.
  • Add Automation to set the home/away status based on he last notification

It worked 70-80% of the time.

Using a Ping sensor and a reserved address would be better but would still cause false positives when moving outside/poor reception areas of house.