Device Tracker - send data to device

Is there a way how to send data to device tracker platform? I was trying to use device_tracker.see service, however no data are actually sent to server.
I am using self hosted Traccar platform. Home Assistant is pulling data correctly and I need to change some state of devices.
I was thinking, that it might be caused by the implementation of the device tracker for the traccar here: https://github.com/home-assistant/core/blob/48c0cfb25c0d403506ac5fd0c68251712228e71f/homeassistant/components/traccar/device_tracker.py
I haven’t found any method to send data back to server.
What would be the best way if Traccar has a REST API that can be called?

Hi there… What is the problem that you are facing with device_tracker.see service? In normal condition, it should enable you to change the state of device tracker manually. But this state will be changed when there is updates from the tracar side.

If you want to use the rest api, please have a look at restful sensor of HA.

Hi,
the problem with device_tracker.see service is, that when I invoke it, nothing is being sent to traccar. In my opinion the reason is, that it is not implemented in the device_tracker.py script that I linked. I would be willing to implement it myself, I just don’t know which interface from homeassistant classes to extend.

The RESTful sensor is a good idea. However that would mean I would have 2 completely different sensors. One will be coming from the device_tracker with the values… And then I would have a sensor where I am sending the values back if it has been changed in the UI. That would make a big mess in my opinion. That’s why I prefer to implement the traccar device_tracker in the way, that it can send data back to the server (and thus later to the sensors).

device_tracker.see service wont sent any info to tracker, it just updates the state of the sensor in HA. As i understand this, it would not be possible to change the parameters of traccar from HA or send info to it, its an independent system and HA just extracts values from it.

Thank you, that means I really need to use the RESTful sensor for communication from HA to Traccar. That helps, I can work on that. Thanks

1 Like