I like the new feature “expressions in time series graph”.
Would really like to see it as an option in the device attribute definition though, because if I do any kind of other reporting on the raw time series data, I would need to scale it somewhere.
Hi @Lars_Andersson,
I will create a Feature Request for this functionality, and update you should it be implemented in the future!
Thanks,
Julia
As an additional request, it would be nice to be able to apply math to multiple time series data points.
Let’s say Voltage and Current are measured, but I want to graph Voltage ,Current but also a calculated value of Power in the same graph.
I like that request - where an time series block expression can reference values returned in other segments - but it will take some time to deliver that. There are a lot of gotcha’s there around, for example, knowing which point in a series to reference (by ID? by index? by same timestamp?)
There is an alternative, one we have suggested multiple times to other users over the years, and that is to use a workflow to calculate Power and apply it as a new attribute at the same timestamp that Voltage and Current were reported.
Attached is an application export bundle that illustrates this. It has:
- A device with number attributes
Current
,Voltage
, andPower
- A workflow that fires whenever the device reports state for the
Current
orVoltage
attributes
That workflow multiplies the two state values and records Power
back on device state at the same timestamp.
export-6054de9d020e5a0007aaddf5-1616175871340-currentVoltagePower.zip (2.4 KB)
To test it:
- Import this bundle into any of your applications.
- Visit the detail page of the device included. (It’s called “Device”.)
- In the top right corner, open the “Device Actions” dropdown and select “Force State”.
- Select “Current” in the first row’s first input and enter a number in the second input.
- Select “Voltage” in the next row that appears, and enter a number alongside it.
- Click “Force Report State”.
In the device live log, you will see two entries: One for the force report you just made, and another for the workflow calculating Power. If you refresh your browser and check the device’s recent state logs in the right panel, you’ll see Power reported at the same time as the other attributes.
yeah, that’s how I’m currently doing it.
To answer your question above “which point in a series to reference”, would be the timestamp for me.