Accessing motionTime in Computed Attributes

bluelaser 18 hours ago

Is the motionTime device attribute the last time the device was determined to be in motion for the new trips logic?

If so is it possible to evaluate the value of motionTime in a Computed Attribute?

Anton Tananaev 18 hours ago

It's not possible to access it from computed attributes.

bluelaser 18 hours ago

Is there any way to get a timestamp in a position as a number in computed attributes?

Anton Tananaev 17 hours ago

Which timestamp? Didn't I just answer this question?

bluelaser 17 hours ago

Any timestamp that is present in the position. No, you didn't answer that question yet. I would like to compare the difference between 2 timestamps in computed attributes. If I use fixTime for example this is a Date so JEXL cannot use it for this purpose. So I am asking if there are any values that computed attributes has access to which are a datetime stamp in a Number type.

Anton Tananaev 17 hours ago

You should be able to get timestamp from a Date object. Why is that an issue?

bluelaser 17 hours ago

When I try to use computed attributes to add it to a new attribute with the type number, it throws an error in the logs because Date cannot be cast to a number.

memesaregood 11 hours ago

Try this:

fixTime.getTime()

Return value is in ms.

bluelaser 9 hours ago

That is amazing memesaregood, thank you very much.