I need some help maybe there is some custom node already that can do this.
I query a device for N different properties (let’s call them columns), in this example 3 properties all with the same interval, range, meaning that all 3 series will have the same timestamps.
I want to merge the 3 individual series together in an array with dictionary of timestamp, col1,col2,… coln.
I don’t mind writing a function node but happy to re-use whatever is available.
Also would be nice to have a Time Series Node which allows multiple attributes to be selected as this is a very common use case for me.
As I often do when trying to retrieve data the same way you are here, I would ditch the Data: Time Series Nodes in favor of a Losant API Node that calls the Data: Time Series Query action. That will allow you to return data for multiple attributes across one or more devices, while also allowing for choosing custom duration, resolution, and aggregation method.
that is far easier for sure.
In the documentation, it doesn’t specify duration and resolution, are they seconds?
In the example the end parameter is set to 0 but that says should be a date time object?
Duration and resolution are in milliseconds.
end is a bit odd; it accepts milliseconds, but depending on the value you pass, it has different meanings:
0 or no value passed means an end time of “now”.
- A positive number is treated as a Unix timestamp in milliseconds.
- A negative number, without a
start value passed, is treated as an end time of now and a
start time of (now minus the
end value in milliseconds).