Disable online/unknown/disconnected event generation

Jack3 years ago

When using protocol based on UDP or HTTP (as in OsmAnd):

  • "Status online" is raised when HTTP request is received
  • "Status unknown" happens after "status.timeout" setting (default 10 mins)
  • "Status offline" happens only on Traccar server restart

As such, the online/unknown/disconnected state doesn't really mean much, as the last update time is sufficient to explain the current state of the device and the color codes/events doesn't really represent a device state, but actually a server state, and this is generating confusion to the user.

I'm trying to hide this state info to users in a OsmAnd only scenario. I can successfully inhibit notifications for these state change events, but events are still generated and pollute the "event report" (I notice that the "event window" really is a "notification history", and this plays well with my intentions)

The event manual says "General configuration should be done in configuration file traccar.xml. By default all events handlers are enabled." but I don't see any relevant config in:

  • default.xml
  • Keys.java
  • configuration-file documentation

Searching old forum posts I find contradictory info:

  • Here it says that is not possible
  • Here it seems that "status.updateDeviceState" is the key, but the Motion, Trips and Stops manual says otherwise. I'm using this to generate "Device stopped" if device doesn't send valid "no motion" data for "report.trip.minimalParkingDuration", but I keep receiving status events.
  • Here it says you can disable offline state

Feels like there was a way to disable status events, but there's no more. Any light on this?

Thanks

Anton Tananaev3 years ago

You can't disable events with configuration. You have to disable them in the code.

The last link you have refers to default behavior for HTTP / UDP protocols. You can enable this behavior for other protocols as well. It doesn't really help in your case.