Skip to content

Conversation

@FlorianBruckner
Copy link

This is for sure a controversial PR as it can break things for existing users:

A popular homeassistant integration requires soil moisture sensors to report with a SensorDeviceClass.MOISTURE. This appears to be the case for BLE sensors in the field.

Zigbee Soil Moisture sensors are reporting SensorDeviceClass.HUMIDITY instead. This device class is for reporting "relative humidity". Both are reporting as %, but SensorDeviceClass.MOISTURE appears to be a better fit.

I propose to change the sensor class for SoilMoisture to be SensorDeviceClass.MOISTURE to align popular BLE soil moisture sensors with the ones using Zigbee.

@TheJulianJES TheJulianJES changed the title switch soil moisture class to SensorDeviceClass.MOISTURE Switch soil moisture sensors to SensorDeviceClass.MOISTURE Dec 20, 2025
@TheJulianJES
Copy link
Contributor

Thanks for the PR! The test failures are expected, as entities for existing devices change. We can re-generate the device diagnostics later.

I do wonder if this would cause any issues in Home Assistant. IMO, this change seems perfectly correct, but we'll probably have to label it as a breaking change.

@FlorianBruckner
Copy link
Author

thanks for looking into the PR.

Potentially, it could cause issues, thats why i mentioned "controversial" in my PR. I have no idea how many moisture sensors with Zigbee are actually used in the field - usually you see BLE devices mentioned. For the ootb https://www.home-assistant.io/integrations/plant/ I don't see how changing the SensorDeviceClass would make a difference - here, entities are configured in configuration, I would expect this to take any value reporting as %.

The extension I tried is https://github.com/Olen/homeassistant-plant. This has a UI for setting up a plant and will offer only entites of SensorDeviceClass.MOISTURE to be selected. It even explains this issue in the README. It will, however, accept the HUMIDITY type when assigned manually later on.

Maybe the maintainer of this integration would be able to share his thoughts on potential impacts of this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants