Hello,
I reused an old smartphone as a GPS tracker for my car. For some reasons I’d like to know if my car is moving. With an older Android phone I had a “speed” attribute provided by GPSLogger that I could use for such stuff. With the phone I’m using now there is no such “speed” data (an old iPhone with the iCloud platform set on HASS). I have to mention that I already tried solutions like ownTracks but for reasons I don’t get, iOS won’t let the app live in the background even if set that way.
I had the idea to use the GPS data provided by the phone and the distance() function to update a binary sensor so I could, for example, use something like “distance(device_tracker.mycar_previousdata, device_tracker.mycar_newdata) > 5”, where newdata would be the GPS data provided during the current sensor update and previousdata would be the GPS data which were provided during the previous sensor update. My problem here is that I don’t know if I can access previous sensor data and if so, how I could achieve that. If the distance between the last point and the new one is greater than 5, let’s say the phone is moving.
However, if someone has a better way to achieve this, it’d be very helpful!
Thank you!
Chris.