HABApp 23.09.x - ".... is a UoM item but "unit" is not found in item metadata"

Starting with the release 23.09 I am seeing warnings in the log file like this:

[2023-10-05 15:01:32,430] [     HABApp.openhab.items]  WARNING | Item NetatmoInnenmodulHeatIndex is a UoM item but "unit" is not found in item metadata

My item definition is like this:

Number:Temperature     NetatmoInnenmodulHeatIndex                  "Gef. temperatur (hitzeindex)"   (gPersist)  {channel="netatmo:weather-station:85caac2b72:70ee5064fc74:HeatIndex"}

There are a lot of other entries in the log file at the start of HabApp.

These entries I definitely did not see in version 1.1.2

What is the meaning of these warnings?

It’s been there longer but you probably noticed it only now.
For a fix see this short description, for the reason see the long UoM change thread for OH4.

1 Like

With over 35000 items I am too lazy to add unit everywhere afterwards. I have simply removed the log message.

Search for the following 'is a UoM item but "unit" is not found in item metadata:

sudo grep -r 'is a UoM item but "unit" is not found in item metadata' /opt/habapp/lib/python3.10/site-packages/HABApp
/opt/habapp/lib/python3.10/site-packages/HABApp/openhab/map_items.py:                log.warning(f'Item {name:s} is a UoM item but "unit" is not found in item metadata')
grep: /opt/habapp/lib/python3.10/site-packages/HABApp/openhab/__pycache__/map_items.cpython-310.pyc: binary file matches

This tells me that I need to edit the /opt/habapp/lib/python3.10/site-packages/HABApp/openhab/map_items.py file:

...
            # Show warning
            # https://github.com/spacemanspiff2007/HABApp/issues/383
            if 'unit' not in meta:
                pass
                #log.warning(f'Item {name:s} is a UoM item but "unit" is not found in item metadata')
...

This may not necessarily be the most desirable solution, but if you know exactly what you are doing, you can live with this solution quite well.