Avatar

Get mileage total for a day based on DutyStatusLogs for that day

1

We track graph logs for drivers.  When we get all of the DutyStatusLogs for a driver, is there any way to calculated or obtain how many miles the driver drove on that one day?  I have searched far and wide, to no avail.  If i have 10 DutyStatusLogs for a driver, for a specific date... how do I find out how many miles he/she drove that day as well?

Erik Fisch Answered

Please sign in to leave a comment.

6 comments

0
Avatar

Hi Erik

Thanks for the question. If you're inquiring about our API, this is not something that's currently possible though if any customer needs it anytime they can ask it as feature request. Then our developer team will look at ths issue. However, if you're referring to the database, you can view the miles driven for a specific driver on the top right corner of their Duty Status Logs. This will be listed next to Total Driving Distance.

Thanks once again for your question. If you have any other questions, feel free to post them.

Regards
Wasi Ahmed

Wasi Ahmed 0 votes
1
Avatar

Hi Erik

I discussed with my ELD Manager. It's possible to calculate distance traveled using a Get call for StatusData against "DiagnosticOdometerAdjustmentId".

api.call("Get", {
    "typeName": "StatusData",
    "resultsLimit": 10,
    "search":{
        deviceSearch:{id:"b1"},
        diagnosticSearch:{"id":"DiagnosticOdometerAdjustmentId"},
        fromDate:"2017-12-20T01:16:47.000Z",
        toDate:"2017-12-20T01:16:47.000Z"
    }
}, function(result) {
    console.log("Done: ", result);
}, function(e) {
    console.error("Failed:", e);
});
/*opt nomin*/

And you will be glad to hear that we have it coming available as part of the dutystatuslogs object soon as well. Apologies for my previous comment.

Regards
Wasi Ahmed

Wasi Ahmed 1 vote
0
Avatar

Thanks for the response Wasi!

I see that I can do that for the driver, but the issue that I am having is when a driver is not driving in the same vehicle for the entire day.  Another issue I am having is figuring out how many miles were driven in a day when the last DutyStatusLog I have for that date is "D" (driving) status... what do I do when I don't have the odometer for the last second of that day?  For instance:

I get a duty status log that is "D", at 10:45pm on 01/01/2001

The next duty status log I get is "ON" (so he stopped driving), at 3:25am on 01/02/2001

How do I figure out how many miles he drove the last 1 hour and 15 minutes on 01/01/2001?

Or, another situation is that I don't have any more logs after the one at 10:45 on 01/01/2001? Like how do I know if there is another log coming on that day after that one or not? Are there any "rules" or anything like for when the API with release records?  Like when does the API release pings for the public to consume?  Is there a delay or something to that effect so we know that we have complete data for a day and driver?

Sorry for all of the questions, this is something that I have been working on for quite a while now and I can't seem to find any definitive answers regarding the issues that I am having...

Thanks again.

Erik Fisch 0 votes
0
Avatar

This is a better example of what I am looking for - how do you guys get that 34.2 miles for the day that was continued?  I have looked at all the data points and cannot for the life of me figure out how you guys are getting those numbers, and they are the ones that we need right now.  

Erik Fisch 0 votes
1
Avatar

Hi Erik, 

It's a bit tricky. 

What we do on our end is we realize that the log has gone into the next day, and we have a placeholder at midnight of the driver's local time. We then make three API calls for StatusData with diagnostic search id: diagnosticOdometerAdjustmentId. One at the start time of the log, one at midnight, and another at the end of the dutystatuslog (the beginning time of the new dutystatuslog). We then display the difference in the log on the day before, and the log that continues in the next day (by taking the difference of the reading at midnight, and at he end of the log). 

To find the next dutystatuslog, use this search property -> includeBoundaryLogs: true

This will give you the previous dutystatuslog, as well as the next one (if one exists).

 

Vik Sridhar 1 vote
0
Avatar

Thanks for the response.  We did end up coming up with something very similar to what you just explained.  You are correct that this is a bit tricky, but I think that we have what we need for now.  

Thanks everyone for all of the help!

Erik Fisch 0 votes