From e27f1c6035a95cd5995b942e3c6dcb7f93548f91 Mon Sep 17 00:00:00 2001 From: "Jan Jakubiszyn/SmartThings Integrations (BJ.jakubiszynS) /SRPOL/Engineer/Samsung Electronics" Date: Fri, 14 Nov 2025 16:56:08 +0100 Subject: [PATCH 1/2] Added support for Bosch matter motion sensor --- .../matter-switch/fingerprints.yml | 5 ++++ ...-level-motion-illuminance-battery-temp.yml | 29 +++++++++++++++++++ .../src/switch_utils/device_configuration.lua | 3 ++ .../matter-switch/src/switch_utils/fields.lua | 3 ++ 4 files changed, 40 insertions(+) create mode 100644 drivers/SmartThings/matter-switch/profiles/light-level-motion-illuminance-battery-temp.yml diff --git a/drivers/SmartThings/matter-switch/fingerprints.yml b/drivers/SmartThings/matter-switch/fingerprints.yml index c67eec7bf2..84c0733c62 100644 --- a/drivers/SmartThings/matter-switch/fingerprints.yml +++ b/drivers/SmartThings/matter-switch/fingerprints.yml @@ -137,6 +137,11 @@ matterManufacturer: vendorId: 0x1209 productId: 0x3016 deviceProfileName: plug-power-energy-powerConsumption + - id: 4617/12307 + deviceLabel: "Motion Detector II [+M]" + vendorId: 0x1209 + productId: 0x3013 + deviceProfileName: light-level-motion-illuminance-battery-temp #Chengdu - id: "5218/8197" deviceLabel: Magic Cube DS001 diff --git a/drivers/SmartThings/matter-switch/profiles/light-level-motion-illuminance-battery-temp.yml b/drivers/SmartThings/matter-switch/profiles/light-level-motion-illuminance-battery-temp.yml new file mode 100644 index 0000000000..ae116ed54d --- /dev/null +++ b/drivers/SmartThings/matter-switch/profiles/light-level-motion-illuminance-battery-temp.yml @@ -0,0 +1,29 @@ +name: light-level-motion-illuminance-battery-temp +components: + - id: main + capabilities: + - id: motionSensor + version: 1 + - id: temperatureMeasurement + version: 1 + - id: illuminanceMeasurement + version: 1 + - id: battery + version: 1 + - id: firmwareUpdate + version: 1 + - id: refresh + version: 1 + - id: switch + version: 1 + - id: switchLevel + version: 1 + config: + values: + - key: "level.value" + range: [1, 100] + categories: + - name: MotionSensor +preferences: + - preferenceId: tempOffset + explicit: true \ No newline at end of file diff --git a/drivers/SmartThings/matter-switch/src/switch_utils/device_configuration.lua b/drivers/SmartThings/matter-switch/src/switch_utils/device_configuration.lua index eebe734fcd..3bb2c355ea 100644 --- a/drivers/SmartThings/matter-switch/src/switch_utils/device_configuration.lua +++ b/drivers/SmartThings/matter-switch/src/switch_utils/device_configuration.lua @@ -193,6 +193,9 @@ function DeviceConfiguration.match_profile(driver, device) updated_profile = "light-color-level-fan" elseif generic_profile("light-level") and #device:get_endpoints(clusters.OccupancySensing.ID) > 0 then updated_profile = "light-level-motion" + if switch_utils.check_switch_category_vendor_overrides(device) then + updated_profile = fields.vendor_overrides[device.manufacturer_info.vendor_id][device.manufacturer_info.product_id].target_profile + end elseif generic_profile("light-level-colorTemperature") or generic_profile("light-color-level") then -- ignore attempts to dynamically profile light-level-colorTemperature and light-color-level devices for now, since -- these may lose fingerprinted Kelvin ranges when dynamically profiled. diff --git a/drivers/SmartThings/matter-switch/src/switch_utils/fields.lua b/drivers/SmartThings/matter-switch/src/switch_utils/fields.lua index 3a0bdc9fdb..3b6b8c9a61 100644 --- a/drivers/SmartThings/matter-switch/src/switch_utils/fields.lua +++ b/drivers/SmartThings/matter-switch/src/switch_utils/fields.lua @@ -117,6 +117,9 @@ SwitchFields.vendor_overrides = { [0x1006] = { ignore_combo_switch_button = true, target_profile = "light-level-power-energy-powerConsumption", ep_id = 1 }, -- 3 Buttons(Generic Switch), 1 Channels(Dimmable Light) [0x100A] = { ignore_combo_switch_button = true, target_profile = "light-level-power-energy-powerConsumption", ep_id = 1 }, -- 1 Buttons(Generic Switch), 1 Channels(Dimmable Light) [0x2004] = { is_climate_sensor_w100 = true }, -- Climate Sensor W100, requires unique profile + }, + [0x1209] = { -- Bosch + [0x3013] = {target_profile = "light-level-motion-illuminance-battery-temp"} } } From 0723d13bdff9c77716463cd26813237da6c78180 Mon Sep 17 00:00:00 2001 From: "Jan Jakubiszyn/SmartThings Integrations (BJ.jakubiszynS) /SRPOL/Engineer/Samsung Electronics" Date: Thu, 27 Nov 2025 15:46:08 +0100 Subject: [PATCH 2/2] Implementing changes from code review: edit of the device profile name and capability order, edit of the match_profile's condition --- drivers/SmartThings/matter-switch/fingerprints.yml | 2 +- ...vel-battery-illuminance-motion-temperature.yml} | 14 +++++++------- .../src/switch_utils/device_configuration.lua | 5 +---- .../matter-switch/src/switch_utils/fields.lua | 2 +- 4 files changed, 10 insertions(+), 13 deletions(-) rename drivers/SmartThings/matter-switch/profiles/{light-level-motion-illuminance-battery-temp.yml => light-level-battery-illuminance-motion-temperature.yml} (91%) diff --git a/drivers/SmartThings/matter-switch/fingerprints.yml b/drivers/SmartThings/matter-switch/fingerprints.yml index 84c0733c62..7b01d3429b 100644 --- a/drivers/SmartThings/matter-switch/fingerprints.yml +++ b/drivers/SmartThings/matter-switch/fingerprints.yml @@ -141,7 +141,7 @@ matterManufacturer: deviceLabel: "Motion Detector II [+M]" vendorId: 0x1209 productId: 0x3013 - deviceProfileName: light-level-motion-illuminance-battery-temp + deviceProfileName: light-level-battery-illuminance-motion-temperature #Chengdu - id: "5218/8197" deviceLabel: Magic Cube DS001 diff --git a/drivers/SmartThings/matter-switch/profiles/light-level-motion-illuminance-battery-temp.yml b/drivers/SmartThings/matter-switch/profiles/light-level-battery-illuminance-motion-temperature.yml similarity index 91% rename from drivers/SmartThings/matter-switch/profiles/light-level-motion-illuminance-battery-temp.yml rename to drivers/SmartThings/matter-switch/profiles/light-level-battery-illuminance-motion-temperature.yml index ae116ed54d..1748d311f2 100644 --- a/drivers/SmartThings/matter-switch/profiles/light-level-motion-illuminance-battery-temp.yml +++ b/drivers/SmartThings/matter-switch/profiles/light-level-battery-illuminance-motion-temperature.yml @@ -1,4 +1,4 @@ -name: light-level-motion-illuminance-battery-temp +name: light-level-battery-illuminance-motion-temperature components: - id: main capabilities: @@ -8,12 +8,6 @@ components: version: 1 - id: illuminanceMeasurement version: 1 - - id: battery - version: 1 - - id: firmwareUpdate - version: 1 - - id: refresh - version: 1 - id: switch version: 1 - id: switchLevel @@ -22,6 +16,12 @@ components: values: - key: "level.value" range: [1, 100] + - id: battery + version: 1 + - id: firmwareUpdate + version: 1 + - id: refresh + version: 1 categories: - name: MotionSensor preferences: diff --git a/drivers/SmartThings/matter-switch/src/switch_utils/device_configuration.lua b/drivers/SmartThings/matter-switch/src/switch_utils/device_configuration.lua index 3bb2c355ea..9389312959 100644 --- a/drivers/SmartThings/matter-switch/src/switch_utils/device_configuration.lua +++ b/drivers/SmartThings/matter-switch/src/switch_utils/device_configuration.lua @@ -192,10 +192,7 @@ function DeviceConfiguration.match_profile(driver, device) elseif generic_profile("light-color-level") and #device:get_endpoints(clusters.FanControl.ID) > 0 then updated_profile = "light-color-level-fan" elseif generic_profile("light-level") and #device:get_endpoints(clusters.OccupancySensing.ID) > 0 then - updated_profile = "light-level-motion" - if switch_utils.check_switch_category_vendor_overrides(device) then - updated_profile = fields.vendor_overrides[device.manufacturer_info.vendor_id][device.manufacturer_info.product_id].target_profile - end + updated_profile = switch_utils.get_product_override_field(device, "target_profile") or "light-level-motion" elseif generic_profile("light-level-colorTemperature") or generic_profile("light-color-level") then -- ignore attempts to dynamically profile light-level-colorTemperature and light-color-level devices for now, since -- these may lose fingerprinted Kelvin ranges when dynamically profiled. diff --git a/drivers/SmartThings/matter-switch/src/switch_utils/fields.lua b/drivers/SmartThings/matter-switch/src/switch_utils/fields.lua index 3b6b8c9a61..e6bf4afb39 100644 --- a/drivers/SmartThings/matter-switch/src/switch_utils/fields.lua +++ b/drivers/SmartThings/matter-switch/src/switch_utils/fields.lua @@ -119,7 +119,7 @@ SwitchFields.vendor_overrides = { [0x2004] = { is_climate_sensor_w100 = true }, -- Climate Sensor W100, requires unique profile }, [0x1209] = { -- Bosch - [0x3013] = {target_profile = "light-level-motion-illuminance-battery-temp"} + [0x3013] = {target_profile = "light-level-battery-illuminance-motion-temperature"} } }