Custom javascript map and filter functions for time series nodes

Hi, your recent changes to the time series node reduce a lot custom efforts :slight_smile: I think that having also the option of custom mapping or filter functions directly in the node config and automatically applied to the result set before returning it could additionally reduce slow (boilerplate) code.

Are you suggesting something kind of like we do in the Time Series Graph dashboard block, where we allow for applying an expression to each point prior to displaying it on the graph?

Yes - expressions as in the Time Series Graph would be a convenient solution for simple conversions.

Understood. I’ll file a feature request.

An easy-ish workaround you could use in the meantime is to follow up your Time Series Node with a Mutate Node, setting a new value, with the “Treat as JSON” box checked.

You could then write the body something like the following (untested) …

[
{{#each myTimeSeriesPoints}}
{
  "mutatedValue": {{evalExpression 'sin({{this)}}' value}},
  "time": {{jsonEncode time}}
  {{#unless @last}},{{/unless}}
}
]