Ignoring motion value from Teltonika device

Kaldek13 days ago

So I'm back around again with my attempts to get reliable delivery/stop tracking for delivery trucks. There are a whole bunch of issues with this but it all boils down to the fact that I need Traccar to not consider the motion flag from Teltonika devices. I can stop the flag being sent, but then the motion flag would always be zero. The Motion, Trips and Stops documentation mentions using Computed Attributes to override the flag but I'm not exactly sure how I would go about that.

For some context:

  • Deliveries can be as quick a 90 seconds so this impacts the timeouts I have to use. I've got it set to 120 seconds to try and catch most deliveries but avoid traffic lights and congestion being an issue.
  • I can't use Ignition, because the drivers leave the engine running during many deliveries
  • I can't use the Teltonika device's "Movement Source" set only to "Accelerometer" because the accelerometer doesn't stop reporting "motion" until 60 seconds after it ends.
  • I can't reduce the Accelerometer timeout because then traffic lights become stops.

Basically if I can nix the Teltonika motion flag for this device and just rely on the GPS tracks, allowing Traccar to calculate it, I think I'll be in a good place.

Anton Tananaev13 days ago

You can just return null from a computed attribute. That will remove the value. Make sure to set attribute priority to a negative value to make sure it's executed early in the pipeline.

Kaldek13 days ago

Ahhhhh, of course.

Kaldek12 days ago

Thanks Anton, I can confirm this works exactly as advertised and as soon as the GPS speed is zero, Traccar marks Motion as No.

Motion Nullifier.jpg

Anton Tananaev12 days ago

You don't really need motion ? null : null. You can just do null.

Kaldek10 days ago

Thanks Anton, I guess I just got in the habit of doing that as I had a bunch of log warnings for computed attributes that sometimes aren't always sent.

Anyway, this is working perfectly. About the only remaining issue now is that they sometimes do deliveries within 500 metres/300 seconds of each other and they get recorded as a single stop. I'll let the customer choose what to do about those, as tuning these values can have other unintended consequences. There is also the occasional traffic light getting recorded as a stop, but I think I would end up chasing my tail trying to tune that out.

Byron 7 days ago

you can also use another input from your teltonika device, if you use fmc920 first digital input is ignition and can use the grey line as both digital in and analog in line using positive, so it will report as in2=1 or 0 or adc1=0-14volts , you can connect it to the brake light and use computed attributes to be idk something like ignition == true && motion == false &&in2==1 to be like if stopped more than 60seconds and in2=1 <brake is pressed in red light be treated as in motion and not trigger a stop.. just an idea, or connect it to the quickstand every time its pushed down to hold the bike be a stop would require thinking how to trigger a positive tho, or if using a different teltonika model can use groundsense and read negative input a bit easier...

Kaldek7 days ago

In this case, this is an FMM880 which has no inputs, but I get your logic.

Byron 7 days ago

In that case you need to purchase, the easy way, a teltonika eye sensor and link it to the device and calibrate Bluetooth signal to read about 1.5 meters max, then put these on helmet, and many ways you can go about it but the most simplest is since it’s configured at low power and will loose signal past 1.5 meters well Bluetooth:0 meaning guy is doing a delivery comes back and on motorcycle Bluetooth:1, the harder way is to buy Chinese Bluetooth beacon 5-10 dollars but you have to decipher the beacon data inside the teltonika configuration have con configure little or big Indian location bit and multiplier etc…