Group persistence not working (?)

Hi, updated OH2 to latest snapshot yesterday.

I’m trying to have a group to persist values at startup, sadly it’s not working (nothing gets persisted, no line in logs even with “log:set TRACE org.openhab.persistence.mapdb” in karaf console).

my mapdb.persist :
Strategies {
everyMinute : "0 * * * * ?"
everyHour : "0 0 * * * ?"
everyDay : "0 0 0 * * ?"
default = everyChange
Items {
gMyOpenHABeveryChange* : strategy = everyChange, restoreOnStartup

and my item definition :
Switch testSwitch “testSwitch [%s]” (gMyOpenHABeveryChange)

==> as I wrote, it gets NOT persisted. But if in the persistence config I set a specific item to persist this test item ( “testSwitch : strategy = everyChange, restoreOnStartup”) … this one gets logged.

Am I doing something wrong ? is the “group*” persist broken ?

If you don’t get any other response, file an Issue in github. It should work and I can confirm it was working at least with InfluxDB. My OH is broken right now so can’t test.

If I remember correctly, MapDB never did log anything out when it persisted an Item.

I have the exact same problem at the moment.

Did you find any solution?


Sorry, no. That was not my top priority at the moment then I forgot it … :confused:

Using latest OH of Dec’17 and JDBC (mysql), Items do not systematically get persistence. I think that it boils down to the persistence strategy (everyUpdate vs everyChange - see and to the autoupdate flag, which introduces another issue. See below.

For example:
items file:

Group gPersist
Number Temperature_Cave_Bureau		"Bureau [%.1f °C]"		<temperature>	(gPersist)	{ knx="<1/3/50" }
Number Temperature_Cave_Hall		"Hall [%.1f °C]"		<temperature>	(gPersist)	{ knx="<1/3/70" }
Number Weather_Temperature 				"Température extérieure [%.1f °C]"	<temperature> (gPersist)  { knx="<1/7/101" }
Number Weather_Brightness 					"Clarté [%.1f Lux]"		<sun_clouds>  (gPersist)  { knx="<14/5/0" }

Number electricityTotalActivePower "Active Power [%.1f WH]" (gElectricityData,gPersist) {autoupdate="false", knx="<13.010:8/6/10"}

/* Number electricityTotalReactivePower "Reactive Power [%.1f VA]" (gElectricityData,gPersist) {autoupdate="false", knx="<13:010:8/6/11"} */

Number electricityTotalInstantPower "Instant Total Power [%.1f kWH]" (gElectricityData,gPersist) {autoupdate="false", knx="<8/6/0"}

Number electricityPhase1InstantPower "Instant Power L1 [%.1f kWH]" (gElectricityData,gPersist) {autoupdate="false", knx="<8/6/1"}

Number electricityPhase2InstantPower "Instant Power L2 [%.1f kWH]" (gElectricityData,gPersist) {autoupdate="false", knx="<8/6/2"}

Number electricityPhase3InstantPower "Instant Power L3 [%.1f kWH]" (gElectricityData,gPersist) {autoupdate="false", knx="<8/6/3"}

Number fuelLevel "Fuel level [%.3f m]" (gFuelData,gPersist) {knx="<14.001:8/6/60"}

Fresh restart after erasing tables in MySQL server.

I changed the strategy to everyUpdate, and it logs all items in gPersist but the electricity* items.

A careful analysis shows that there are the only ones with autoupdate=false. When changing to autoupdate=true, the item gets persistence.

So it solves the matter for persistence, but it creates an issue with the KNX binding echoing commands once too much to the KNX bus (see thread KNX binding repeats commands).

So I have to choose between both.

any hints on how to solve this differently?

thank you