Create mqtt device_tracker based on individual mqtt lat/lon sensors

Phil is always right :wink: Although this is some time ago of course, and things might have changed

I guess I could do this then:

automation:
  - trigger:
      platform: state
      entity_id:
        - sensor.ot_boss_latitude
        - sensor.ot_boss_longitude
        - sensor.ot_boss_battery_level
        - sensor.ot_boss_accuracy
    action:
      service: device_tracker.see
      data:
        dev_id: owntracks_theboss_see
        gps:
          - "{{states('sensor.ot_boss_latitude') }}"
          - "{{states('sensor.ot_boss_longitude') }}"
        battery: "{{states('sensor.ot_boss_battery_level')|int}}"
        gps_accuracy: "{{states('sensor.ot_boss_accuracy')|int}}"

and that would allow me to dispense with the mqtt_json config.
let me try. thanks

bingo:


Nice :wink:

could probably take out the 2 bottom triggers, as the device_tracker will be updated with these anyways, if and when the lat/lon changes, and I don’t care about those to trigger.

not anymore, corrected that :wink: see: Device tracker - Home Assistant

1 Like