Alert device stop by time

Evanderson3 years ago

With the computed attributes how to generate an alert when the vehicle is stopped and connected for more than a certain time?

I did it:

alarm
ignition && !motion ? "stop" : null
string

but not being able to compare the time.
How to make?

Anton Tananaev3 years ago

There's no attribute for connection time.

Evanderson3 years ago

I'm not interested in connection time. And yes in the interval that is stopped.

Anton Tananaev3 years ago

and connected for more than a certain time

I'm not interested in connection time

¯\_(ツ)_/¯

Anyway, stopping time is also not available as an attribute.

Evanderson3 years ago

i'm so sorry. My mistake.

"connected" = 'ignition ON".

Can I calculate the received position time (fixtime) minus the current time?

Eg.

if(currentTime - fixtime > 3minutes) .....

That way only generate the alert/event after a few minutes?

Anton Tananaev3 years ago

It makes no sense to me. Computed attribute is only executed when a position is received.

Ronald Rodriguez3 years ago

This calculation can be used for the following.

In Caribbean countries, drivers start their vehicles to use the cold air.

this consumes fuel. In the Dominican Republic, the police have many situations like this, in addition to the fact that the patrols do not carry out the routes that they have to because they consume fuel in cold air.

Sorry for my english