Force OwnTracks MQTT updates?

Hello

If I create an automation like below, will that force my phones to publish and update? As I am finding that they are working fine but often just stop for no reason… This on Android.

- alias: Force Owntracks
  trigger:
    - platform: time
      minutes: '/10'
      seconds: 00
  action:
    - service: mqtt.publish
      data:
        topic: "owntracks/mark/mark/cmd"
        payload_template: '{"_type": "cmd","action": "reportLocation"}'

Cheers
Mark

You have to enable commands in app configuration on your phone.

Yeah I have… I just have no idea if it is actually working

You can simply check it with any mqtt client. Subscribe to owntracks topic and publish command through Hass. You should see response.
Actually I use it to track my car. When I drive Hass forces phone location update every 5 min and than publishes car location with same coordinates.

thanks, I think I am doing this correctly… but not getting any update info?

owntracks/mark/mark {"_type": "cmd","action": "reportLocation"}
owntracks/helen/helen {"_type": "cmd","action": "reportLocation"}
owntracks/mark/mark {"_type": "cmd","action": "reportLocation"}
owntracks/helen/helen {"_type": "cmd","action": "reportLocation"}
owntracks/mark/mark {"_type": "cmd","action": "reportLocation"}
owntracks/helen/helen {"_type": "cmd","action": "reportLocation"}
owntracks/mark/mark {"_type": "cmd","action": "reportLocation"}
owntracks/helen/helen {"_type": "cmd","action": "reportLocation"}
owntracks/mark/mark {"_type": "cmd","action": "reportLocation"}
owntracks/helen/helen {"_type": "cmd","action": "reportLocation"}
owntracks/mark/mark {"_type": "cmd","action": "reportLocation"}
owntracks/helen/helen {"_type": "cmd","action": "reportLocation"}
owntracks/mark/mark {"_type": "cmd","action": "reportLocation"}
owntracks/helen/helen {"_type": "cmd","action": "reportLocation"}
owntracks/mark/mark {"_type": "cmd","action": "reportLocation"}
owntracks/helen/helen {"_type": "cmd","action": "reportLocation"}
owntracks/mark/mark {"_type": "cmd","action": "reportLocation"}

I found that you have to leave owntracks run behind your phone all the time. This will keep the location and battery update to your HA. I use both android and iphone. Location from owntrakcs and battery are more accurate and real time when you leave them run behind your phone.

that is what I thought… it works perfectly with 2 iBeacons, but for tracking it is fine for short periods, but then just stops, until it is detected via the iBeacon and back in action.

EDIT, I did try with OwnTracks_HTTP, but that is the same.

this is my config

  - platform: owntracks
    track_new_devices: yes
    max_gps_accuracy: 200
    waypoints: True
    waypoint_whitelist:
      - mark
      - helen

You are using wrong topic.
It should be owntracks/user/device/cmd
http://owntracks.org/booklet/tech/json/

ah I was. I did have the cmd and it still didn’t work previously… Now I am feeling a tad stupid, I had renamed the devices to have CAPITALS and didn’t change the User and Device basically mark/mark should be Mark/Mark and now it works a treat. Thanks for your help…

Could you please elaborate on this? What do you mean by “run behind your phone?”

Thank you! I’ve had some issues with owntracks not updating occasionally, and am considering an option like the automation at the top.

does anyone know how to send updates/remote config using HTTP mode instead of MQTT ?

1 Like