Is it possible to add an odometer reading to the Automatic IFTTT integration?

  • 3
  • Idea
  • Updated 1 year ago
  • Not Planned
  • (Edited)
Hi, first I want to say that love my Automatic. I'm using the Automatic IFTTT recipe (https://ifttt.com/recipes/148434) to log my driving to a Google spreadsheet and was wondering if it is possible to include the odometer reading as well?
Photo of Davy Nixon

Davy Nixon

  • 80 Points 75 badge 2x thumb

Posted 3 years ago

  • 3
Photo of Tom

Tom, Former Employee

  • 41,706 Points 20k badge 2x thumb
Welcome to the community, Davy! Odometer data isn't available via the OBD port unfortunately, so this isn't technically possible at this time. You may have some interest in reviewing this related idea topic on an odometer feature.

Are you interested in odometer information for maintenance purposes? If so, you may have some interest in this IFTTT recipe that keeps track of the total miles driven with Automatic (courtesy of the Numerous app). This is one way to keep track of 5,000/10,000 mile increments for, say, oil changes.
Photo of Tom

Tom, Former Employee

  • 41,706 Points 20k badge 2x thumb
Another quick note: I'm also going to change this topic to an "idea" to keep track of this request as this might be possible later down the road :)
(Edited)
Photo of Gene Palmer

Gene Palmer

  • 130 Points 100 badge 2x thumb
Would love odometer readings. Numerous doesn't work on android.
Photo of Christopher Bailey

Christopher Bailey

  • 90 Points 75 badge 2x thumb
wouldn't it be pretty easy to do odometer readings though? all you'd have to do is add a starting variable when automatic is first installed and then just keep up with it. Of course have a way for a user to manually override the current reading whenever but all in all it doesn't sound hard to do from a coding standpoint. You already have the data you need.
Photo of RPS

RPS

  • 1,390 Points 1k badge 2x thumb
Christopher,
First, your idea for adding and tracking the odometer values is excellent.  It would be a great way to keep track of it milage, especially for us that do our own maintenance (i.e. DIYers). It would be keenly important to be able to reset / adjust it as you have suggested.  Bravo.

In regards to obtaining the data directly from the OBD link.  One would think it would be a simple request and something that is part of the OBD standard set of PIDs (Parameter ID's).

But in this case, sadly it is not.  OBD is broken down into several areas.  There are the first primary set of OBD standard data requests - after that they become manufacturer specific - proprietary data sets.  Every company that wants to access this data must pay for it.  It is yet another way for the vehicle manufacturers to make money...albiet not much.  I do wonder if the push for the "Right to Repair Act" will change that. 

I do imagine that Automatic will work towards that direction as they are building a fantastic foundational product.  This can be seen from the ability to extend their products through API's.

Hope this helps
-R
Photo of Robert Reuscher

Robert Reuscher

  • 2,520 Points 2k badge 2x thumb
Chris. You can do what you want. I've modified their IF recipe to add blank columns in to the spread sheet in which I added a formula to calculate the odometer reading (i.e. ending mileage is previous trip ending mileage plus miles traveled. it's easy to implement, and can by updated in the spread sheet by a simple copy and paste. 

Interesting to note, it loses mileage, either because of missing trips or something else is not getting recorded right. I reset the spreadsheet every month on day 1 (rename the old one and let a new one get created and after that manually put in the starting mileage on day one of the month to restart the calculation. I may sound like a lot of work, but it's better than filling out a log book with my mileage in order to expense it.
Photo of Adam Altman

Adam Altman, Alum

  • 3,712 Points 3k badge 2x thumb
Official Response
As mentioned by Robert, odometer is not a part of the generic OBD PIDs.  We want badly to be able to access it and are working on that with car makers, though it may be years before they give it to us if ever.

We don't want to offer a way to approximate odometer unless we're confident that it will be a good approximation over thousands of miles, and as yet we do not have that.  

Initially it may seem that simply taking the distance reading from each trip and summing them up would give you the distance travelled so that you could add this to any known start point. The problem is the method used to determine distance for a trip on the Automatic will diverge from what your car uses to record odometer, and over time this divergence could be fairly large.

Automatic calculates distance from speed times time. We sample the car's speed as fast as its bus will allow, up to 1Hz, though many cars are slower than this, some taking several seconds to return the speed value.  Thus, if you car takes 1 second each to return speeds (10MPH, 11MPH, 9MPH) we will calculate the distance of traveling at exactly those speeds for one second each. In truth, the exact distance you travelled depends on what you did within that 1-second interval.  And these margins of error add up to a small amount on a trip basis, surely less than 0.1 miles for most trips, so we can confidently display miles to the tenth.  But over many many trips, this is guaranteed to diverge from reality in an unpleasant way.

The car's internal odometer, by contrast, does not need to sample the bus and can feed instantaneous speed data directly into a distance calculation thousands of times per second. At the tiniest of levels, this is still an approximation of an analogue signal, but one whose margin of error is effectively zero.

You can see a comparison of those concepts here:


There is a second matter which is that if Automatic fails to capture a trip for whatever reason (unplugged adapter, firmware reboot mid trip, etc), we will miss the mileage of that segment completely, putting us miles or tens of miles off in one fell swoop.

In sum, we believe the only reliable way to offer odometer reading is to find a way to get the odometer PID directly from the engine.  It is there, and should be technically achievable, just a business deal hurdle to get it done.
Photo of Christopher Bailey

Christopher Bailey

  • 90 Points 75 badge 2x thumb
what about Gen2? Cant you make something more accurate based on GPS data? Also just allow for that to be modified by the user at fill-up or something or whenever the user wants to update.
Photo of Nathan

Nathan

  • 2,108 Points 2k badge 2x thumb
The difference between speed extrapolation of distance travelled and gps calculation of difference travelled will be negligible. Adding an option to keep track of an estimated odometer, with periodic resets, would be pretty nice though.
Photo of Adam Altman

Adam Altman, Alum

  • 3,712 Points 3k badge 2x thumb
GPS is a really bad way to keep accurate logs over time.  It goes in and out of signal lock all the time, sends errant points due to building reflection, cloud based scattering, etc, gives a lock within some specified accuracy (often 65m radius) and sometimes simply refuses to lock (e.g. tunnel / underground / beginning of many trips).  The delta from truth would pile up very quickly.

We have to interpret raw GPS data into a sane trip route at the end of each trip, and it's not going to be distance accurate down to the meter or even 10s of meter levels.  
(Edited)
Photo of Robert Reuscher

Robert Reuscher

  • 2,520 Points 2k badge 2x thumb
I would have to agree with that. Although the new adapter has a GPS unit in that, it's almost in the worst place in the car to get a signal. The GPS system was never designed to be used indoors, by the time the missile gets inside it should have already blown up :). The signal is very weak, and can be attenuated by lots of things (foliage for example), much less being buried deep inside a car dash surrounded by lots of stray RF, metal, and plastic. The new receivers are quite sensitive, I can get a signal now inside my house on the first floor with my latest device, but not always and not always with more than 3 Sats, leading to widely variable position errors. That's why your iPhone also relies on the wifi to improve positioning reporting. 
From my own use I can see the recording errors (either by missed trips, or the method used now to determine travel distances). I've had my monthly re-sync be a low as 20 miles and as high and 100+. 
Photo of Amy

Amy

  • 68,950 Points 50k badge 2x thumb
Precisely right, Robert! :)
Photo of Nathan

Nathan

  • 2,128 Points 2k badge 2x thumb
I have IFTTT send the data to a Google Sheet. The sheet calculates my odometer estimate after every trip and then sends me maintenance reminders and all kinds of other stuff. To keep it accurate, every time I fill up I send IFTTT a text with my odometer reading (along with some other data). That data is passed into the spreadsheet, and the estimate is reset to the actual. It took a bit of legwork to set up, but it's running beautifully now!

https://docs.google.com/spreadsheets/d/18PaMbHTIO1LJkZJdu-LRJxzd-NuiaHuA39FDUuwAkRI/pubhtml
Photo of Jonathan

Jonathan, Alum

  • 4,232 Points 4k badge 2x thumb
Wow, awesome! Pretty incredible to see it all categorized nicely, too. Thanks for sharing. :)
Photo of Robert Reuscher

Robert Reuscher

  • 2,520 Points 2k badge 2x thumb
Mind sharing that IFTTT text recipe?
Photo of Nathan

Nathan

  • 2,128 Points 2k badge 2x thumb
Here is a link to the recipe... the big thing that this does for you is put the Date/Time field into a format that you can actually use in a spreadsheet.

https://ifttt.com/recipes/295056-log-my-trips-in-a-useable-format-to-google-drive

As a warning, this is only a small piece of the puzzle for how my car log works. The sheet gets each new trip, but once the trip is added a script runs in the background that copies and pastes that trip into a template with all the formulas that I couldn't write into the recipe.

The Odometer updater is based off texts I send to IFTTT. When IFTTT receives a text #gas odometer/gals/price, it parses it out and places it into a sheet that is hidden. Once a new row is detected in that hidden sheet, the permanent data is copied into the car log.

My maintenance emails are sent via a script that checks the odometer once per day. If the odometer%XXXX is in the right range for a given periodic maintenance item, I get an email reminder.

Like I said before, it took some legwork. In my opinion though, none of it is possible unless you can get the Date/Time out of IFTTT in a useable format.
Photo of Nathan

Nathan

  • 2,128 Points 2k badge 2x thumb
Here is the link to my Car Log that allows you to look at the formulas and such. There are some hidden sheets as well that will provide insight into how it functions.

https://docs.google.com/spreadsheets/d/18PaMbHTIO1LJkZJdu-LRJxzd-NuiaHuA39FDUuwAkRI/edit?usp=sharing
Photo of Robert Reuscher

Robert Reuscher

  • 2,520 Points 2k badge 2x thumb
"The Odometer updater is based off texts I send to IFTTT. When IFTTT receives a text #gas odometer/gals/price, it parses it out ..." That was the recipe I was specifically looking for. But I do think you for the date conversion info in the first one, that will be nice to use also. 
Photo of Nathan

Nathan

  • 2,128 Points 2k badge 2x thumb
Sorry.  Of course.
https://ifttt.com/recipes/295377-log-gas-fill-ups-in-google-drive

And the sheet it sends data to...
https://docs.google.com/spreadsheets/d/1isXlWf-emBK61xE92IPsRr1uAdphO0jfKTs_fnu4EPo/edit?usp=sharing

And the scripts that link it to my car log...

function Time_Check() {
  var ss = SpreadsheetApp.getActive();
  var sh = ss.getSheetByName("Trigger");
  var lRow = sh.getLastRow(); 
  var lCol = sh.getLastColumn();
  var bigrange = sh.getRange(lRow,1,1,lCol);
  var littlerange = sh.getRange(lRow-1,1,1,lCol);
  var odometer = bigrange.getCell(1,2).getValue();
  var price = bigrange.getCell(1,3).getValue();
  var gal = bigrange.getCell(1,4).getValue();
  var mpg = (odometer-littlerange.getCell(1,2).getValue())/gal;
  bigrange.getCell(1,5).setValue(mpg);
  if(bigrange.getCell(1,6).getValue()==0){
   Update_Dragon(odometer, price, gal, mpg);
   bigrange.getCell(1,6).setValue(1);
  }
}

function Update_Dragon(odometer, price, gal, mpg){
  var ss = SpreadsheetApp.openByUrl("https://docs.google.com/spreadsheets/d/18PaMbHTIO1LJkZJdu-LRJxzd-NuiaHuA39FDUuwAkRI/edit#gid=250514822");
  var sh = ss.getSheetByName("Trip_Log"), lRow = sh.getLastRow(); 
  var lCol = sh.getLastColumn();
  var newrange=sh.getRange(lRow, 1, 1, lCol);
  newrange.getCell(1,8).setValue(price);
  newrange.getCell(1,16).setValue("TRUE");
  newrange.getCell(1,17).setValue(odometer);
  MailApp.sendEmail({
     to: "trigger@recipe.ifttt.com",
     subject: "#Gas_Success",
    body: "#gas " + odometer + "/" + price + "/" + gal + "/" + mpg.toFixed(2)
   });
}
(Edited)
Photo of Robert Reuscher

Robert Reuscher

  • 2,520 Points 2k badge 2x thumb
So it's google docs/spreadsheet that's parsing the text, not IFTTT, correct? That's where I was getting mixed up. I thought you were using some IFTTT feature that I couldn't find to do the parsing not Google spreadsheet functions. Thanks, that will help a lot. Need to read up on using the Google spreadsheet tool more. 
Photo of Amy

Amy

  • 68,970 Points 50k badge 2x thumb
Unsante, thanks so much for sharing your IFTTT / Google Doc magic with the community! Most excellent of you.
Photo of Nathan

Nathan

  • 2,128 Points 2k badge 2x thumb
In the end, yes Google Spreadsheets parses the text. But it's doing it because you added a new row with a bunch of formulas that you wrote into an IFTTT recipe. If you just send google sheet the raw text, it will just add a new row with the useless text that you have to parse somehow (much like the date/time that IFTTT sends).
Photo of Nathan

Nathan

  • 2,128 Points 2k badge 2x thumb
Amy, my pleasure. I figured there are a lot of people that want to keep a legitimate car log, so why make them reinvent the wheel when they can just make a copy of mine and change it as they like.
Photo of Franklin Switzer

Franklin Switzer

  • 204 Points 100 badge 2x thumb
Thank you so much
Photo of Nathan

Nathan

  • 2,128 Points 2k badge 2x thumb
I just wrote up a full tutorial on how to steal my Car Log. You can find it here:

https://community.automatic.com/automatic/topics/automatic-ifttt-google-sheets-integration-to-make-c...
Photo of Jonathan

Jonathan, Alum

  • 4,232 Points 4k badge 2x thumb
Thanks again! Great insights, we appreciate you sharing this!
Photo of Michael Brown II

Michael Brown II

  • 72 Points
Thanks Nathan, I am going to give this a try. Makes me wonder why a user can track odometer but automatic claims it is to hard. Thanks again, you might have just saved my sanity and the money I spent on a device that doesn't do what it claimed.
Photo of Amy

Amy

  • 68,970 Points 50k badge 2x thumb
Hi Michael. Please see Adam's reply to you in the other post you commented on for an explanation for why we have not built this functionality into the app.
Photo of Colin S

Colin S

  • 176 Points 100 badge 2x thumb
This reply was created from a merged topic originally titled Obtain total vehicle mileage through IFTTT.

Is there any way to give total vehicle mileage to report to a spreadsheet through IFTTT? I'm basically trying to figure out a way to get an alert every 3,000 miles for my family's cars so I know when to schedule oil changes. Obviously trip mileage is doable...Any good way to do this that you guys know of?

Thanks!!
Photo of Jeff

Jeff, Alum

  • 14,146 Points 10k badge 2x thumb
Hey Colin,

Thanks for reaching out. I have moved your topic over to this thread since it is relevant to the question you asked.

Automatic does not report odometer readings so we wouldn't be able to provide these exact numbers to IFTTT.

I dug around IFTTT a little bit and was hoping I could find a workaround for you, but unfortunately, there isn't one at this time.

Essentially, you could use an Automatic recipe that will log all trips into a Google Sheet. Within those reports, you will have the total miles for each trip taken while Automatic is plugged into the car and the recipe processed from the phone connected to the adapter. This wouldn't be an odometer reading, but you could create a page within that sheet that uses an equation to figure out how many miles are left till the next oil change. It doesn't look like any Google Sheets recipes exist (such as, alert me when cell B4 is = 3000), so at this time, it would require that you manually check the status of those totals.

Please also note that in order to have the recipe run from reach car, the driver of that vehicle will need to have Automatic installed on their phone, as well as the IFTTT application with that recipe set to run.
Photo of Bob Leedom

Bob Leedom

  • 70 Points
16 May 2017: 
It's been two years since this topic/request (of having Automatic get the odometer reading from the OBD port) first came up. Mileage certainly seems like a basic and expected piece of information to obtain.  Any progress by Automatic since then? If not, are you working on it?
Photo of Amy

Amy

  • 68,970 Points 50k badge 2x thumb
Hi Bob. Welcome to the community! Please see Adam's post above about why this is not a simple feat -- primarily that odometer readings are not available to us via the OBD port as it's proprietary data controlled by the manufacturer. There are several other conversations in this community about odometer readings but there's no update to share on this.

It's helpful to understand that while we have implemented dozens and dozens of requests that have been shared here in our community over the past four years, we don't and can't implement every request. The length of time an idea has existed here does not speak to its viability. Please see this post about how we use this Community. We do love to hear from our users and the feedback here is shared with the business, product and engineering teams. When technical and business viability, as well as available resources, align around a feature, we design, code, and implement it! 
Photo of Scotty Stephens

Scotty Stephens

  • 60 Points
Perhaps it's time to try a different way of getting an accurate odometer reading?  I'm not familiar with your product or if this solution would be too complicated to add to it, but (without diving in too much) in theory it should be a way around your current obstacles...

You could simply put a sensor inside the wheel well and another on the tire somewhere.  You would know the exact distance traveled for every turn of the wheel, and through very basic math could get your distance traveled relatively accurately.  

This is a bit of a cumbersome solution.  You wouldn't want to offer this to everyone considering a millimeter disparity between where the sensors are placed versus where the computer thinks they are placed would add up to very large differences over thousands of miles traveled, but it could be a solution for the people who REALLY want the odometer information NOW.  

Perhaps it could be developed as an accessory to your current product? 
Photo of Amy

Amy

  • 68,970 Points 50k badge 2x thumb
Hi Scotty. Thanks for the suggestion. Designing & manufacturing new, specialized hardware to accomplish this is a huge undertaking and not one we're likely to tackle at this point. :)