##Description
This service returns available cycle time and driving time, which can be used for planning to determine which drivers have enough hours. A new Cycle Time Availability event will be sent when:
the EFS Host system receives a new duty status change event or an intermediate log event
a driver logs in or logs out of the mobile device
the EFS Host system receives the deletion of a duty status change event
the EFS Host system receives notification that the driver has taken or deleted an exception
Important! PeopleNet does not guarantee any ordering (chronological or otherwise) to the event data sent. For the Cycle Time Availability Service, the latest eventDate time + the lastDutyStatusChangeDate should be considered for a particular driver. That is, if you receive a record with a lastDutyStatusChangeDate earlier than one you already have for a particular driver, you should ignore the newly received record, as the data you already have is more current than what you just received.
SQS
p.{companyId}.mos.hos.cycle-time-availability
###Schema
Cycle Time Availability events will be delivered in a JSON format.
Important! JSON standards and attributes may change at any time. Follow industry best practices and standards to ensure that your application gracefully handles new elements and other small changes to this service. It is also a good idea to periodically check this documentation, the PeopleNet Newsletter, or work with your PeopleNet contact to ensure you are using the latest standards for your data. In particular, new data elements may be added at any time. If large structural changes are required for this service, they will be implemented in such a way as to preserve the existing functionality.
{
"version":"version of service",
"type":"Cycle Time Availability",
"companyId":"CID of company",
"eventDate":"timestamp in GMT",
"driverId":"driver's ID that is used to log into the device",
"driverName":"driver's name",
"vehicleNumber":"vehicle number",
"shippingInfo":"Shipping information entered by driver",
"trailerNumber":"Trailer number entered by driver",
"coDrivers":"entered by the driver or populated by the device/PFM",
"dataEndDate":"date and time, in GMT, of last data call",
"lastDutyStatus":"Code indicating last duty status",
"lastDutyStatusAddlInfo":"indicates oilfield, in attendance, reduced rest, and personal conveyance duty statuses",
"lastDutyStatusChangeDate":"date and time of last duty status change",
"currentHOSRegulation":"Current HOS Regulation in effect (only one)",
"drivingSecondsToday":"Driving seconds today",
"onDutySecondsToday":"On-Duty seconds today",
"sbSecondsToday":"Time spent in SB today (in secs)",
"offDutySecondsToday":"Time spent in off duty today (in secs)",
"drivingSecsYesterday":"Time spent driving yesterday (in secs)",
"onDutySecsYesterday":"Time spent on duty yesterday (in secs)",
"sbSecsYesterday":"Time spent in SB yesterday (in secs)",
"offDutySecsYesterday":"Time spent off duty yesterday (in secs)",
"secondsWorked":[
the array contains the seconds worked for each of the last X days. The first value is "today-1",
"today-2",
"today-3",
etc.
],
"hosRules":[
{
"category":"HOS Category (US, CANADA, STATE, PROVINCE, SPECIALTY)",
"ruleName":"Rule name – see table below",
"ruleHours":"total on-duty hours allowed per cycle under rule",
"ruleDays":"total days per cycle",
"drivingSecondsAvailable":"Driving seconds available (as of Data End Date)",
"onDutySecondsAvailable":"On-Duty seconds available (as of Data End Date)",
"lastResetDate":"date and time, in GMT, of last reset",
"USResetStartDate":"date and time, in GMT, of the last valid start of the new US 34 hour reset rule (two 1am-5am periods and 168hr since previous 34 hr reset)",
"cycleResetHours":"total off-duty hours required to complete a reset",
"cycleTimeSecondsRemaining":"Cycle time seconds remaining",
"remainingOnSecsUntilBreakRequired":"total seconds of on duty or driving remaining before break required",
Note: As of September 29, 2020, "remainingOnSecsUntilBreakRequired":"total seconds of driving remaining before non-driving break required",
"secondsGained":[
array that contains the seconds gained in each of the next X days. The first value is “today+1”,
“today+2”,
“today+3”,
etc.
"drivingSecsSinceShortBreak":"total seconds of continuous driving since required short break. Alberta Province only.",
"lastReducedRestStartDateTime":"Last time driver used reduced rest. Alberta Province only.",
"lastReducedRestDuration":"Total seconds of last reduced rest. Alberta Province only.",
"hoursBetweenReducedRest":"Regulation parameter, which is hard coded to 168. Alberta Province only."
]
}
]
}
{
"version": "1.00",
"type": "Cycle Time Availability",
"companyId": "1234",
"eventDate": "03/22/2012 15:41:04",
"driverId": "123456",
"driverName": "JOHN DRIVER",
"vehicleNumber": "82204",
"shippingInfo": "3332497",
"trailerNumber": "49582",
"coDrivers": "",
"dataEndDate": "03/22/2012 15:35:10",
"lastDutyStatus": "2",
"lastDutyStatusAddlInfo": "",
"lastDutyStatusChangeDate": "03/22/2012 15:18:46",
"currentHOSRegulation": "US Federal 70/8 Long Haul",
"drivingSecondsToday": "4786",
"onDutySecondsToday": "8908",
"sbSecondsToday": "0",
"offDutySecondsToday": "800",
"drivingSecsYesterday": "6000",
"onDutySecsYesterday": "0",
"sbSecsYesterday": "400",
"offDutySecsYesterday": "80000",
"secondsWorked": [
"0",
"0",
"0",
"0",
"11207",
"6647",
"32899"
],
"hosRules": [{
"category": "US",
"ruleName": "US Federal 70/8 Long Haul",
"ruleHours": "70",
"ruleDays": "8",
"drivingSecondsAvailable": "34814",
"onDutySecondsAvailable": "36706",
"cycleResetHours": "34",
"lastResetDate": "03/22/2012 11:46:56",
"USResetStartDate": "03/10/2012 01:00:00",
"cycleTimeSecondsRemaining": "238306",
"secondsGained": [
"0",
"0",
"0",
"0",
"0",
"0",
"0"
]
}, {
"category": "Canada",
"ruleName": "Canada Cycle1 70/7",
"ruleHours": "70",
"ruleDays": "7",
"drivingSecondsAvailable": "36706",
"onDutySecondsAvailable": "36706",
"cycleResetHours": "36",
"lastResetDate": "03/22/2012 11:46:56",
"cycleTimeSecondsRemaining": "238306",
"secondsGained": [
"0",
"0",
"0",
"0",
"0",
"0"
]
}]
}
###EXAMPLE: JSON for Alberta Provincial CTA
{
"version": "1.00",
"type": "Cycle Time Availability",
"companyId": "1234",
"eventDate": "03/22/2015 15:41:04",
"driverId": "123456",
"driverName": "JOHN DRIVER",
"vehicleNumber": "82204",
"shippingInfo": "3332497",
"trailerNumber": "49582",
"coDrivers": "",
"dataEndDate": "03/22/2015 15:35:10",
"lastDutyStatus": "2",
"lastDutyStatusAddlInfo": "RR",
"lastDutyStatusChangeDate": "03/22/2015 15:18:46",
"currentHOSRegulation": "Alberta Provincial",
"drivingSecondsToday": "4786",
"onDutySecondsToday": "8908",
"sbSecondsToday": "0",
"offDutySecondsToday": "800",
"drivingSecsYesterday": "6000",
"onDutySecsYesterday": "0",
"sbSecsYesterday": "400",
"offDutySecsYesterday": "80000",
"secondsWorked": [
"0",
"0",
"0",
"0",
"11207",
"6647",
"32899"
],
"hosRules": [{
"category": "US",
"ruleName": "US Federal 70/8 Long Haul",
"ruleHours": "70",
"ruleDays": "8",
"drivingSecondsAvailable": "39600",
"onDutySecondsAvailable": "50400",
"cycleResetHours": "34",
"lastResetDate": "",
"USResetStartDate": "",
"cycleTimeSecondsRemaining": "252000",
"remainingOnSecsUntilBreakRequired": "28800",
"secondsGained": [
"0",
"0",
"0",
"0",
"0",
"0",
"0"
]
}, {
"category": "Canada",
"ruleName": "Canada Cycle1 70/7",
"ruleHours": "70",
"ruleDays": "7",
"drivingSecondsAvailable": "46800",
"onDutySecondsAvailable": "50400",
"cycleResetHours": "36",
"lastResetDate": "",
"cycleTimeSecondsRemaining": "252000",
"secondsGained": [
"0",
"0",
"0",
"0",
"0",
"0"
]
}, {
"category": "PROVINCE",
"ruleName": "Alberta Provincial",
"drivingSecondsAvailable": "46800",
"onDutySecondsAvailable": "54000",
"drivingSecsSinceShortBreak": "249168",
"lastReducedRestStartDateTime": "03/21/2015 15:35:10",
"lastReducedRestDuration": "14400",
"hoursBetweenReducedRest": "168"
}]
}