Time vs. timenow from Device: State trigger

I have a Device: State trigger for one workflow. I would like to use the timestamp referring to the time the payload was generated by our device, not the time the payload was received by Losant.

Looking in root object in this workflow, I see two fields: time and data.timenow. Can you tell me which of these fields represents the timestamp as-reported in the payload, not at-time-of-reception?

Hi @Alexander_Farley,

The time variable is the timestamp when the workflow was triggered (time of reception), so I believe data.timenow would be the timestamp generated by your device.

Thanks!
Julia

So @Alexander_Farley,

Just want to elaborate this a bit.

So, time on the root of the payload is not necessarily the time that the workflow was triggered. It’s the time of the trigger event. So, in this case, time would be the time the device reported state. Now, here is where things get tricky, you have the ability ( when you’re sending state ) to override the time. If you override the time, time is what ever you sent with the state request.

For example, let’s say your device was offline for 1 hour, collecting data every 5 mins. Upon connection, it reported all of its data and overrode the time, so each state is recorded correctly in Losant. For each one, it would trigger a workflow that had the Device: State Trigger, on each payload time would be overridden time (aka it would be a past time).

Revelent Docs: