I'm working on an external application that uses Traccar as the tracking platform.
In my application, I use Calendars to represent operational schedules. For example, a multi-day event has one calendar for each operational day.
Each calendar is associated with additional information outside Traccar, such as the route that will be used on that day.
What I'm trying to determine is the best way to associate these schedules with a Group of devices.
At the moment I can think of several approaches:
- Maintain an external mapping between Groups and Calendars.
- Store the relationship in custom attributes.
- Use another Traccar object that I'm overlooking.
I'm not asking for a new Traccar feature. I'm interested in understanding what the recommended approach is when an external application needs to know which operational schedule belongs to a particular group.
How have others solved this kind of integration?
I'm especially interested in solutions that stay as close as possible to the existing Traccar data model and API.
Any suggestions or best practices would be appreciated.
I would store it in your application because managing it on individual devices would get old fast.
For the multi-day case, an external mapping also gives you a place to record when the association applies, rather than making the group carry one permanent schedule.
A minimal application-side record could be:
group_id | schedule_id | starts_at | ends_at | timezone
Store the operational date/time in the named local time zone and derive the UTC instants used for queries. Decide explicitly whether a group can have overlapping schedules and what happens when a device changes groups halfway through an event. If you need historical reports, retaining the assignment history matters more than the group's current membership.
I would keep route details and schedule ownership in the external application, with Traccar IDs as references. Reconcile deleted groups so an old association cannot silently point at a nonexistent group. This is an application design suggestion, not a tested Traccar extension.
AI-assisted response, checked against the scenario you described.
I'm working on an external application that uses Traccar as the tracking platform.
In my application, I use Calendars to represent operational schedules. For example, a multi-day event has one calendar for each operational day.
Each calendar is associated with additional information outside Traccar, such as the route that will be used on that day.
What I'm trying to determine is the best way to associate these schedules with a Group of devices.
At the moment I can think of several approaches:
I'm not asking for a new Traccar feature. I'm interested in understanding what the recommended approach is when an external application needs to know which operational schedule belongs to a particular group.
How have others solved this kind of integration?
I'm especially interested in solutions that stay as close as possible to the existing Traccar data model and API.
Any suggestions or best practices would be appreciated.