owntracks can send the steps and walking distance that your iphone measures to home assistant. you have to poll owntracks for that
automation:
alias: "get steps"
trigger:
- platform: time
# Matches every hour at 10 minutes past whole
minutes: 10
seconds: 00
action:
- service: mqtt.publish
data:
topic: "owntracks/eins/ix/cmd"
payload_template: '{"_type" : "cmd", "action": "reportSteps"}'
qos: 2
for owntracks remote commands to work, you might have to configure owntracks to accept commands. i think this is not set by default. it might require to set "cmd":true via remote configuration. if owntracks is set up and reportSteps is requested via mqtt regularly, these sensors should populate:
have you checked wheter it works if you use an mqtt debugging tool like mqtt.fx?
publish the cmd payload to owntracks/Iain/iphone/cmdwith mqtt.fx while being subscribed to /owntracks/# and see wheter owntracks answers with the arcoring payload?
@diplix I just tried your solution. It seems to work well when my iphone is unlocked and Owntracks is open and on the foreground. Is there any trick to get this with Owntracks force closed (or at least put to the background) and the iphone locked?
Just tried a little further, I only get it to work in the background and with the iphone locked as long as I have move mode enabled.
it works in the background, too, but only if the phone gives owntracks computing time. usually this happens (in the background, with a locked phone) when significant location changes happen — and for that it should be sufficient to have significant changes mode enabled.
what i did (see above) was set up a recurring automation that sends queries to the phone, which then, if send with qos 2, get answered when the phone changes location or crosses a geofence. so when i get home, i usually have acurate steps displayed, that got transmited to HA when i entered the home zone.