Convert "io5" on protocol "h02" to Battery level via Computed Attributes AND show it

Nina 7 hours ago

Hello,

I know the subject has come up several times here. I've read through all posts regarding and have been tinkering for days, I waited (bc that was suggested in one of the posts) for several days, switched the device on and off - all to no success. It seems I am missing the final step.


As the title says, the Battery level of one of my devices is shown as "io5", and I'd like it to show as "Battery level". I already added a computed attribute like this:

2026.10.09, 16.22.38.png

I tested it, and the test works.


Then I linked the attribute to the corresponding device:

2026.10.09, 16.24.21.png


That's where I'm stuck. I don't see the Battery level in the overview...

2026.10.09, 16.25.46.png

... or in the little info-window (the display of the Battery level is switched on here, and working for the devices that provide it)...

2026.10.09, 16.26.24.png

... or in the details...

2026.10.09, 16.27.42.png


It's driving me crazy - what am I missing? I hope somebody can point me in the right direction. If that's important, I'm on Traccar 6.15.3 .

Thank you so much
Nina

Anton Tananaev 7 hours ago

One thing I recommend trying is assigning a fixed value in the attribute. See if that works. Make sure you also check logs for warnings.

Nina 7 hours ago

Hello Anton,

thank you for your quick reply. Unfortunately, I still don't seem to be able to fix it :(

First I'd like to show you the log:

2026.10.09, 17.04.30.png

Are the warnings important?


Then, after reading your suggestion and cheking out https://www.traccar.org/computed-attributes , I tried the following:

2026.10.09, 17.01.53.png
2026.10.09, 17.02.31.png

Test fails on both. Then I tried

2026.10.09, 17.07.43.png

Test returns "true" - but I'm certain that that's not what I need - right?

Thanks
Nina

Nina 6 hours ago

Ps: Here is the log as a text:

Liquibase: Update has been successful. Rows affected: 1
WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::staticFieldBase has been called by com.google.inject.internal.aop.HiddenClassDefiner (file:/opt/traccar/lib/guice-7.0.0
WARNING: Please consider reporting this to the maintainers of class com.google.inject.internal.aop.HiddenClassDefiner
WARNING: sun.misc.Unsafe::staticFieldBase will be removed in a future release
Database is up to date, no changesets to execute
WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::staticFieldBase has been called by com.google.inject.internal.aop.HiddenClassDefiner (file:/opt/traccar/lib/guice-7.0.0
WARNING: Please consider reporting this to the maintainers of class com.google.inject.internal.aop.HiddenClassDefiner
WARNING: sun.misc.Unsafe::staticFieldBase will be removed in a future release
Database is up to date, no changesets to execute

Sorry for sending it as a picture first

Anton Tananaev 6 hours ago

These warnings are unrelated.

All of the expressions you have on the screenshots make absolutely no sense and they're invalid.

Nina 6 hours ago

Okay thank you, so we can rule out the log?

Could you tell me, how I should do it? I can't figure out how to assign a fixed value in the attribute - I don't even know where to start.

Thanks
Nina

Anton Tananaev 5 hours ago

You just literally put the number. I strongly recommend you read the documentation on the syntax.

Nina 4 hours ago

Thanks, I really tried, but these things are not easy for me at all. I did what you recommended though:

2026.10.09, 19.55.04.png

I will now wait until the tracker reports data again, and then check! I will get back to you here.

Have a nice evening
Nina

Nina 4 hours ago

Ps: Did change it here as well:

2026.10.09, 19.58.42.png

Anton Tananaev 4 hours ago

This is wrong. Do not use two attributes at the same time. They can randomly override each other.

Nina 4 hours ago

Thanks! I fixed it:

2026.10.09, 20.06.53.png

I really hope it works. I will get back to you here!

Nina

Nina 1 hour ago

You truly are a wizard, Anton:

2026.10.09, 22.47.52,748 (Screenshot).png


Now to the next step:

Do you have any idea on how to get the real value there? I wonder why it wasn't working with my "io5 ? io5 : null" - the test always comes back without any errors:

2026.10.09, 22.51.08,782 (Screenshot).png

Thanks again
Nina

Anton Tananaev 44 minutes ago

I suspect the issue is the data type. It's probably a string, so you need to convert it into a number.