My migration journey from 4.x to 5.0

Hi Forum,

in the past I used text file based item definitions in *.items. After switching to openHAB 5.0, I will have to make changes to the text files. They now get flagged with warnings by the new model check in 5.0.

This will be a journey and I will add more findings on how I solved them in my installation. Lets start with the basics.

Group membership

In the past, there was no semantic check. And for me, persistence groups where kind of equipments, well, to store items.

Now that there is a semantic check in place, I got flagged for a lot of items that used the wrongly tagged persistence group.

Here is an example of my old definition of an item assigned to a tagged persistence group like that:

Number:Temperature gBathRoom_eqHeating_itTemperature "Temperatur [%.1f %unit%]" <oh:temperature> (gFunctions_eqPersistence_everyMinute, gBathRoom_eqHeating) [ Measurement, Temperature ] {
    channel="knx:device:bridge:321a4393:48",
    alexa="CurrentTemperature" [
        name="Temperatur Badezimmer"
    ]
}

...

Group gFunctions_eqPersistence "Persistenz" (gFunctions) [ Equipment ]
        Group gFunctions_eqPersistence_everyMinute (gFunctions_eqPersistence) [ Equipment ]

New version now references an untagged persistence group.

Number:Temperature gBathRoom_eqHeating_itTemperature "Temperatur [%.1f %unit%]" <oh:temperature> (gBathRoom_eqHeating) [ Measurement, Temperature ] {
    channel="knx:device:bridge:321a4393:48",
    alexa="CurrentTemperature" [
        name="Temperatur Badezimmer"
    ]
}

...

Group gFunctions_eqPersistence "Persistenz" (gFunctions)
        Group gFunctions_eqPersistence_everyMinute (gFunctions_eqPersistence)

So stay tuned for more content.

Faulty combinations of equipment, point and property tags

I was not really aware that the semantic model has a deeper meaning other than having just some tags. Now with the semantic rule checker in effect, I got schooled on what combinations of equipment, point and property are allowed and which are forbidden.

Nice to know, that you can get the current mismatches through the REST API, as @Mherwege pointed out in how to get all semantic model issues.

After fixing each reported issue, I’m now a proud owner of a clean semantic model :slight_smile:

Switch point?

Currently only one slight problem remains. Referring to the ui of predefined semantic model tags, and thanks for having such a useful tool, it should be possible to tag an item as a Switch point. See here:

image

But using it on an item like that:

Switch gOffice_eqLights_itDeckenleuchteLinks "Werkbank" <oh:light> (gOffice_eqLights) [ Switch ] {
    channel="knx:device:bridge:fd123e9d:O",
    alexa="Light" [
        name="Werkbank BĂĽro"
    ]
}

Leads to the following error:

2025-08-01 00:07:44.624 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'etw-fs-model.items'
2025-08-01 00:07:44.630 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'etw-fs-model.items' has errors, therefore ignoring it: [152,97]: no viable alternative at input 'Switch'
[152,104]: mismatched input ']' expecting RULE_ID

This has not changed. Still possible. You cannot add an item to more than one semantic group.

1 Like

That is still possible, as long as the persistence group has no semantic tag.

I have several items being member in multiple groups and only get two warnings, these are for items that are members of two location groups.

2 Likes

Still very nice you want to share your journey and contribute to the community!

What are the warnings you get and the definitions of the two Groups? The root cause may be that you were using a tag on the Perssistence Group that has since been added as a new semantic tag in OH 5.

And any advice you can provide to make the warning more clear that it’s only about semantic Groups would be welcome. I don’t want other users falling into the same trap.

That is still possible, as long as the persistence group has no semantic tag.

You are right as well as @rlkoshak, my persistence groups had semantic tags assigned.

Use [ “Switch” ] or [ ^Swirch ]

[ Switch ] will be allowed in the future, a PR is in progress.