I am currently working through my UOMs to get them working with OH4.
While I have no issue with relative humidity in % (add unit=“%” in item description), I could not figure out, how to display UOMs that are not pre-defined in OpenHAB like absolute humidity in g/m³.
No, it’s not possible to define custom UoM. It’s more than just a collection of characters after a number. OH can automatically convert between compatible units and combine units in ways that make sense. That requires code.
You can submit a PR with the code necessary to support a new unit for sure (that’s how absolute humidity got added not that long ago). And if your new unit is a combination of already existing units and modifiers you can combine those (e.g. l/h is a combination of liters and hours).