Thanks for your quick answer, but I’m still getting problems reading out and do some calculation.
I tried with the code from your reply, but I get some errors. Searching the internet I found some working but the Item values are many times the same, and timing also. I want the timing in milliseconds.
This code is in a rule when Itemvalue changed, so when there is an update with same value, this code is not executed. Regarding to the previousState(false) or previousState(true) question.
I found out that when this request is at the beginning in a rule when a value changed and is logged with influxdb, sometimes the reading is wrong and last and previous value is the same. Probably a timing issue, reading too quickly while database is still getting updated. When I request it two times the second one is always correct and the first more not. Can I add a little wait or delay in the rule, or just request two times the same and use the second one?
anyone know how to read influxdb item info like daily average or 1 to 2 hours ago? as I would like the rule to perform as if current value higher than daily average like 5-10%, than don’t execute or execute command.