Computed Attribute - Cast issue

Sanjay Shah2 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 Tananaev2 years ago

What's the odometer value type?

Sanjay Shah2 years ago

number

Anton Tananaev2 years ago

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

Sanjay Shah2 years ago

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

Anton Tananaev2 years ago

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

Sanjay Shah2 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,

dwijadas2 years ago

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

Sanjay Shah2 years ago

@dwijadas this are TK103 type of devices

@Anton. Can you please guide

Anton Tananaev2 years ago

I don't really have any ideas.