GPS Tracker - (Bug) Accuracy channel doesn't work when linked to Number:Length item

OH 3 here and installed gps tracker. Once I add the equipment from thing everything works well except the Accuracy channel doesn’t update and instead shows ‘Err’. Looking into the log I see the following message:

2021-02-04 12:58:31.018 [WARN ] [e.internal.SseItemStatesEventBuilder] - Exception while formatting value ‘2559.0551181102364’ of item GPSTrackerjf_Accuracy with format ‘%d’: d != java.math.BigDecimal

By default the system creates this item as a Number:Length however it will not update unless I manually change it to Number.

Did you define a label or State Description to use %d? Or did that come from the binding? If you did it, use %.0f instead. If it came from the binding, file an issue on the binding.

%d only works when the value is an integer. If there are any decimal places it usually doesn’t work.

Hi Rich - I actually let the system create the items completely on their own. I did a ‘create equipment from thing’ within the model and let that process create the items.

OK, in that case the %d is probably coming from the binding. Bindings can offer hints on how to display the state of Items and it’s probably erroneously using %d for that Channel/Item. You should be able to fix the problem by setting the State Description metadata to %.0f on the Item. But the binding needs to be fixed as well.

good call on that - it worked! thank you - Learning all of the meta data entry has been quite the process.

Make sure to file an issue on the binding so they can fix the problem on their end too.

Github issue posted.

1 Like