Skip to content

add MultiIR contact sensor MIR_MC100#2867

Open
thinkaName wants to merge 1 commit intoSmartThingsCommunity:mainfrom
thinkaName:multiir_door_sensor_MIR_MC100
Open

add MultiIR contact sensor MIR_MC100#2867
thinkaName wants to merge 1 commit intoSmartThingsCommunity:mainfrom
thinkaName:multiir_door_sensor_MIR_MC100

Conversation

@thinkaName
Copy link
Copy Markdown
Contributor

@thinkaName thinkaName commented Apr 1, 2026

Check all that apply

Type of Change

  • WWST Certification Request
    • If this is your first time contributing code:
      • I have reviewed the README.md file
      • I have reviewed the CODE_OF_CONDUCT.md file
      • I have signed the CLA
    • I plan on entering a WWST Certification Request or have entered a request through the WWST Certification console at developer.smartthings.com
  • Bug fix
  • New feature
  • Refactor

Checklist

  • I have performed a self-review of my code
  • I have commented my code in hard-to-understand areas
  • I have verified my changes by testing with a device or have communicated a plan for testing
  • I am adding new behavior, such as adding a sub-driver, and have added and run new unit tests to cover the new behavior

Description of Change

Summary of Completed Tests

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

Duplicate profile check: Passed - no duplicate profiles detected.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

Test Results

   72 files    500 suites   0s ⏱️
2 744 tests 2 744 ✅ 0 💤 0 ❌
4 638 runs  4 638 ✅ 0 💤 0 ❌

Results for commit a983a46.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

File Coverage
All files 97%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-contact/src/MultiIR/init.lua 95%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-contact/src/frient/frient-vibration/init.lua 87%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-contact/src/init.lua 98%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-contact/src/lazy_load_subdriver.lua 57%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against a983a46

@cbaumler cbaumler requested review from aleclorimer and cjswedes April 9, 2026 21:11
@thinkaName thinkaName force-pushed the multiir_door_sensor_MIR_MC100 branch from c237c6b to a983a46 Compare April 13, 2026 03:11
Copy link
Copy Markdown
Contributor

@cjswedes cjswedes left a comment

Choose a reason for hiding this comment

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

I am confused as to whether this device uses IAS Zone to report the contact sensor state or not. The mock device does not contain the IAS Zone attribute, and the init handler removes the bind/reporting configuration setup for the cluster, and the overridden doConfigure handler means the IAS zone cluster will not be setup to enroll in zone status notification.s

Comment on lines +45 to +47
local function do_configure(driver, device)
device:configure()
end
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.

Use the default handler. It calls device:configure() which takes care of ias zone configuration as well as the other attributes, and injects a refresh command.

Comment on lines +26 to +35
local function device_init(driver, device)
device:remove_configured_attribute(IASZone.ID, IASZone.attributes.ZoneStatus.ID)
device:remove_monitored_attribute(IASZone.ID, IASZone.attributes.ZoneStatus.ID)
local configuration = configurationMap.get_device_configuration(device)
if configuration ~= nil then
for _, attribute in ipairs(configuration) do
device:add_configured_attribute(attribute)
end
end
end
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.

I dont think you want to do this. Removing the ZoneStatus attribute from the configured attributes means device:configure() will not actually send the bind and ConfigureReporting messages to setup the attribute reporting; this mean the hub will not be notified of state changes via this attribute in the contact sensor and the device will be more likely to fall offline.

Also, the configuration map does not have an entry for the device so configuration will always be nil, and not have attributes added to the configuration. Other subdrivers use this pattern because they use different clusters for contact sensing.

Do you expect the device to report the ZoneStatus attribute?

id = 0x01,
manufacturer = "MultIR",
model = "MIR-MC100",
server_clusters = { 0x0001,0x0003, 0x0005, 0x0006 }
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.

This does not include ias zone cluster, but the driver is written like the device would include it. Make sure your mock device is setup with the same endpoints/clusters as the real device.

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.

3 participants