Computed Attribute - Cast issue

Sanjay Shah3 years ago

description type attribute expression
odometer number odometer odometer ? odometer > 1 : 0

Can you please confirm if anything is wrong here. As i keep on getting
WARN: Attribute cast error - ClassCastException

Anton Tananaev3 years ago

What's the odometer value type?

Sanjay Shah3 years ago

number

Anton Tananaev3 years ago

I mean in the position attributes. Can you please provide an example JSON.

Sanjay Shah3 years ago

"odometer": 5452778,
"distance": 0.0,
"totalDistance": 6356191.73,

Anton Tananaev3 years ago

OK. Are you sure you got an error on this specific sample? Something doesn't add up.

Sanjay Shah3 years ago

i am assuming, as i have just this and one more attribute attached to that device.

second one is

Event AC | string | event | in2==0?"AC OFF":"AC ON"

JSON sample
"in2": 0,
"odometer": 5452778,
"distance": 0.0,
"totalDistance": 6356191.73,

dwijadas3 years ago

Hi Sanjay, off-topic. Curious what device sends/generate such information

Sanjay Shah3 years ago

@dwijadas this are TK103 type of devices

@Anton. Can you please guide

Anton Tananaev3 years ago

I don't really have any ideas.