A Python-based automation system that interfaces with the Nero fleet management API to track ignition events, calculate operating hours, and generate detailed reports for a fleet of 26 heavy machines.
The company faced critical challenges with manual equipment tracking that took 2-3 hours per week and had 15-20% error margins, making accurate customer billing difficult. They lacked visibility into which equipment was idle or underutilized, and maintenance scheduling was based on estimates rather than actual operating hours.
Usage data existed in an API but wasn't easily accessible or reportable. The fleet included diverse equipment from excavators and dozers to specialty equipment like crushers and grinders.
We built a Python automation tool that interfaces with the Nero fleet management API to fetch real-time ignition events, process and match on/off events, and generate detailed reports for each piece of equipment.
API Integration with Smart Pagination — Handles large datasets by fetching events in 200-record batches with automatic pagination management using timestamp-based continuation. Implements HTTP Basic Authentication and includes safety checks to prevent infinite loops.
Event Matching Algorithm — Pairs ignition 'on' events with corresponding 'off' events across potentially thousands of records. Calculates precise duration in minutes with 2 decimal places and handles edge cases like missing off events and incomplete sessions.
Batch Processing & Error Resilience — Processes all 26 vehicles sequentially with clear progress indicators. Continues processing even if individual vehicles encounter errors and provides summary statistics for each vehicle including event counts and total runtime.
Automated CSV Reporting — Generates individual CSV files per machine with standardized format including date, machine, start time, stop time, and minutes. Creates professional reports ready for billing and maintenance use.
The automation reduced tracking time by 95% — completing in under 5 minutes what previously took 2-3 hours manually. The system delivers precise to-the-second tracking, replacing the previous 15-20% error margin with exact calculations.
Fleet analysis identified 2 idle machines worth redeployment, and the accurate data enabled proper customer billing and proactive maintenance scheduling based on actual operating hours rather than estimates.