Skip to content

Query: Speed consitency and accuracy #95

@sshaikh

Description

@sshaikh

I've read a few previous issues so suspect I do understand some of the background of the situation here. But I feel it's worth revisiting for a fresh perspective.

The following composite tracker just wraps a single device tracker, one provided by your adjusted ha-gpslogger integration[1]. I believe that this should give a relatively robust speed that equals what is reported by the underlying device tracker. My GPS logger frequency is 4 minutes, which matches the updates in the chart.

However I am still seeing spikes:

Image

The blue line is the speed from composite, the red is the speed from the GPS Logger device tracker (extracted via template).

I believe the spike occurs when I use a tunnel with no reception, but given that GPS logger reports locations on time I'm not quite sure why it's off. I have two observations that may be related:

  1. Composite speed seems to lag behind GPS speed
  2. The values themselves can be wildly different

Looking at the source, I see that "last seen" values are used for the time divisor in the speed calculation. Are "last seen" values determined by location time or receive/recorded time?

Some further analysis:

  1. I do think that speed calculated from raw values is the way to go, even in a case like this (a single device tracker) since GPS reported speed can sometimes be unreliable while a location over time could be more accurate. This is why I'm not using the GPS speed directly itself.
  2. Zooming into the spike at 1352, we have the following points (distance provided by the proximity integration wrapped around the same GPSL device):
Image
HA Time HA time elapsed(s) GPS Time GPS time elapsed(s) abs distance via proximity (m) distance travelled via proximity (m) calc'd speed via proximity (m/s) distance via lat/lon (m) calc'd speed via lat/lon composite speed(m/s) GPS Speed (m/s)
13:47:50 2025-06-18T12:47:49.003Z 669 0.1 1.69
13:51:54 244 2025-06-18T12:51:52.996Z 243 500 169 0.69 173.3 0.7 0.7 1.25
13:51:55 1 2025-06-18T12:51:53.997Z 1 502 2 2 2.512 2.512 0.62
13:51:59 4 2025-06-18T12:51:57.394Z 3.3 489 13 3.25 13.025 3.94 4.3
2025-06-18T12:56:02.000Z 245 247.1 1.01 1.05
13:56:08 249 2025-06-18T12:56:03.000Z 1 257 232 0.93 6.079 6.079 1 0.94
- - - - - - - - - - -

To be honest I'm still trying to digest the above, but I have the nagging feeling that we could do better than the calculated column and GPS speed. In fact I'll update this table with the raw logged GPS data to see if we can.

[1] https://github.com/pnbruckner/ha-gpslogger

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions