Accessing motionTime in Computed Attributes

bluelaser a month 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 a month ago

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

bluelaser a month ago

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

Anton Tananaev a month ago

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

bluelaser a month 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 a month ago

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

bluelaser a month 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 a month ago

Try this:

fixTime.getTime()

Return value is in ms.

bluelaser a month ago

That is amazing memesaregood, thank you very much.