openhab-docs icon indicating copy to clipboard operation
openhab-docs copied to clipboard

Persistence: Wrong example in docs

Open ThomDietrich opened this issue 7 years ago • 8 comments

@bgilmer77, you've recently updated this article: http://docs.openhab.org/configuration/persistence.html#items

According to it I just wanted to define a minimal config of this format:

Strategies {
    default = everyUpdate, restoreOnStartup
}

Items {
    Whg_Heating_Mode
}

The latter doesn't seem to evaluate and yields:

Configuration model 'mapdb.persist' has errors, therefore ignoring it: [6,5]: no viable alternative at input 'Whg_Heating_Mode'

Wdyt?

ThomDietrich avatar Nov 26 '17 12:11 ThomDietrich

@ThomDietrich would you like me to see if I get the same results on my dev machine?

bgilmer77 avatar Nov 27 '17 08:11 bgilmer77

Plus correcting the article, yes :)

ThomDietrich avatar Nov 27 '17 12:11 ThomDietrich

@Confectrician , I checked but this example is not there anymore and / or already fixed. This issue can be closed.

JensTec avatar May 05 '19 18:05 JensTec

Thanks for the catch.

Confectrician avatar May 05 '19 18:05 Confectrician

This is still not working.

Search for the minimal configuration using "GF_Hall_Light" in the link above and you'll get something like "Configuration model 'mapdb.persist' has errors, therefore ignoring it: [6,5]: no viable alternative at input 'Whg_Heating_Mode'"

bubuche79 avatar Nov 19 '19 21:11 bubuche79

Please be aware that docs.openhab.org may be an old link. https://www.openhab.org/docs/configuration/persistence.html is the link we are redirected to.

Could you please post your whole .persist file (as the error emerges for another Input)?

udo1toni avatar Nov 21 '19 21:11 udo1toni

Here is the link: https://www.openhab.org/docs/configuration/persistence.html#items

Here is the content of my jdbc.persist file:

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

Items {
        Total_Energy
}

Here is the error:

2019-11-23 21:06:22.095 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'jdbc.persist' has errors, therefore ignoring it: [7,2]: no viable alternative at input 'Heating_Energy'

While this content works fine:

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

Items {
        Total_Energy : strategy = everyChange
}

bubuche79 avatar Nov 23 '19 20:11 bubuche79

Just ran into the same problem. Strategy needs to be explicitly declared for each item.

Graefer avatar Jun 07 '20 18:06 Graefer