There's a property on the device object.
motion?
Is that a device property?
Oh no, that a position attribute. Could you give me the property name, please?
If you'refering to device status ( online, offline, unknown), I'd be curious to know if it answer my request.
A device can be online but stopped or online and moving. At least, that's my assumption. That's why I was leaning onto the position motion attribute. Let me know if I'm mistaken.
I'm obviously not referring to the device status. What properties do you see on the device?
the device has this schema:
{
"id": 0,
"name": "string",
"uniqueId": "string",
"status": "string",
"disabled": true,
"lastUpdate": "2019-08-24T14:15:22Z",
"positionId": 0,
"groupId": 0,
"phone": "string",
"model": "string",
"contact": "string",
"category": "string",
"attributes": {}
}
I think you forgot to provide any context. Where do you want to get it? Web? API? Backend?
Oh, sure.From Backend or API. Whatever works between those two.
On the backend you should have more properties. Check again.
One of motionStreak or motionState should be the relevant one.
Now that I think of it, I was definitely operating from API. I don't have control on the other sides of our Traccar instance.
I now understand why those properties were missing from my previous messages: they are ignored by Jackson serialization.
Is there any chance API returns them? If not, I'm open to alternatives: like reading motion state attribute from latest position
The API doesn't return them. Alternative is using the motion attribute from position, but note that it's a bit different from the events. Events are generated when motion value is constant for minimum duration.
I'll use that alternative, thanks.
I know that traccar fires an event for deviceMoving and deviceStopped. Is there any other way to know that without using these events? I long for any useful property or perhaps a computed attribute