JS Scripting: previousState

There is scope for that to have left you some debris

I don’t think the linked issue can throw a ConnectException.
To identify the problem will be very useful to set influxdb addon log level to TRACE and provide a full log

The problem is that the query takes almost 15s to complete. After the timeout (5s) the query fires again, until influxDB is crashing because a Out Of Memory. The Sensor is changing every 5 seconds, and the query is reading all the data from the last 100 years…
See github: [InfluxDB] Crashing influxDB 2.1 with a simpel rule: previousState · Issue #11878 · openhab/openhab-addons (github.com)

Hello,
I think I have understood the difference between persistence method previousState() and the previousState elemnt in case of a state change event (using DSL type rulse).

I’m actually looking for the Javascript ECMA 21 equivalent of previousState element.

so just to be clear, by way of example. In the log of the event it produces the following:

2022-10-03 16:08:21.254 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'SolarEdge_Production_Day' changed from 7.539 kWh to 7.619 kWh

I would like to retrieve the 7.539 kWh value (the ‘from’).

Many thanks.

All such answers are well documented in the docs.

Thanks.