Skip to content

Support additional Camera device types#2590

Open
nickolas-deboom wants to merge 2 commits into
mainfrom
support-additional-camera-device-types
Open

Support additional Camera device types#2590
nickolas-deboom wants to merge 2 commits into
mainfrom
support-additional-camera-device-types

Conversation

@nickolas-deboom
Copy link
Copy Markdown
Contributor

@nickolas-deboom nickolas-deboom commented Dec 1, 2025

This adds support for the following device types:

  • 0x0140 Intercom
  • 0x0141 Audio Doorbell
  • 0x0142 Camera
  • 0x0143 Video Doorbell
  • 0x0144 Floodlight Camera
  • 0x0145 Snapshot Camera
  • 0x0146 Chime
  • 0x0148 DoorBell

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 1, 2025

Duplicate profile check: Passed - no duplicate profiles detected.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 1, 2025

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 1, 2025

Test Results

   73 files  ±0    515 suites  ±0   0s ⏱️ ±0s
2 906 tests +5  2 906 ✅ +5  0 💤 ±0  0 ❌ ±0 
4 802 runs  +5  4 802 ✅ +5  0 💤 ±0  0 ❌ ±0 

Results for commit 42bfb6a. ± Comparison against base commit 917bdad.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 1, 2025

File Coverage
All files 92%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/aqara_cube/init.lua 95%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/camera/init.lua 97%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/switch_utils/utils.lua 92%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/switch_utils/device_configuration.lua 97%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/switch_utils/embedded_cluster_utils.lua 38%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/eve_energy/init.lua 91%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/third_reality_mk1/init.lua 95%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/switch_handlers/event_handlers.lua 97%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/switch_handlers/attribute_handlers.lua 80%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/switch_handlers/capability_handlers.lua 92%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/ikea_scroll/init.lua 87%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/ikea_scroll/scroll_handlers/event_handlers.lua 93%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_utils/utils.lua 98%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_utils/device_configuration.lua 94%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_handlers/attribute_handlers.lua 96%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_handlers/capability_handlers.lua 84%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/init.lua 97%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against 42bfb6a

Copy link
Copy Markdown
Contributor

@samadDotDev samadDotDev left a comment

Choose a reason for hiding this comment

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

Will need to re-evaluate after rebase

Comment thread drivers/SmartThings/matter-switch/src/switch_utils/utils.lua Outdated
@nickolas-deboom nickolas-deboom force-pushed the support-additional-camera-device-types branch from 96ccae6 to 67332b9 Compare February 10, 2026 21:19
@nickolas-deboom nickolas-deboom force-pushed the support-additional-camera-device-types branch 2 times, most recently from e012e2a to a25f0c7 Compare March 3, 2026 17:45
Comment thread drivers/SmartThings/matter-switch/src/switch_utils/utils.lua Outdated
Comment thread drivers/SmartThings/matter-switch/src/switch_utils/utils.lua Outdated
Comment thread drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_utils/utils.lua Outdated
Comment thread drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_utils/fields.lua Outdated
Comment thread drivers/SmartThings/matter-switch/src/switch_utils/fields.lua Outdated
@@ -6,116 +6,166 @@ local dkjson = require "dkjson"
local clusters = require "st.matter.clusters"

local mock_device = test.mock_device.build_test_matter_device({
Copy link
Copy Markdown
Contributor Author

@nickolas-deboom nickolas-deboom Mar 5, 2026

Choose a reason for hiding this comment

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

Mentioned elsewhere, but after making the changes in 0542fb3 the tests here began to fail because they expect subscriptions to the button events yet no endpoints with the Switch cluster were present in the mock device. I added the endpoints and also fixed the tabbing in this file which is why the diff looks so large

@nickolas-deboom nickolas-deboom force-pushed the support-additional-camera-device-types branch 2 times, most recently from 31bd85e to 164095f Compare March 5, 2026 21:21
Comment thread drivers/SmartThings/matter-switch/profiles/av-doorbell.yml Outdated
Comment thread drivers/SmartThings/matter-switch/src/test/test_matter_camera.lua
if status_light_brightness_present then
table.insert(status_led_component_capabilities, capabilities.mode.ID)
end
if #device:get_endpoints(clusters.Chime.ID, {cluster_type = "SERVER"}) > 0 then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

SERVER or BOTH? Basically reuse logic similar to has_server_cluster_type()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in b082796, does that look alright? It uses the first endpoint containing the Chime cluster, but I wasn't sure if the client and server clusters would necessarily be on the same endpoint or not

@nickolas-deboom nickolas-deboom force-pushed the support-additional-camera-device-types branch 2 times, most recently from b1faa74 to 297c2e3 Compare March 9, 2026 20:57
--- @param subscribed_events table key-value pairs mapping capability ids to subscribed events
function utils.populate_subscribe_request_for_device(checked_device, subscribe_request, capabilities_seen, attributes_seen, events_seen, subscribed_attributes, subscribed_events)
for _, component in pairs(checked_device.st_store.profile.components) do
function utils.populate_subscribe_request_for_device(checked_device, parent_device, subscribe_request, capabilities_seen, attributes_seen, events_seen, subscribed_attributes, subscribed_events)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Before merging, let's document a little testing here, since this change does affect our subscription logic. LGTM, but I think it's still worth ensuring we haven't missed something

Comment thread drivers/SmartThings/matter-switch/src/switch_utils/fields.lua Outdated
Comment thread drivers/SmartThings/matter-switch/src/switch_utils/fields.lua Outdated
Comment thread drivers/SmartThings/matter-switch/src/switch_utils/fields.lua Outdated
Comment thread drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_utils/fields.lua Outdated
@samadDotDev samadDotDev self-requested a review March 10, 2026 16:53
Comment thread drivers/SmartThings/matter-switch/src/switch_utils/fields.lua Outdated
@samadDotDev samadDotDev self-requested a review March 10, 2026 16:54
@nickolas-deboom nickolas-deboom force-pushed the support-additional-camera-device-types branch 2 times, most recently from 63e0a39 to 17d5bb3 Compare March 12, 2026 20:49
@nickolas-deboom nickolas-deboom force-pushed the support-additional-camera-device-types branch from a19ba8c to 0080716 Compare May 13, 2026 17:19
local version = require "version"
if version.rpc >= 10 and version.api >= 16 and
#switch_utils.get_endpoints_by_device_type(device, fields.DEVICE_TYPE_ID.CAMERA) > 0 then
#device:get_endpoints(clusters.CameraAvStreamManagement.ID, {cluster_type = "SERVER"}) > 0 or
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We would want to use the version gating for any of these device types, so you'd need to add parentesis around the string of or conditionals so that the logic is something like if version > X and (has_camera_cluster or is_chime or is_doorbell):

if version.rpc >= 10 and version.api >= 16 and
    (#device:get_endpoints(clusters.CameraAvStreamManagement.ID, { cluster_type = "SERVER" }) > 0 or
      #switch_utils.get_endpoints_by_device_type(device, fields.DEVICE_TYPE_ID.CHIME) > 0 or
      #switch_utils.get_endpoints_by_device_type(device, fields.DEVICE_TYPE_ID.DOORBELL) > 0) then
  return true, require("sub_drivers.camera")
end

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed in 42bfb6a

table.insert(main_component_capabilities, capabilities.nightVision.ID)
end
if #chime_endpoints > 0 then
table.insert(main_component_capabilities, capabilities.sounds.ID)
Copy link
Copy Markdown
Contributor

@ctowns ctowns Jun 3, 2026

Choose a reason for hiding this comment

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

We would also need to include audioMute for handling the Enabled attribute on the chime cluster, which is mandatory

--- @param subscribed_events table key-value pairs mapping capability ids to subscribed events
function utils.populate_subscribe_request_for_device(checked_device, subscribe_request, capabilities_seen, attributes_seen, events_seen, subscribed_attributes, subscribed_events)
for _, component in pairs(checked_device.st_store.profile.components) do
function utils.populate_subscribe_request_for_device(checked_device, parent_device, subscribe_request, capabilities_seen, attributes_seen, events_seen, subscribed_attributes, subscribed_events)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could we just update this function to get the parent device of the checked_device as needed rather than passing on the parent device in the function parameters? If the device doesn't have a parent device, then we would know that it is the parent device.

deviceTypes:
- id: 0x0145 # Snapshot Camera
deviceProfileName: camera
- id: "matter/chime"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A device that supports Camera and Chime would equally match to the generic fingerprint for both Matter Camera and Matter Chime, so it is ambiguous which profile would be used initially. I know we would expect this to be fixed by the match profile logic, but could you add an additional fingerprint that matches on both the Camera and Chime device types and uses the camera profile? Also, this would allow us to set the default name to "Matter Camera" for these devices.

This adds support for the following device types:
 *  0x0140 Intercom
 *  0x0141 Audio Doorbell
 *  0x0142 Camera
 *  0x0143 Video Doorbell
 *  0x0144 Floodlight Camera
 *  0x0145 Snapshot Camera
 *  0x0146 Chime
 *  0x0148 DoorBell
@nickolas-deboom nickolas-deboom force-pushed the support-additional-camera-device-types branch from 0080716 to 394d80d Compare June 4, 2026 16:08
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.

4 participants