Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions drivers/SmartThings/matter-switch/fingerprints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4315,6 +4315,11 @@ matterGeneric:
- id: 0x002B # Fan
- id: 0x0110 # Mounted Dimmable Load Control
deviceProfileName: fan-modular
- id: "matter/closure"
deviceLabel: Matter Closure
deviceTypes:
- id: 0x0230 # Closure
deviceProfileName: window-covering-modular
- id: "matter/window/covering"
deviceLabel: Matter Window Covering
deviceTypes:
Expand Down
21 changes: 21 additions & 0 deletions drivers/SmartThings/matter-switch/profiles/covering.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: covering
components:
- id: main
capabilities:
- id: windowShade
version: 1
- id: battery
version: 1
optional: true
- id: batteryLevel
version: 1
optional: true
- id: firmwareUpdate
version: 1
- id: refresh
version: 1
categories:
- name: Blind
preferences:
- preferenceId: reverse
explicit: true
18 changes: 18 additions & 0 deletions drivers/SmartThings/matter-switch/profiles/door.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: door
components:
- id: main
capabilities:
- id: doorControl
version: 1
- id: battery
version: 1
optional: true
- id: batteryLevel
version: 1
optional: true
- id: firmwareUpdate
version: 1
- id: refresh
version: 1
categories:
- name: Door
18 changes: 18 additions & 0 deletions drivers/SmartThings/matter-switch/profiles/garage-door.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: garage-door
components:
- id: main
capabilities:
- id: doorControl
version: 1
- id: battery
version: 1
optional: true
- id: batteryLevel
version: 1
optional: true
- id: firmwareUpdate
version: 1
- id: refresh
version: 1
categories:
- name: GarageDoor
18 changes: 18 additions & 0 deletions drivers/SmartThings/matter-switch/profiles/gate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: gate
components:
- id: main
capabilities:
- id: doorControl
version: 1
- id: battery
version: 1
optional: true
- id: batteryLevel
version: 1
optional: true
- id: firmwareUpdate
version: 1
- id: refresh
version: 1
categories:
- name: Door
Copy link
Contributor Author

@nickolas-deboom nickolas-deboom Feb 3, 2026

Choose a reason for hiding this comment

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

A request for a new Gate category has been opened, and once that's published we can update the category here to reflect that

Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
local cluster_base = require "st.matter.cluster_base"
local ClosureControlServerAttributes = require "embedded_clusters.ClosureControl.server.attributes"
local ClosureControlServerCommands = require "embedded_clusters.ClosureControl.server.commands"
local ClosureControlTypes = require "embedded_clusters.ClosureControl.types"

local ClosureControl = {}

ClosureControl.ID = 0x0104
ClosureControl.NAME = "ClosureControl"
ClosureControl.server = {}
ClosureControl.client = {}
ClosureControl.server.attributes = ClosureControlServerAttributes:set_parent_cluster(ClosureControl)
ClosureControl.server.commands = ClosureControlServerCommands:set_parent_cluster(ClosureControl)
ClosureControl.types = ClosureControlTypes

function ClosureControl:get_attribute_by_id(attr_id)
local attr_id_map = {
[0x0000] = "CountdownTime",
[0x0001] = "MainState",
[0x0002] = "CurrentErrorList",
[0x0003] = "OverallCurrentState",
[0x0004] = "OverallTargetState",
[0x0005] = "LatchControlModes",
[0xFFF9] = "AcceptedCommandList",
[0xFFFB] = "AttributeList",
}
local attr_name = attr_id_map[attr_id]
if attr_name ~= nil then
return self.attributes[attr_name]
end
return nil
end

function ClosureControl:get_server_command_by_id(command_id)
local server_id_map = {
[0x0000] = "Stop",
[0x0001] = "MoveTo",
[0x0002] = "Calibrate",
}
if server_id_map[command_id] ~= nil then
return self.server.commands[server_id_map[command_id]]
end
return nil
end


ClosureControl.attribute_direction_map = {
["CountdownTime"] = "server",
["MainState"] = "server",
["CurrentErrorList"] = "server",
["OverallCurrentState"] = "server",
["OverallTargetState"] = "server",
["LatchControlModes"] = "server",
["AcceptedCommandList"] = "server",
["AttributeList"] = "server",
}

ClosureControl.command_direction_map = {
["Stop"] = "server",
["MoveTo"] = "server",
["Calibrate"] = "server",
}

ClosureControl.FeatureMap = ClosureControl.types.Feature

function ClosureControl.are_features_supported(feature, feature_map)
if (ClosureControl.FeatureMap.bits_are_valid(feature)) then
return (feature & feature_map) == feature
end
return false
end

local attribute_helper_mt = {}
attribute_helper_mt.__index = function(self, key)
local direction = ClosureControl.attribute_direction_map[key]
if direction == nil then
error(string.format("Referenced unknown attribute %s on cluster %s", key, ClosureControl.NAME))
end
return ClosureControl[direction].attributes[key]
end
ClosureControl.attributes = {}
setmetatable(ClosureControl.attributes, attribute_helper_mt)

local command_helper_mt = {}
command_helper_mt.__index = function(self, key)
local direction = ClosureControl.command_direction_map[key]
if direction == nil then
error(string.format("Referenced unknown command %s on cluster %s", key, ClosureControl.NAME))
end
return ClosureControl[direction].commands[key]
end
ClosureControl.commands = {}
setmetatable(ClosureControl.commands, command_helper_mt)

setmetatable(ClosureControl, {__index = cluster_base})

return ClosureControl
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
local cluster_base = require "st.matter.cluster_base"
local data_types = require "st.matter.data_types"
local TLVParser = require "st.matter.TLV.TLVParser"

local AcceptedCommandList = {
ID = 0xFFF9,
NAME = "AcceptedCommandList",
base_type = require "st.matter.data_types.Array",
element_type = require "st.matter.data_types.Uint32",
}

function AcceptedCommandList:augment_type(data_type_obj)
for i, v in ipairs(data_type_obj.elements) do
data_type_obj.elements[i] = data_types.validate_or_build_type(v, AcceptedCommandList.element_type)
end
end

function AcceptedCommandList:new_value(...)
local o = self.base_type(table.unpack({...}))

return o
end

function AcceptedCommandList:read(device, endpoint_id)
return cluster_base.read(
device,
endpoint_id,
self._cluster.ID,
self.ID,
nil
)
end

function AcceptedCommandList:subscribe(device, endpoint_id)
return cluster_base.subscribe(
device,
endpoint_id,
self._cluster.ID,
self.ID,
nil
)
end

function AcceptedCommandList:set_parent_cluster(cluster)
self._cluster = cluster
return self
end

function AcceptedCommandList:build_test_report_data(
device,
endpoint_id,
value,
status
)
local data = data_types.validate_or_build_type(value, self.base_type)

return cluster_base.build_test_report_data(
device,
endpoint_id,
self._cluster.ID,
self.ID,
data,
status
)
end

function AcceptedCommandList:deserialize(tlv_buf)
local data = TLVParser.decode_tlv(tlv_buf)

return data
end

setmetatable(AcceptedCommandList, {__call = AcceptedCommandList.new_value, __index = AcceptedCommandList.base_type})
return AcceptedCommandList
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
local cluster_base = require "st.matter.cluster_base"
local data_types = require "st.matter.data_types"
local TLVParser = require "st.matter.TLV.TLVParser"

local AttributeList = {
ID = 0xFFFB,
NAME = "AttributeList",
base_type = require "st.matter.data_types.Array",
element_type = require "st.matter.data_types.Uint32",
}

function AttributeList:augment_type(data_type_obj)
for i, v in ipairs(data_type_obj.elements) do
data_type_obj.elements[i] = data_types.validate_or_build_type(v, AttributeList.element_type)
end
end

function AttributeList:new_value(...)
local o = self.base_type(table.unpack({...}))

return o
end

function AttributeList:read(device, endpoint_id)
return cluster_base.read(
device,
endpoint_id,
self._cluster.ID,
self.ID,
nil
)
end

function AttributeList:subscribe(device, endpoint_id)
return cluster_base.subscribe(
device,
endpoint_id,
self._cluster.ID,
self.ID,
nil
)
end

function AttributeList:set_parent_cluster(cluster)
self._cluster = cluster
return self
end

function AttributeList:build_test_report_data(
device,
endpoint_id,
value,
status
)
local data = data_types.validate_or_build_type(value, self.base_type)

return cluster_base.build_test_report_data(
device,
endpoint_id,
self._cluster.ID,
self.ID,
data,
status
)
end

function AttributeList:deserialize(tlv_buf)
local data = TLVParser.decode_tlv(tlv_buf)

return data
end

setmetatable(AttributeList, {__call = AttributeList.new_value, __index = AttributeList.base_type})
return AttributeList
Loading
Loading