Integrating a Plant Moisture Sensor with HomeKit

Hi everyone, I’m trying to integrate my plant moisture sensor into HomeKit, but I’m running into a bit of trouble. I’ve set up the sensor using Home Assistant, and it works perfectly there. However, when I try to add it to HomeKit via the bridge, it doesn’t show up. I’ve discovered that the issue lies in the device class attribute of the sensor entity. It’s currently set to ‘moisture’, but HomeKit doesn’t recognize this. I need to change it to ‘humidity’ instead.

I know that changing this directly isn’t possible, so I’m looking into using a template sensor to rename the attribute. I’ve found some guides online about creating custom templates, but I’m not entirely sure how to configure the state template correctly. I’ve tried a few different approaches, but nothing seems to work.

Has anyone else encountered this issue? I’d really appreciate any advice or tips on how to get this working. I’m excited to have my plant’s moisture levels integrated into HomeKit, but I’m a bit stuck at this point. Thanks in advance for your help! :blush: