Set JSON MQTT Device Tracker to away or none

I have a MQTT stream with positions for different devices.
Is there any way to set a devices to away or ‘none’ with a MQTT publish in some time with inactivity?

It’s possible to set it with some position away from house but is there some way to reset it?

- alias: Position to none
  initial_state: 'on'
  trigger:
  - platform: template
    value_template: {{ (as_timestamp (now())-as_timestamp (states.device_tracker.test_mqtt.last_updated | int )) > 600 }}
  action:
  - service: mqtt.publish
    data_template:
      topic: "location/test"
      payload: '{latitude":"0", "longitude":"0"}'

This is the center of world and not what I want.

put in a real lat and long.and/or put in your lat and long.

But I track some devices that I don’t now the position of the whole time. And the I want to set it to none.

devices such as? Ping might be a better option for device tracking.

With ping I need to know ip-number and cannot use DHCP.

I don’t use it myself, but MQTT device tracker - Home Assistant doesn’t appear to need GPS coordinates.

Yes.

I was ending upp with using both:


Depending if I got the position in lat/ lon or just away.