diff --git a/drivers/SmartThings/matter-switch/profiles/garage-door.yml b/drivers/SmartThings/matter-switch/profiles/garage-door.yml new file mode 100644 index 0000000000..c81e7987a1 --- /dev/null +++ b/drivers/SmartThings/matter-switch/profiles/garage-door.yml @@ -0,0 +1,12 @@ +name: garage-door-binary +components: +- id: main + capabilities: + - id: switch + version: 1 + - id: firmwareUpdate + version: 1 + - id: refresh + version: 1 + categories: + - name: GarageDoor diff --git a/drivers/SmartThings/matter-switch/src/sub_drivers/third_reality_mk1/can_handle.lua b/drivers/SmartThings/matter-switch/src/sub_drivers/third_reality_mk1/can_handle.lua index f3f5342989..5e65849936 100644 --- a/drivers/SmartThings/matter-switch/src/sub_drivers/third_reality_mk1/can_handle.lua +++ b/drivers/SmartThings/matter-switch/src/sub_drivers/third_reality_mk1/can_handle.lua @@ -1,13 +1,10 @@ -- Copyright 2025 SmartThings, Inc. -- Licensed under the Apache License, Version 2.0 -local device_lib = require "st.device" +local switch_utils = require "switch_utils.utils" return function(opts, driver, device) - local THIRD_REALITY_MK1_FINGERPRINT = { vendor_id = 0x1407, product_id = 0x1388 } - if device.network_type == device_lib.NETWORK_TYPE_MATTER and - device.manufacturer_info.vendor_id == THIRD_REALITY_MK1_FINGERPRINT.vendor_id and - device.manufacturer_info.product_id == THIRD_REALITY_MK1_FINGERPRINT.product_id then + if switch_utils.get_product_override_field(device, "is_3r_mk1") then return true, require("sub_drivers.third_reality_mk1") end return false 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 7ee4b6bf64..88d9b31049 100644 --- a/drivers/SmartThings/matter-switch/src/switch_utils/device_configuration.lua +++ b/drivers/SmartThings/matter-switch/src/switch_utils/device_configuration.lua @@ -91,7 +91,8 @@ function SwitchDeviceConfiguration.assign_profile_for_onoff_ep(device, server_on generic_profile = string.gsub(generic_profile, "-binary", "") .. static_electrical_tags end - if is_child_device and generic_profile == switch_utils.get_product_override_field(device, "initial_profile") then + if not switch_utils.get_product_override_field(device, "on_children_only") or is_child_device and + generic_profile == switch_utils.get_product_override_field(device, "initial_profile") then generic_profile = switch_utils.get_product_override_field(device, "target_profile") or generic_profile end diff --git a/drivers/SmartThings/matter-switch/src/switch_utils/fields.lua b/drivers/SmartThings/matter-switch/src/switch_utils/fields.lua index f670b154c8..b4c9fd281d 100644 --- a/drivers/SmartThings/matter-switch/src/switch_utils/fields.lua +++ b/drivers/SmartThings/matter-switch/src/switch_utils/fields.lua @@ -92,8 +92,12 @@ SwitchFields.updated_fields = { SwitchFields.vendor_overrides = { [0x1321] = { -- SONOFF_MANUFACTURER_ID - [0x000C] = { target_profile = "switch-binary", initial_profile = "plug-binary" }, - [0x000D] = { target_profile = "switch-binary", initial_profile = "plug-binary" }, + [0x000C] = { on_children_only = true, target_profile = "switch-binary", initial_profile = "plug-binary" }, + [0x000D] = { on_children_only = true, target_profile = "switch-binary", initial_profile = "plug-binary" }, + }, + [0x1407] = { -- THIRD_REALITY_ID + [0x1388] = { is_3r_mk1 = true }, + [0x1098] = { target_profile = "garage-door-binary", initial_profile = "light-binary" }, }, [0x115F] = { -- AQARA_MANUFACTURER_ID [0x1006] = { ignore_combo_switch_button = true }, -- 3 Buttons(Generic Switch), 1 Channel (Dimmable Light)