From f22f187fa89f4079e3e5c5d84b68bad9aa06ac61 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/3] Added support for Bosch matter motion sensor # Conflicts: # drivers/SmartThings/matter-switch/src/switch_utils/device_configuration.lua # drivers/SmartThings/matter-switch/src/switch_utils/fields.lua --- .../matter-switch/fingerprints.yml | 5 ++++ ...-level-motion-illuminance-battery-temp.yml | 29 +++++++++++++++++++ .../matter-switch/src/switch_utils/fields.lua | 3 ++ 3 files changed, 37 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 0871a9c0c5..4f32218329 100644 --- a/drivers/SmartThings/matter-switch/fingerprints.yml +++ b/drivers/SmartThings/matter-switch/fingerprints.yml @@ -182,6 +182,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/fields.lua b/drivers/SmartThings/matter-switch/src/switch_utils/fields.lua index ab878698ad..8f2e08a409 100644 --- a/drivers/SmartThings/matter-switch/src/switch_utils/fields.lua +++ b/drivers/SmartThings/matter-switch/src/switch_utils/fields.lua @@ -105,6 +105,9 @@ SwitchFields.vendor_overrides = { [0x117C] = { -- IKEA_MANUFACTURER_ID [0x8000] = { is_ikea_scroll = true } }, + [0x1209] = { -- Bosch + [0x3013] = {target_profile = "light-level-motion-illuminance-battery-temp"} + } } SwitchFields.switch_category_vendor_overrides = { From 96612cd17067ff13bab67bbfab852a5621b56d55 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/3] Implementing changes from the code review: edit of the device profile name and capability order, edit of the match_profile's condition # Conflicts: # drivers/SmartThings/matter-switch/src/switch_utils/device_configuration.lua # Conflicts: # drivers/SmartThings/matter-switch/src/switch_utils/device_configuration.lua --- drivers/SmartThings/matter-switch/fingerprints.yml | 2 +- ...vel-battery-illuminance-motion-temperature.yml} | 14 +++++++------- .../src/switch_utils/device_configuration.lua | 2 +- .../matter-switch/src/switch_utils/fields.lua | 2 +- 4 files changed, 10 insertions(+), 10 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 4f32218329..2436415fff 100644 --- a/drivers/SmartThings/matter-switch/fingerprints.yml +++ b/drivers/SmartThings/matter-switch/fingerprints.yml @@ -186,7 +186,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 ffea9efa2e..0c9c317f43 100644 --- a/drivers/SmartThings/matter-switch/src/switch_utils/device_configuration.lua +++ b/drivers/SmartThings/matter-switch/src/switch_utils/device_configuration.lua @@ -219,7 +219,7 @@ function DeviceConfiguration.match_profile(driver, device) updated_profile = SwitchDeviceConfiguration.assign_profile_for_onoff_ep(device, default_endpoint_id) local generic_profile = function(s) return string.find(updated_profile or "", s, 1, true) end if generic_profile("light-level") and #device:get_endpoints(clusters.OccupancySensing.ID) > 0 then - updated_profile = "light-level-motion" + updated_profile = switch_utils.get_product_override_field(device, "target_profile") or "light-level-motion" elseif switch_utils.check_switch_category_vendor_overrides(device) then -- check whether the overwrite should be over "plug" or "light" based on the current profile local overwrite_category = string.find(updated_profile, "plug") and "plug" or "light" diff --git a/drivers/SmartThings/matter-switch/src/switch_utils/fields.lua b/drivers/SmartThings/matter-switch/src/switch_utils/fields.lua index 8f2e08a409..f07bc8c4cc 100644 --- a/drivers/SmartThings/matter-switch/src/switch_utils/fields.lua +++ b/drivers/SmartThings/matter-switch/src/switch_utils/fields.lua @@ -106,7 +106,7 @@ SwitchFields.vendor_overrides = { [0x8000] = { is_ikea_scroll = true } }, [0x1209] = { -- Bosch - [0x3013] = {target_profile = "light-level-motion-illuminance-battery-temp"} + [0x3013] = {target_profile = "light-level-battery-illuminance-motion-temperature"} } } From 90ed999e070568c6392a5ba217a980069b4e2229 Mon Sep 17 00:00:00 2001 From: "Jan Jakubiszyn/SmartThings Integrations (BJ.jakubiszynS) /SRPOL/Engineer/Samsung Electronics" Date: Wed, 28 Jan 2026 14:35:54 +0100 Subject: [PATCH 3/3] Code cleanup --- .../matter-switch/src/switch_utils/device_configuration.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 0c9c317f43..ee7a1cde4e 100644 --- a/drivers/SmartThings/matter-switch/src/switch_utils/device_configuration.lua +++ b/drivers/SmartThings/matter-switch/src/switch_utils/device_configuration.lua @@ -219,7 +219,7 @@ function DeviceConfiguration.match_profile(driver, device) updated_profile = SwitchDeviceConfiguration.assign_profile_for_onoff_ep(device, default_endpoint_id) local generic_profile = function(s) return string.find(updated_profile or "", s, 1, true) end if generic_profile("light-level") and #device:get_endpoints(clusters.OccupancySensing.ID) > 0 then - updated_profile = switch_utils.get_product_override_field(device, "target_profile") or "light-level-motion" + updated_profile = switch_utils.get_product_override_field(device, "target_profile") or "light-level-motion" elseif switch_utils.check_switch_category_vendor_overrides(device) then -- check whether the overwrite should be over "plug" or "light" based on the current profile local overwrite_category = string.find(updated_profile, "plug") and "plug" or "light"