Limit on line length in openhab.cfg

Are there limits on the line length in openhab.cfg, if so how do I continue values onto the next line. Need to know this since I have many items that I would like to specify on and hate having to replicate the same definition for xxx if nothing changes except items.

There are none documented anywhere I’ve seen.

But if all you are worried about is defining persistence have you considered using Groups? In your persist file you can then just say

MyGroup*: strategy = everyChange, restoreOnStartup

This will cause all members of the Group MyGroup to be saved using that strategy. I find this approach to be much more flexible and easier to maintain than listing each and every Item individually as to move an Item or add an Item to a different strategy all I need to do is add that Item to the right Group.

@rlkoshak, Thanks Rich for your feedback, but I am not concerned about the definition in the *.persistence file, I am concerned about the definitions for rrd4j in the openhab.cfg file like this, which is (one of) my definition for dealing with percentages:


This is just the start of my percentage items I want to fit in this regime, I don’t want to duplicate the definition of pct5min just because there is a limitation on line length of the last part of the definition of the items it applies to.

As an old ‘fart’ in ICT (some 40 years) I am a strong believer of ‘if it ain’t documented it isn’t supported’ hence the reason for my question to get it documented. :slight_smile:

If its written in Java (which OH is) the maximum String size is (2^31 - 1) characters or half of your max heap size. So keep your openhab.cfg under 500 mg (assuming you have at least 4G of RAM or 1/8 of your total RAM if less) and you will be fine.

The big question is whether you can avoid having to put it all on the same line. I think the answer to that might be no but would have to look in the code to know for sure.