Put Offline device status with API

Nico286FR4 years ago

Hello,
Can I force a device to OFFLINE status with API?
I try with attributes calculated, I try to put "offline" in status field with the request put /api/devices/{} but nothing.
The server response is 200 but the device status don't change.
Thank you in advance for your response.
Have a good day

Anton Tananaev4 years ago

There's no API for it.

Nico286FR4 years ago

Hi Anton!
Many thanks for your quick response!

How can I send an event from a device via the APIs without the latter changing its status?

I tested by attributes but it doesn't work.

Anton Tananaev4 years ago

What event? What have you tested exactly?

Nico286FR4 years ago

Ok sorry.
I have my proper tracker and I use a similar OSMAND protocol to communicate with traccar server on my linux via API.
After ten minutes when the device status is changing (online to unknown), I test my network tracker to see if the device is always power on.
If no response, I would like to send an event so that the controller can see it on the screen.

I test a computed attribute, and attribute alarm but nothing appear in event screen.
Today, i tested if no response to send an osmand data protocol with only timestamp and alarm(no geo coordinates) the device status change to online.

In summary, I just want to send an information on the screen to say that my tracker is no longer under network.

Many Thanks

Anton Tananaev4 years ago

Unfortunately I still don't understand what you want to do. Are you trying to send something to change device status?

Nico286FR4 years ago

Yes , i just want to change device status

Anton Tananaev4 years ago

As I said before, it's not possible.