Can someone please help me with a persistance strategy ?
I need to log every minutes from 06:00 in the morning to 21:00 in the evening outside that time frame nothing is logged.
Best Nanna
Can someone please help me with a persistance strategy ?
I need to log every minutes from 06:00 in the morning to 21:00 in the evening outside that time frame nothing is logged.
Best Nanna
Strategies {
everyHour : "0 0 * * * ?"
everyDay : "0 0 0 * * ?"
myStrategy : "0 * 6-21 ? * * *"
// if no strategy is specified for an Item entry below, the default list will be used
default = everyChange
}
You can use:
https://www.freeformatter.com/cron-expression-generator-quartz.html
To generate openHAB compatible cron expressions
Thanks - the free formatter is great
Watch out, this will trigger every minute from 6:00 until 21:59
Is there a way to persist the value of an item based on a condition - Eg. persist if the value is between 0 and 8 ?
Ok - it doesn’t have to be accurate in my case, at least not by the minute
Not that I am aware.
There is a workaround with the persist method
But myItem must not be in the persitence configuration!
rule "persist between values"
when
Item myItem changed
then
if (myItem.state > 0 && myItem.state < 8) myItem.persist
end
Thanks - I will give it a try
Oh I have two persist services rrd4j and influxdb how do I choose were to store ?
Lights.persist("rrd4j")
Would it look like this if I want to store in Influxdb ?
persist(“influxdb”)
Yep
But if you want to persist between 6:00 and 21:00 you will need to add this in the rule because you need to remove the item from the persist file for this to work
Great - I will try to get this to work.
Thanx for your time
Works Perfect
Please mark the solution post, thanks
Using such a explicit strategy (storing only between houses and if between values) does not work with rrd4j since this persistence needs a value each and every minute.
Well, in fact, it will work, but if drawing a chart for this data the chart will be empty
In my case I have an Solar inverter, when there is not sufficient sun the inverter generates “fake” values and therefore I want to filter out values out of the range og 0-8 Kw - it works perfect not
Well, I should have been more precise …
If drawing a chart with the builtin charting for Basic UI/Classic UI the chart will stay empty…
I am trying this out…
rule “persist IF”
when
Item Utility_Sump_Total received update
then
if (Utility_Sump_Total > 0) Utility_Sump_Total.persist("influxdb")
end
but I am getting the following error, any suggestions ?
2021-04-28 11:14:11.485 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘persist IF’: Unknown variable or command ‘>’; line 379, column 9, length 22