computed attributes - howto?

Tom4 years ago

Hi,
I have a question to computeed attributes. From my freematics ONE+ Tracker I get the device Temperature as integer 45° C but in Traccar it is displayed as 4,5° C
How can I fix this with computed attributes?

I use the german version - and tried the german term "Gerätetemperatur" and the english versions (devicetemp device-temp devide_temp). And I tried the io130 (dec) and io82 (hex).

Evertytime I get undefined variable....

"what variable" * 10 ???

Thanks
Tom

Anton Tananaev4 years ago

Do you have a link to the protocol documentation?

Tom4 years ago

No I don't have this information, but it is the normal Freematics ONE+ in the traccar edition.

Anton Tananaev4 years ago

I found this documentation:

https://freematics.com/pages/hub/freematics-data-logging-format/

  • CPU temperature (in 0.1 Celsius degree)

https://github.com/traccar/traccar/blob/master/src/main/java/org/traccar/protocol/FreematicsProtocolDecoder.java#L156

So it seems like it's implemented according to the documentation. Maybe there's an issue in the documentation?

Tom4 years ago

Hi,
yes the docu seems to be wrong. I get values from 5.0° when the device is laying beside me on the desk in my living room - hope not to have 5° in my living room ;-)

Can I fix this in the code from traccar?

I'm not able to compile a runable version by now (doing it not on my raspi anymore but as you mentoned in an other thread now on my windows system, but the jar files don't run on my raspi by now, but that should be a setup problem in IntelliJ)...

Thanks
Tom

Anton Tananaev4 years ago

You can fix in the code or create a computed attribute.