How about Persistence configuration in GUI

Tags: #<Tag:0x00007f173c4d4dd8> #<Tag:0x00007f173c4d4ce8>

Hi @allen

What do you think about let users configurate the Persistence over hte GUI?

Functionally ideas:

  • Global Params like Server, Port, Username, Password (File *.persitst)
  • Strategies, Items (File *.cfg)

Next I’d prefere if there is a clean up job for each Item, set in the strategy, which would be handled by Openhab. This job shall delete data older than…

Strategies {
  <strategyName1> : "cronexpression1"
  <strategyName2> : "cronexpression2"
  ...
  default = everyChange
  ...
}

Items {
  <itemlist1> [-> "<alias2>"] : [strategy = <strategy1>, <strategy2>, ...] : [cleanup = <strategy1><strategy2>]
}

The cleanup strategy is calculated like it’s older than “cronexpression”

I’d also let user save an whole Thing when a Item strategy throws event. Perhaps written in the *.cfg File like:

Things {
	<thinglist1> [-> "<alias1>"] {
        Items {
                <itemlist1> [-> "<alias2>"] : [strategy = <strategy1>, <strategy2>, ...]
        }
    }
}

Why thinglist? Because I’d like to save the state of an Thing when another Item fires.

Let me now what do you think. :slight_smile:

That won’t happen. By design ,persistence service deals with abstract Items. If you are interested in some Thing properties under some circumstance, get them into an Item using a rule.

1 Like

Ok that I understand. What about the other functionalities?

Well, I’m not very convinced about “clean up”. What is required/possible is highly database type dependent. Remember persistence services are an abstract layer, isolating from database so far as possible.
Maybe that’s better considered as a utility for each different persistence add-on.

UI editing for xx.cfg and xxx.persist would be nice, have been nice since OH3 was first considered, and await volunteers to implement.

1 Like

Ok, I’d implement it for MongoDB, but I think there must be some rules which goes for every persistence service.