InfluxDb: Openhab2 does not store everyHour, but everyChange

Hi,

I’ve got an issue with the influx persistence on openhab2.
I followed this very good tutorial InfluxDB+Grafana persistence and graphing and
as long as I get constantly different values from the sensor it works like a charm, but when a value is constant over a longer period of time openhab does not save the value every hour as defined.

Strategies
{
	everyHour : "0 0 * * * ?"
}

Items 
{
	NUM_TEMP_Room,NUM_CISTERN_FILL_Percent,NUM_CISTERN_FLOW : strategy = everyChange, everyHour
}

I also checked the logfile but could not find a related error.
Does anybody have an idea what I could have done wrong?

From other persistence problem posts I know that sometimes creating a default solves a lot of problems, maybe worth a try:

default = everyHour

Hi @sihui,

thanks for your fast reply. I’ll give it a try and see if it helps.

Hey @fog,
not sure of the cause of your problem but your question motivated me to update the example configuration in the InfluxDB tutorial :thumbsup:

@sihui a default is not needed, at least I don’t have one. See https://github.com/openhab/openhab-distro/blob/master/features/distro-resources/src/main/resources/persistence/rrd4j.persist

1 Like

Persistence files seem to be pretty strict regarding their style. May sound silly but could you please try moving the braces back at their original positions?

Did you check openhab.log for influxdb related log lines?

Hi @ThomDietrich,

thank you for the response. I really appreciated you tutorial and it helped a lot.
Here is my latest config, I’ll get back to you tomorrow with the results.
Fingers crossed.

Strategies {
    everyHour : "0 0 * * * ?"
	default = everyHour
}

Items 
{
	NUM_TEMP_Room,NUM_CISTERN_FILL_Percent,NUM_CISTERN_FLOW : strategy = everyChange, everyHour
}

If in doubt, use this one, then add your items.

Besides I think your file looks okay. I’d expect the error in the connection or something related. Check the openhab.log and try the sine wave example from the tutorial.

Hi @ThomDietrich,

as I said it works in general, only the save everyHour strategy was not working. So I don’t think that the issue is related to influx or grafana.

Ah right, sorry. you mentioned it clearly above. Has been a long day :wink:

Just rebooted openhab and checked the log for problems. Seems to be okay.
So lets see.

Hi @ThomDietrich and @sihui,

again thanks for your help, the latest config file works fine now.
What is interesting though is the fact that openhab seems to be only strict on the strategies syntax part of the config.

PS: How to flag the topic as solved?

1 Like

Left most checkbox …

1 Like

@Kai any chance someone could look into this? At least a parsing error should be logged in case of syntax problems

What exactly was the problem? Position of the brackets?
Should be possible to address, best file an issue at github.com/eclipse/smarthome/issues as a first step!

I’ll remove the default statement when I’m home to check if this makes a difference.
If it then still works I suspect that the position of the opening bracket in the strategies part was the root cause of the effect.
I’ll keep you posted.

Hello @fog,
turns out all we discussed was not actually of concern. Anyhow it’s great your setup is working now.

See: https://github.com/eclipse/smarthome/issues/3567

For you or whoever is experiencing similar issues: Always check the openhab.log for possible errors.