Exposed humidity sensor not showing in homekit

I have a nodemcu that’s includes temperature and humidity which appear great in HA. I’ve exposed these to homekit so they can appear on the home app. The temperature sensor appears great but the humidity sensor does not appear even though they are both exposed as sensors.

Has anyone else come across this issue?

Ok I fixed it, made the device class of the sensor humidity and now after a reboot it shows. Strange that temperature didn’t need this.

Leaving here to help someone else.

1 Like

The reason is the way we know which type of sensor it is.
For temperature this is pretty simple with either °C or °F.

However humidity with % not so much (just think of battery percentage or anything else). It would be strange if those where also added as humidity sensors. That’s why the device_class parameter is needed. Some sensor do set these themselves, other don’t. In any case you can override it in the customize section. That way it would even be possible to add any other sensor as humidity sensor, although that might not make that much sense after all.

Hope that explanation helps.

1 Like