Skip to content

WWSTCERT-13068 - add aeotec 8 series new - #2897

Open
iot-holding wants to merge 24 commits into
SmartThingsCommunity:mainfrom
iot-holding:add-aeotec-8-series-new
Open

iot-holding wants to merge 24 commits into
SmartThingsCommunity:mainfrom
iot-holding:add-aeotec-8-series-new

Conversation

@iot-holding

Copy link
Copy Markdown
Contributor

Check all that apply

Type of Change

  • [ x] 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
  • [x ] New feature
  • Refactor

Checklist

  • [x ] I have performed a self-review of my code
  • I have commented my code in hard-to-understand areas
  • [ x] 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

This is a new clean pull request for the new Aeotec Series 8 devices.

Summary of Completed Tests

@github-actions

github-actions Bot commented Apr 13, 2026 •

Copy link
Copy Markdown

Duplicate profile check: Passed - no duplicate profiles detected.

@github-actions

github-actions Bot commented Apr 13, 2026 •

Copy link
Copy Markdown

Test Results

   73 files  ± 0    546 suites  +5   0s ⏱️ ±0s
3 337 tests +61  3 337 ✅ +61  0 💤 ±0  0 ❌ ±0 
5 345 runs  +80  5 345 ✅ +80  0 💤 ±0  0 ❌ ±0 

Results for commit a0f3685. ± Comparison against base commit 81a89ae.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Apr 13, 2026 •

Copy link
Copy Markdown

File Coverage
All files 71% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/sub_drivers.lua 87% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/init.lua 54% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/preferences.lua 93% ✅
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/lazy_load_subdriver.lua 57% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/configurations.lua 84% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/timed-tamper-clear/can_handle.lua 52% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/zooz-4-in-1-sensor/can_handle.lua 14% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/fibaro-motion-sensor/can_handle.lua 14% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/aeotec-multisensor/can_handle.lua 14% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/fibaro-door-window-sensor/can_handle.lua 14% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/fibaro-door-window-sensor/fibaro-door-window-sensor-2/can_handle.lua 16% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/sensative-strip/can_handle.lua 14% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/homeseer-multi-sensor/can_handle.lua 12% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/firmware-version/can_handle.lua 40% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/vision-motion-detector/can_handle.lua 12% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/glentronics-water-leak-sensor/can_handle.lua 12% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/wakeup-no-poll/can_handle.lua 20% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/fibaro-flood-sensor/can_handle.lua 14% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/aeotec-multisensor/multisensor-6/can_handle.lua 20% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/fibaro-door-window-sensor/fibaro-door-window-sensor-1/can_handle.lua 16% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/v1-contact-event/can_handle.lua 7% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/zwave-water-leak-sensor/can_handle.lua 14% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/ezmultipli-multipurpose-sensor/can_handle.lua 12% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/aeotec-multisensor/multisensor-7/can_handle.lua 20% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/aeotec-water-sensor/can_handle.lua 14% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/enerwave-motion-sensor/can_handle.lua 16% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/everspring-motion-light-sensor/can_handle.lua 11% ❌

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against a01294e

@github-actions

Copy link
Copy Markdown

@iot-holding iot-holding changed the title new pull request add aeotec 8 series Apr 14, 2026
@iot-holding iot-holding changed the title add aeotec 8 series add aeotec 8 series new Apr 14, 2026
Comment thread drivers/SmartThings/zwave-sensor/src/aeotec-aerq-8/init.lua Outdated
Comment thread drivers/SmartThings/zwave-sensor/src/preferences.lua Outdated
Comment thread drivers/SmartThings/zwave-sensor/profiles/aeotec-aerq-8.yml Outdated
Comment thread drivers/SmartThings/zwave-sensor/src/aeotec-door-window-sensor-8/init.lua Outdated
Comment thread drivers/SmartThings/zwave-sensor/profiles/aeotec-aerq-8.yml Outdated
Comment thread drivers/SmartThings/zwave-sensor/profiles/aeotec-door-window-sensor-8.yml Outdated
Comment thread drivers/SmartThings/zwave-sensor/src/aeotec-water-sensor-8/init.lua
Comment thread drivers/SmartThings/zwave-sensor/src/aeotec-aerq-8/init.lua Outdated
Comment thread drivers/SmartThings/zwave-sensor/src/aeotec-aerq-8/init.lua Outdated

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 subdriver is unnecessary. The aeotec-door-window-sensor-8 handlers cover everything here. Remove this driver, and have the device be handled by that one.

@cjswedes

Copy link
Copy Markdown
Contributor

I will re-review once the tests are passing.

Ill also request that you test your device on a real hub to ensure its functionality is what you expect.

@KKlimczukS KKlimczukS changed the title add aeotec 8 series new WWSTCERT-10832 - add aeotec 8 series new Apr 15, 2026

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 file must also have a weird name

Comment thread drivers/SmartThings/zwave-sensor/src/timed-tamper-clear/init.lua Outdated
@cbaumler

Copy link
Copy Markdown
Contributor

@iot-holding once you resolve the branch conflicts and ensure the tests are passing, we can re-review this PR.

@cbaumler

Copy link
Copy Markdown
Contributor

@cjswedes @aleclorimer could you re-review this?

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 can handle never returns true and no longer loads the sub_driver when returning.

@aleclorimer aleclorimer left a comment

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.

Look like a couple of @cjswedes comments were still not addressed and a lot of driver tests are broken.

@cbaumler

cbaumler commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Hi @iot-holding, let us know when the comments/tests have been addressed and you're ready for us to re-review.

@iot-holding
iot-holding requested a review from cjswedes July 29, 2026 10:59
@KKlimczukS KKlimczukS changed the title WWSTCERT-10832 - add aeotec 8 series new WWSTCERT-13068 - add aeotec 8 series new Jul 30, 2026
@cbaumler

Copy link
Copy Markdown
Contributor

Hi @iot-holding, thanks for making the changes. Could you update this branch from main and we'll re-review.

Comment thread drivers/SmartThings/zwave-sensor/src/aeotec-water-sensor-8/init.lua
Comment thread drivers/SmartThings/zwave-sensor/src/aeotec-door-window-sensor-8/init.lua Outdated
Comment thread drivers/SmartThings/zwave-sensor/src/aeotec-water-sensor-8/init.lua Outdated
Comment thread drivers/SmartThings/zwave-sensor/src/preferences.lua Outdated
Comment thread drivers/SmartThings/zwave-sensor/src/aeotec-door-window-sensor-8/can_handle.lua Outdated
@iot-holding
iot-holding requested a review from cjswedes August 10, 2026 10:33
Comment thread drivers/SmartThings/zwave-sensor/src/aeotec-door-window-sensor-8/init.lua Outdated
local event
local event_parameter

if (0 ~= string.len(cmd.args.event_parameter)) 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.

I think a defensive nil check and early return for cmd.args.event_parameter is warranted since it is an optional field in the spec.

Comment on lines +100 to +112
if (sensor_type == SensorMultilevel.sensor_type.ACCELERATION_X_AXIS) then
x = value
device:set_field("three_axis_x", x)
event = ThreeAxis.threeAxis({value = {x, y, z}, unit = 'mG'})
elseif (sensor_type == SensorMultilevel.sensor_type.ACCELERATION_Y_AXIS) then
y = value
device:set_field("three_axis_y", y)
event = ThreeAxis.threeAxis({value = {x, y, z}, unit = 'mG'})
elseif (sensor_type == SensorMultilevel.sensor_type.ACCELERATION_Z_AXIS) then
z = value
device:set_field("three_axis_z", z)
event = ThreeAxis.threeAxis({value = {x, y, z}, unit = 'mG'})
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.

This is the only part of the sensor_multilevel_report_handler that is not default functionality. It differs in the device fields it uses, and most importantly in the unit conversion (there is none here, whereas the default handler converts from ms^2 to mG.

Is this device reporting acceleration in mG or in m/s^2? The spec dictates it is reported in m/s^2 so I would expect that is the unit being used by the device. In that case, this function is not needed, and the default should be used instead.

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.

When I use the standard handler, which converts the values from m/s² to mG, the converted values fall outside the allowed range of min: -10000 and max: 10000, which causes an error. That’s why I tried the custom handler.

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.

Please check that the values with this handler make sense. I am concerned by the lack of conversion; however, it could be that our default is incorrect in the conversion. If this is what is needed, I would ask that you leave a comment in this function explaining how this is the only part that differs from the defaults because of the units/conversion

profile = t_utils.get_profile_definition("aeotec-door-window-sensor-8.yml"),
zwave_endpoints = sensor_endpoints,
zwave_manufacturer_id = 0x0371,
zwave_product_id = 0x0037,

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.

missing product type in the mock.

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 is still missing.

Comment thread drivers/SmartThings/zwave-sensor/src/test/test_aeotec_water_sensor_8.lua Outdated
Comment thread drivers/SmartThings/zwave-sensor/profiles/aeotec-aerq-8.yml Outdated
@KKlimczukS

Copy link
Copy Markdown
Contributor

@iot-holding Please check latest remarks. Thank You.

Comment thread drivers/SmartThings/zwave-sensor/profiles/aeotec-aerq-8.yml Outdated
Comment thread drivers/SmartThings/zwave-sensor/src/test/test_aeotec_door_window_sensor_8.lua Outdated
profile = t_utils.get_profile_definition("aeotec-door-window-sensor-8.yml"),
zwave_endpoints = sensor_endpoints,
zwave_manufacturer_id = 0x0371,
zwave_product_id = 0x0037,

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 is still missing.

Comment thread drivers/SmartThings/zwave-sensor/src/test/test_aeotec_water_sensor_8.lua Outdated
Comment on lines +141 to +144
supported_capabilities = {
capabilities.powerSource,
capabilities.threeAxis,
},

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.

Suggested change
supported_capabilities = {
capabilities.powerSource,
capabilities.threeAxis,
},

This doesnt actually do anything when put in a subdriver; it is used by the top level driver when registering for default functionality. IMO it is misleading to put it here.

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.

Please remove this.

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.

Please remove supported_capabilities from the subdrivers.

Comment thread drivers/SmartThings/zwave-sensor/src/aeotec-water-sensor-8/init.lua Outdated
Comment thread drivers/SmartThings/zwave-sensor/src/aeotec-water-sensor-8/init.lua
Comment on lines +141 to +144
supported_capabilities = {
capabilities.powerSource,
capabilities.threeAxis,
},

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.

Please remove this.

Comment thread drivers/SmartThings/zwave-sensor/src/aeotec-door-window-sensor-8/init.lua Outdated
capabilities.carbonDioxideHealthConcern,
capabilities.soundDetection,
capabilities.panicAlarm
},

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.

Please remove the supported capabilities from the subdriver. This does not do anything at the subdriver level; it does at the top level driver for defaults registration and default driver switch behavior.

end
end

local function info_changed_handler(driver, device, event, args)

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.

There are several problems with this function as it is. info_changed is called for a lot of different reasons; anything changing on the device object (i.e. capabilities, preferences).

  1. The default events being emitted based on profile, will be emitted anytime infoChanged fire, which could override a valid state with the default state. It would be better to refresh the device to read the actual state (this could be done every infoChanged). We should avoid emitting default events in general because they often override valid state (only sometimes at onboarding time is it warranted).
  2. This new handler should call preferences.update_preferences(self, device, args) which is what the default handler called to handle preference updates, without it, preference updates are not handled anymore.

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.

6 participants