Get Device
Fetch a specific device by ID from your Traccar server.
WARNING
- Standard users can only access devices they own or have been shared with them
- Admins and managers can access any device
Usage
Use the ThingsTelemetry\Traccar\Facades\Device::get(int $id) method to retrieve a single device.
php
use ThingsTelemetry\Traccar\Facades\Device;
$device = Device::get(6); // ThingsTelemetry\Traccar\Dto\DeviceDataResult
The response is an instance of ThingsTelemetry\Traccar\Dto\DeviceData.
php
$device->id; // 6
$device->name; // "Truck 1"
$device->uniqueId; // "ABC123"
$device->status->value; // "online"
$device->status->label(); // "Online"
$device->category->value; // "truck"
$device->disabled; // false
$device->lastUpdate?->toIso8601String(); // "2019-08-24T14:15:22+00:00"
$device->positionId; // 123
$device->groupId; // 1
$device->phone; // "+123456789"
$device->model; // "TK103"
$device->contact; // "Ops"
// Attributes (typed)
$device->attributes->speedLimit; // 80.0 (knots)
$device->attributes->fuelDropThreshold; // 5.0
$device->attributes->fuelIncreaseThreshold; // 10.0Key Result Items
status→DeviceStatusEnum representing device connection state (online, offline, unknown).category→DeviceCategoryEnum representing device category/type (car, truck, motorcycle, etc.).attributes→DeviceAttributesDataTyped DTO for device-specific attributes like speed limit, fuel thresholds, etc.lastUpdate→?CarbonImmutableWhen the device last sent a position update (null if never).
Related Operations
- Get All Devices - Fetch all accessible devices
- Create Device - Create a new device
- Update Device - Update an existing device
- Delete Device - Remove a device