openHab 4.3 - Item name starting with _ underscore

  • Platform
    • Hardware: Raspberry 4
    • openHAB version: 4.3

I had been following an item naming convention which had been suggested earlier on around the forums:

Location_Equipment_PointOrProperty
Bathroom_MainLamp_Switch
Bedroom_AC_Power

for Items within the model and

_Group_Item
_Lighting_Switch
_HVAC_Power
_Automation

for items outside of the model, the absence of a Location at the beginning, indicating that. These item names would hence start with an _ (underscore).

After upgrading to oH 4.3, that latter naming doesn’t seem to permissible anymore:

While it says,

Required. Must not start with a number. A-Z,a-z,0-9,_ only

and as far as I know, underscore isn’t a number, openHab, will not accept item names manually created in MainUI and starting with _ (anymore).

I have previously “bulk” created my Items, by copying and pasting “textual item definitions” in the
Developer Section of MainUI (which is a huge time saver, if you have many repetitive Items). This still seems to work and I can add Items starting with _ that way. However, when I edit that item in MainUI, it won’t let me save the changes anymore.

Is that a change of Item naming rules or a a bug?

1 Like

What was your previous version?

I believe you are right and _ at start of an item name is valid. To be confirmed.

What was your previous version?

4.2

I can confirm, I just tested:

@florian-h05 : did you add a bigger restriction to item name in 4.3 ?

1 Like

Thank you @jimtng I would like to have confirmation that it was changed in 4.3.

It broke in this item-mixin: Improve Item name validation RegEx by florian-h05 · Pull Request #2658 · openhab/openhab-webui · GitHub

Fix is merged and will be also part of next 4.3.2 version.

1 Like