Design Pattern Persistance Language Problem

Its about this Tutorial

Im quite good in english but im struggeling with this one. I dont get the reason why to do this, or for what is this for?
Collect Data to show them in a Diagram?

My Motherlanguage is German (Switzerland) if the Forum Rules dont disalow it, a small explanation in german would be welcome!

Thank you

It’s quite easy.

Instead of choosing the persistence strategy per item, and having to think about items while configuring persistence, you just create a strategy for the group.

When you define the items you just need to select the strategy via the group.

Collecting data for a diagram is one thing, another one is restoring value at startup. You also can compare persisted values to the current value. If you do not set up a persistence, only the current value for each item is existing in openHAB.

If you need a german explanation, just send me a pm.

Reasons for doing persistence:

  • restoreOnStartup: When OH restarts the configured Items get initialized to the state stored in the database rather than NULL

  • historic data: You may decide to do different things in a Rule based on the state of an Item sometime in the past, or based on the average or sum of the states of an Item since a certain time in the past

  • charting: Visually represent the state of an Item over time in a graph or other type of chart

Why use Groups:

You have two options.

  1. List each and every Item in the .persist file. When you add a new Item you need to make sure you go and edit the .persist file so it gets saved to the database as needed.

  2. Use the DP above and to make sure an Item gets saved to the database you just need to add it to the appropriate Group and you don’t have to remember to go add the Item to the .persist file.