janus пишет:Hi everyone
I need to get mileage for unit but not last value like with the unit.getmileage() function, i would like to know the value for a specific timestamp like 3days ago at 3pm for exemple. I don't want to use report regarding to the time of execution so is there a way to get it? I was thinking about getting messages for the periode, but we have units with Gps mileage so i think i need the wialon computed value of the mileage..
thanks
Good afternoon!
It's possible to get mileage counter values for a specific time with events/load request.
Example with getting all counters values for time range below:
svc=events/load¶ms = {"itemId": 111111,
"ivalType": 1,
"timeFrom": 1594291890,
"timeTo": 1594293890,
"detectors": [
{
"type": "counters",
"filter1": 0
}
],
"selector": {
"type": "counters",
"timeFrom": 1594291890,
"timeTo": 1594293890,
"detalization": 0x3
},
}
In response mileage counters values list will be in the field "selector" -> "counters" -> "0" with name "mileage"