Online Status as Ignition Flag

Joystick2 years ago

Hi,

Not sure if it is possible but I am trying to use the "Online" status as a trigger for ignition but cannot get it to work.
I've tried using computed attribute examples below without any luck.

Attribute: Ignition
Expression: deviceStatus=="online"?true:false
Type: Boolean

and also

Attribute: Ignition
Expression: event=="online"?true:false
Type: Boolean

If someone has successfully got it to work, please share.
The searches I have completed did not return any result that worked.

Anton Tananaev2 years ago

What you're trying to do doesn't really make any sense to me. Computed attributes are executed when you receive some data from devices, so it is guaranteed to be online every time it's executed.

Joystick2 years ago

It is for a device that sleep most of the time and wake up with vibration which will then change status to 'online'.
I was hoping to then at this point flag ignition as true.
It's a very simple solar asset tracker with no inputs I can use to flag ignition, only vibration that will wake it up.

Anton Tananaev2 years ago

So you want it to always be "true"?

Joystick2 years ago

Was hoping to have it as true when online and false when offline but not sure if it is possible.
So the device wakes up on vibration and go online and ignition flag true, then when it go back to sleep and loose online status ignition flag false

Anton Tananaev2 years ago

We don't store anything in the positions table when a device goes offline, so what you're trying to do is not possible without a significant code customization.

Joystick2 years ago

Thanks for the clarification Anton.