2022-12-09 17:41:56.916 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID '24aa95c501' failed: TypeError: itemRegistry.getItem("itmUHT230Total").previousState is not a function in <eval> at line number 3
Why? I also tried previousState(true) and historicState() nothing is available.
What do I miss there?
2022-12-10 11:05:39.305 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID '24aa95c501' failed: Could not cast 10/12/2022, 11:05: itmUHT230Total -> 55451.0 to java.lang.Number; line 2, column 14, length 38
This is my Item:
Tried different things, read that Chapter: Rules-DSL, it should work, but it does not…
For the benefit of other readers, it is not usual to have an “every second” persistence strategy, so the results from this query probably will not be what first appears like.
There is hardly ever a persistence record at exactly the queried instant in time, so the persistence service deals with that by going back in time to the next-youngest record.
In the example above, that is likely from one, two, five minutes ago, etc., depending on the persistence strategy, possibly days.
You can find out by examining the timestamp that is part of the results returned.