This is my best work yet!
4 flows used together will track your mileage (I use fot business milage) using gps, store to csv file on your device and then archive it daily to folders organise by year/month.
Enable tracker - A flow to enable mileage logging ie. start logging when connected to in car bluetooth.
Mileage tracker - logs your position and distance travelled to a csv file. Will display a notification if enabled without power connected.
Reset total - will reset your total distance travelled on a daily basis and archive the csv file to folders organised by year and date.
Remove notification - removes the battery drain notification when power is connected.
Accuracy is good at 30s intervals. Less than 1 mile different to my odometer over 260 mile journey! A shorter interval will be more accurate for short trips where alot of turns are made but you will need to adjust the emergency stop limit.
Please note gps must be enabled or you can add enabling to the flow if you have root.
You may have to tweak file locations on some devices but should be good for most.
http://automagic4android.com/flow.php?i ... 00b1f12810
Mileage Tracking/Logging
Moderator: Martin
Re: Mileage Tracking/Logging
Would this be possible to update to include when connected to a specific Bluetooth device, activate and track? Also would it be possible to set this to track total mileage and just add that to a google calendar?
-
- Posts: 186
- Joined: 12 Feb 2014 01:45
Re: Mileage Tracking/Logging
Hi, I would love to use your tracker, but I am having a few difficulties. Firstly I could not get the flow to finish. Then I realized that I did not have the folder you used in flow. Then there was an error with global_totalDist. Right or wrong I added, if (global_totalDist ==null) {global_totalDist=0 } to the script global_totalDist =toNumber (global_totalDist) +distance. And then the flow worked.
But if I look at the written file everything gets double logged (two rows with the same input data) for each time the flow runs. And the distance added is also doubled. This happens even if I take away my extra script, which I can do after the flow had run at least once and global_totalDist is not Null anymore.
Also is there anyone who knows how to do a script that either adds the track to a kml/kmz or uploads it to Google maps (Google maps can read a file that have the right headings). Also is there anyone who knows how script to get a hold of what Google maps calculates the trip to be in meters.
Maybe one can update this mileage tracker, now when we got new triggers and actions in automagic. I have changed the periodic time trigger to a periodic location trigger, so I don't need initiate the variable location. But maybe you could use speed and distance. What I try to accomplish but automated is like the app my drivers log, but written into files like this one. Using Most the mileage tracking apps I need to use the overlay option, which I don't like. Secondly most apps are not accurate enough since Google maps says we start on a road we can't get to without driving half a kilometer (i have tried to get Google maps to change this).
Any input from the forum would be appreciated
But if I look at the written file everything gets double logged (two rows with the same input data) for each time the flow runs. And the distance added is also doubled. This happens even if I take away my extra script, which I can do after the flow had run at least once and global_totalDist is not Null anymore.
Also is there anyone who knows how to do a script that either adds the track to a kml/kmz or uploads it to Google maps (Google maps can read a file that have the right headings). Also is there anyone who knows how script to get a hold of what Google maps calculates the trip to be in meters.
Maybe one can update this mileage tracker, now when we got new triggers and actions in automagic. I have changed the periodic time trigger to a periodic location trigger, so I don't need initiate the variable location. But maybe you could use speed and distance. What I try to accomplish but automated is like the app my drivers log, but written into files like this one. Using Most the mileage tracking apps I need to use the overlay option, which I don't like. Secondly most apps are not accurate enough since Google maps says we start on a road we can't get to without driving half a kilometer (i have tried to get Google maps to change this).
Any input from the forum would be appreciated
Best regards,
AngelAtwOrk
AngelAtwOrk
Re: Mileage Tracking/Logging
That is one great flow....learning a lot...appreciate if you give us more of scripted flow
Thanks
Thanks
Re: Mileage Tracking/Logging
Ok, I've been away for a while so sorry for the late reply. I'll have another look at the flows and post an update since we now have the distance calculator script built in the Haversine formula is no longer required. I'm sure I could simplify it a little. I'll post an update in a few days.
-
- Posts: 186
- Joined: 12 Feb 2014 01:45