Computed attribute for T12 battery level

Loic 6 years ago

Hi,

I am testing T12 tracker from VJOY . I would like to show the battery level in the frame status on the bottom of the page to the left. I think i have to set that in the computed attribute but i don't know how to do that .

Someone to help me please,

(864768010776778,ZC07,100218,A,5037.34518N,00305.63790E,0.189,163609,000.0)(864768010776778,ZC20,100218,163607,6,412,65535,255)

What's the good format expression to add in attributes ?

Anton Tananaev6 years ago

You don't need any computed attributes. Traccar will automatically display battery level if your device reports it.

Loic 6 years ago

Thank you for your reply . T12 tracker reports it in the hex like in the picture joined :

https://www.dropbox.com/s/ria37qg54s9omqk/battery%20level.png?dl=0

But i can't see it on the left windows "status" on the web server. Why ?

PROTOCOL :

1.6 Battery Level(ZC20)

(013632651491, ZC20,040613,040137,6,421,112,0)

"("         stands for packet start
"013632651491"  stands for tracker ID
" ZC20"        stands for battery level command
"040613"     stands for data, 04/June/2013
"040137"     stands for time,  04:01:37, UTC time
"6" stands for battery level, range is 0-6,255 refers to invalid rate
“421” stands for battery voltage, eg 4.21V,65535 refers to invalid rate
“112” stands for battery inputvoltage, eg11.2V,65535 refers to invalid rate
“0” stands for not installed(0) or installed(1), 255 refers to invalid rate
“0”, stands for digital inputs //customized only
“0”, stands for analog inputs //customized only
“0”, stands for analog inputs //customized only
")"        stands for packet end

regards

Anton Tananaev6 years ago

Probably because your device doesn't report it, or at least it didn't report it in the last message (that you see in state).

Loic 6 years ago

In the picture in attachment you can see in the hex with the red circle the value of battery level so it report it isn't it ? it' s the last message

 17105  2018-02-10 22:14:10 DEBUG: [77EC3913: 5002 < 154.56.88.164] HEX: 283836343736383031303737363737382c5a4330372c3130303231382c412c353033372e33333733314e2c30303330352e3634373033452c302e3430312c3231313430382c3030302e3029283836343736383031303737363737382c5a4332302c3130303231382c3231313430382c362c3430342c36353533352c32353529
 17106  2018-02-10 22:14:10  INFO: Position filtered by Distance filters from device: 864768010776778 with id: 1
 17107  2018-02-10 22:14:10  INFO: [77EC3913] id: 864768010776778, time: 2018-02-10 22:14:08, lat: 50.62229, lon: 3.09412, speed: 0.2, course: 0.0
Anton Tananaev6 years ago

It's filtered, as you can clearly see from the log.

Loic 6 years ago

I thought that just position was filtered ... I will try to modify default.xml ? or traccar.xml ?

Anton Tananaev6 years ago

Are you asking me? You added filtering, so you should know better where you added it.

Loic 6 years ago

sorry anton but i have followed so much advices that i forgot where i add a filter . I just remove lines in default.conf and restart server

Loic 6 years ago

I removed the filters and it works . Thanks Anton