There is a device class for humidity sensors called “humidity”. However, at the moment the only unit of measurement that’s linked to this device class is “%” (percentage). In percentage the humidity always refers to relative humidity.
I think it would be good to also support units of measurement for absolute humidity, usually g / m^3. It seems to me that would be possible with the current device class and no seperate device classed have to be created for relative and absolute humidity.
Relative humidity is the part of the air that’s filled with water divided by the most possible amount of water at that temperature. So the amount of saturation.
Next to relative humidity, air humidity can also be expressed in absolute humidity, which is just the amount of water in weight per volume, usually g / m^3.
If you know the temperature and one of the types of humidity it’s possible to calculate the absolute or relative humidity.
Currently the only supported unit of measurement is %, see below screenshot from the documentation
from: Sensor - Home Assistant
Currently there is also a mdi icon linked to humidity that has a percentage sign: mdi:water-percent. This won’t apply to absolute humidity, so that has to have a different sign, for instance just mdi:water