When making a few changes on the system, say to the my dht items file or my bluemaestro file my average temperature item group seems to switch back to NULL a state.
Nothing I’ve found will sort it out, even though the individual group members receive updates.
Is this a bug, or by design? I think normally a restart of the system will sort it, but that seem to be like using a nuclear bomb to kill a fly.
Any time you touch an item definition, openHAB resets ALL items to NULL. There is a reasonable reason from memory but I can’t recall exactly what that is. As a result I only change rules and sitemaps on-the-fly. Any item changes are only done once openHAB is offline.
I’m pretty free and easy with making modifications. Is fun at night time when one of my lighting rules triggers.
The only problem child seems to be this temperature group.
Please post your Group definition.
Are you using persistence with restoreOnStartup with the Group or the Group’s members?
Here’s the parent and child group (not suyre if need both). It’s the average one that does it.
Group:Number g_temperature "Temperatures" <temperature>
Group:Number:AVG g_temperature_average "Average Temperature [%.2f °C]" <temperature> (g_temperature)
This is one of the items.:
Number br_master_temperature "Master Bedroom Temperature [%.1f °C]" <bedroom> (g_masterbedroom, g_masterbedroom_temperature, g_temperature , g_temperature_average) ["CurrentTemperature"]
A hangover before I found out that groups can be nested. Again, unsure on impact.
And the influxdb persist file:
g_temperature* : strategy = everyChange, restoreOnStartup g_temperature_average : strategy = every15Mins, restoreOnStartup
I also have mapdb persist, but these items aren’t in there (but I could if it would help).
I’m on OH2.0 as the 2.1 broke this group definition persistence
It still works just fine for me. What broke?
I see nothing totally wrong about anything but I wonder if something is going wrong with the fact that you are persisting and restoring the Group’s state since the Group is a member of g_temperature.
But if there is a bug involved here, you will have to try it out on 2.2 SNAPSHOT to see if the behavior persists before filing an issue. A lot of fixes have been applied to Groups since 2.0 and this might be fixed.
Dunno, a change I made last night to add an icon to one of the items, and now the group is reporting the NULL state and has never recovered.
Was curious as to why that happens.
Regarding the persistence, aren’t I persisting two different things though?
Ie all items individually (with the g_temperature*) and the explicit average with g_temperature_average). Unsure how that works if the average is a sub group of the parent.
Indeed you are saving all the Items individually using g_temperature* but g_temperature_average is also a member of g_temperature and it has a state. I don’t know if, back in the 2.0 time frame how that works. I know right now in 2.2 SNAPSHOT it works as you would expect. The Items get persisted using g_temperature but you have to list the Groups you want to persist their states individually, as you have done.
But the interactions between the two Groups could be causing issues.
But my question was what broke with the Group definition persistence in 2.1 for you as all the changes I know of that changed anything like this occurred after 2.1 I believe.
Not exactly sure, I think similar to this, in that the state was always null. Even after a restart.
Thread here: Hue Group item problems after update to OH2.1
That Issue was addressed and closed. The end result is that your Groups need to have a Type or else the Group will no longer generate update events. Your groups here all have a Type so that problem doesn’t apply.
Yeah that’s my point.
I moved from 2.0 to 2.1 and even with a type it broke persistence. And I wasn’t willing to push my system to the 2.2 snapshot version until stable.
My point is though that I use almost exclusively group based persistence exactly like you are, I moved from 2.0 to 2.1 and am running 2.2 SNAPSHOT and my persistence never broke. It has always worked.
So either there is something different going on that is not apparent or the reason it broke for you is unrelated to Groups.
Hmm perhaps something else is going on, but the only way I could get my persistence to work again last weekend was rolling back to 2.0.
Hmm possibly related question. I know for persisting the AVG group it needs a type (as mine does). What about the parent g_temperature does that need one to persist all the individual member items?
It does not need the type for persistence but yours has a a type so there should be no problem. None of my persistence groups have a type.