Compute attribute to generate event when value change compared by last value

DeZ6 years ago

Hello

I have Teltonika FM6320 connected on tachygraph of truck and I try to implement compute attribute to generate event when driver is changing.

Attribute for the driver card is io195 and io196.
I use this in mysql to decode it :

CAST(UNHEX(concat(CONV(JSON_EXTRACT(attributes, '$.io195'),10,16),CONV(JSON_EXTRACT(attributes, '$.io196'),10,16))) AS CHAR)

Can you tell me if it's possible to set up compute attribute to generate event when the value change compare by last value ?

Thanks

Anton Tananaev6 years ago

Unfortunately there is no access to the last known location in computed attributes.

DeZ6 years ago

Thanks Anton,

In fact as you say, unfortunately.

But can you tell me if i can set up compute attribute to generate event (in table tc_events) each time event 184 (in table tc_positions) is fired ?

Anton Tananaev6 years ago

That should be possible.

DeZ6 years ago

Can you help to do it ?

I don't realy understand how compute attribute working to generate record in table tc_events.

Thanks

Anton Tananaev6 years ago

You need to return alarm as the expression result.

DeZ6 years ago

You mean that i must choose "alarm" in "attribute" parameter of Computed Attribute ?

drako6 years ago

Hey, Dez
I want to resolve the same issue too .. you have some solution or example ??

Thank you
George