Show battery percentage from H02 protocol ?

gaskooa year ago

Hello, can someone help me how to show battery percentage from SinoTrack ST-915. Thanks

https://ibb.co/NV3RJSt

Anton Tananaeva year ago

You can add a computed attribute to convert a generic IO value into battery level.

gaskooa year ago

Can you help me with that ?

Anton Tananaeva year ago

I can help you by pointing to the documentation:

https://www.traccar.org/computed-attributes/

There's also a bunch of examples on the forum if you search.

gaskooa year ago

I trying all day but i cant resolve :)))))

Anton Tananaeva year ago

Is there a reason you have not shared the details?

gaskooa year ago

I tried on this way batterylevel ? io5 : null
Dosent show battery only whe i change "null" to number battery shows

Anton Tananaeva year ago

What else have you tried? Please provide full details upfront.

gaskooa year ago

I try on this way too "event ? (event == "5" ? "io5" : null):null".
I dont have any idea anymore.

Anton Tananaeva year ago

Have you tried "io5"?

gaskooa year ago

Yes, nothing show. I tried use command io5 ? io5 : null, he show me number :))))

https://ibb.co/Q6LBZM3

Anton Tananaeva year ago

Wait what? Why are you using command and not battery level?

gaskooa year ago

I use all time battery level.
But before 10 min i try Attribute "Command" for fun and show me number. :)

gaskooa year ago

I fix the problem. I remote connect to MySQL and in table tc_attributes ID 2 change TYPE from number to string.

MySQL

Anton Tananaeva year ago

This is dangerous. You should actually parse the string into number instead.