Skip to content

Support Soil Sensor device type#2757

Open
nickolas-deboom wants to merge 2 commits intomainfrom
feature/matter-soil-sensor
Open

Support Soil Sensor device type#2757
nickolas-deboom wants to merge 2 commits intomainfrom
feature/matter-soil-sensor

Conversation

@nickolas-deboom
Copy link
Contributor

@nickolas-deboom nickolas-deboom commented Feb 5, 2026

This adds support for the Soil Sensor device type, introduced with Matter 1.5.

@github-actions
Copy link

github-actions bot commented Feb 5, 2026

Test Results

   71 files    485 suites   0s ⏱️
2 511 tests 2 511 ✅ 0 💤 0 ❌
4 322 runs  4 322 ✅ 0 💤 0 ❌

Results for commit d3ae5af.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Feb 5, 2026

File Coverage
All files 84%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-sensor/src/sensor_utils/device_configuration.lua 86%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-sensor/src/sensor_utils/embedded_cluster_utils.lua 45%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-sensor/src/sub_drivers/bosch_button_contact/init.lua 83%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-sensor/src/sub_drivers/smoke_co_alarm/init.lua 82%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-sensor/src/sub_drivers/air_quality_sensor/air_quality_sensor_utils/fields.lua 92%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-sensor/src/sub_drivers/air_quality_sensor/air_quality_sensor_utils/legacy_device_configuration.lua 97%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-sensor/src/sub_drivers/air_quality_sensor/air_quality_sensor_utils/utils.lua 68%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-sensor/src/sub_drivers/air_quality_sensor/air_quality_sensor_utils/device_configuration.lua 81%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-sensor/src/init.lua 92%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-sensor/src/lazy_load_subdriver.lua 57%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-sensor/src/embedded_clusters/SoilMeasurement/server/attributes/SoilMoistureMeasuredValue.lua 54%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-sensor/src/sub_drivers/air_quality_sensor/air_quality_sensor_handlers/attribute_handlers.lua 78%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-sensor/src/embedded_clusters/SoilMeasurement/init.lua 79%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-sensor/src/sub_drivers/air_quality_sensor/init.lua 82%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-sensor/src/sensor_handlers/attribute_handlers.lua 87%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against d3ae5af

@nickolas-deboom nickolas-deboom force-pushed the feature/matter-soil-sensor branch from 5abb504 to eb50abd Compare February 5, 2026 15:26
@github-actions
Copy link

github-actions bot commented Feb 5, 2026

@@ -0,0 +1,67 @@
local cluster_base = require "st.matter.cluster_base"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this one, unless you're planning on adding a handler for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I'll remove it

if #battery_feature_eps > 0 then
device:send(clusters.PowerSource.attributes.AttributeList:read())
else
device_cfg.match_profile(driver, device, fields.battery_support.NO_BATTERY)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to add some kind of handling to the match_profile function so that it can support battery? Along with a couple unit tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should already be supported, no?

Copy link
Contributor

@hcarter-775 hcarter-775 Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how would it be?

edit: nevermind, I forgot how the Matter Sensor match profile logic works.

@nickolas-deboom nickolas-deboom force-pushed the feature/matter-soil-sensor branch from 2761208 to a7fcbb4 Compare February 5, 2026 16:50
@nickolas-deboom nickolas-deboom force-pushed the feature/matter-soil-sensor branch from a7fcbb4 to 09c0f55 Compare February 5, 2026 16:50
clusters.RadonConcentrationMeasurement.attributes.MeasuredValue,
clusters.RadonConcentrationMeasurement.attributes.MeasurementUnit,
},
[capabilities.relativeHumidityMeasurement.ID] = {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a duplicate entry

-- remove leading "-"
profile_name = string.sub(profile_name, 2)

device.log.info_with({hub_logs=true}, string.format("Updating device profile to %s.", profile_name))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this log because I realized this is now logged by the lua libs

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