#9522
leo
Keymaster

Hi @cytoplyu@gmail.com, apologies for the delay.

dev_idle and vehicle_dev_idle are in fact cumulative values, dev_idle is the devices hardcoded value that increments until there’s a device change.

while vehicle_dev_idle is a user editable offset from the dev_idle.

In most cases these are identical.

your best bet to get the time that a vehicle spends in Idle is to either use the counters API or the rawdata api with a resampled request.

example:

 

https://pegasus1.pegasusgateway.com/api/counters?vehicles=2600&from=2019-10-05T00:00:00&to=2019-10-05T23:59:59&tz=America/New_York&tz=America/New_York

https://pegasus1.pegasusgateway.com/api/rawdata?vehicles=2600&from=2019-10-05T00:00:00&to=2019-10-05T23:59:59&tz=America/New_York&fields=dev_idle,vehicle_dev_idle&resample=event_time&freq=31D&how=dev_idle:diff,vehicle_dev_idle:diff&tz=America/New_York

in both responses the data is returned in seconds.

"dev_idle": 4261.0