Skip to content

Conversation

@InovelliUSA
Copy link
Contributor

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

Duplicate profile check: Passed - no duplicate profiles detected.

@github-actions
Copy link

github-actions bot commented Aug 29, 2025

Channel deleted.

@github-actions
Copy link

github-actions bot commented Aug 29, 2025

Test Results

   71 files    475 suites   0s ⏱️
2 471 tests 2 471 ✅ 0 💤 0 ❌
4 223 runs  4 223 ✅ 0 💤 0 ❌

Results for commit 8732870.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Aug 29, 2025

File Coverage
All files 96%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-switch/src/qubino-switches/init.lua 81%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-switch/src/aeotec-heavy-duty/init.lua 98%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-switch/src/qubino-switches/qubino-relays/qubino-flush-1d-relay/init.lua 80%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-switch/src/lazy_load_subdriver.lua 57%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-switch/src/configurations.lua 99%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-switch/src/preferences.lua 99%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-switch/src/zwave-dual-switch/init.lua 95%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-switch/src/multi-metering-switch/init.lua 91%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-switch/src/inovelli-2-channel-smart-plug/init.lua 98%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-switch/src/qubino-switches/qubino-relays/init.lua 69%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-switch/src/aeotec-smart-switch/init.lua 98%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-switch/src/eaton-5-scene-keypad/init.lua 98%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-switch/src/fibaro-wall-plug-us/init.lua 93%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-switch/src/inovelli/lzw31-sn/init.lua 89%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-switch/src/qubino-switches/qubino-relays/qubino-flush-2-relay/init.lua 97%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-switch/src/zooz-power-strip/init.lua 98%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-switch/src/inovelli/init.lua 77%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against 8732870

@greens greens changed the title Inovelli VZW32-SN: Adding support for this device for the WWST program WWSTCERT-8357/8360 Inovelli VZW32-SN: Adding support for this device for the WWST program Oct 16, 2025
Comment on lines 9 to 14
- id: colorTemperature
version: 1
config:
values:
- key: "colorTemperature.value"
range: [ 2700, 6500 ]
Copy link
Contributor

Choose a reason for hiding this comment

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

You can now simply define the range your bulb supports in code using the colorTemperatureRange attribute.

Example: https://github.com/SmartThingsCommunity/SmartThingsEdgeDrivers/blob/main/drivers/SmartThings/matter-switch/src/generic_handlers/attribute_handlers.lua#L221

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@greens
Should I do something like this during device initialization then?

device:emit_event(capabilities.colorTemperature.colorTemperatureRange({ value = {minimum = 2700, maximum = 6500} }))
device:emit_event(capabilities.colorTemperature.colorTemperature(6500))

Then, should I change the profile to rgbw-bulb.yml and take out the config section?

Comment on lines 17 to 18
- id: firmwareUpdate
version: 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you're not emitting any events using this capability, please omit it.

If we do add OTA support for z-wave in the future, we will handle adding it to device profiles as necessary.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove this capability.

Comment on lines 200 to 206
local device_init = function(self, device)
if device.network_type ~= st_device.NETWORK_TYPE_CHILD then
device:set_component_to_endpoint_fn(component_to_endpoint)
device:set_endpoint_to_component_fn(endpoint_to_component)
--initialize(device)
end
end
Copy link
Contributor

Choose a reason for hiding this comment

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

you should no longer need to override the base driver's init function now (or the endpoint/component mapping functions)

@InovelliUSA
Copy link
Contributor Author

I just noticed my motion sensor isn't initializing for the main device. I thought "refresh" would catch it, but I can add it explicitly on Monday.

@greens
Copy link
Contributor

greens commented Oct 28, 2025

@InovelliUSA our defaults for motion sensor rely on the SENSOR_BINARY command class. The device defined in your test file doesn't support it, so no GET is sent on added. What command class are you using to report motion?

@InovelliUSA
Copy link
Contributor Author

@InovelliUSA our defaults for motion sensor rely on the SENSOR_BINARY command class. The device defined in your test file doesn't support it, so no GET is sent on added. What command class are you using to report motion?

We are using the NOTIFICATION command class.

@greens
Copy link
Contributor

greens commented Oct 29, 2025

@InovelliUSA Then I would suggest overwriting the refresh handler with a new function that first calls device:refresh and then sends a Notification:Get.

@InovelliUSA
Copy link
Contributor Author

@InovelliUSA Then I would suggest overwriting the refresh handler with a new function that first calls device:refresh and then sends a Notification:Get.

Something strange is happening when I do this. The process is working fine on the Zigbee driver, but the Z-wave driver becomes unresponsive when I use "refresh". I have tested a few different variants. Even this one causes the driver to stop responding:

local function refresh_handler(driver, device)
if device.network_type ~= st_device.NETWORK_TYPE_CHILD then
device: refresh()
else
device: refresh()
end
end

I will sometimes this in the logs after some time of hitting the refresh button:

2025-10-29T21:10:35.357313398Z TRACE Z-Wave Switch Found CapabilityCommandDispatcher handler in zwave_switch -> inovelli vzw32-sn handler
2025-10-29T21:10:35.357603273Z TRACE Z-Wave Switch Found CapabilityCommandDispatcher handler in zwave_switch -> inovelli vzw32-sn handler
2025-10-29T21:10:35.358610357Z TRACE Z-Wave Switch Found CapabilityCommandDispatcher handler in zwave_switch -> inovelli vzw32-sn handler
2025-10-29T21:10:35.359023815Z TRACE Z-Wave Switch Found CapabilityCommandDispatcher handler in zwave_switch -> inovelli vzw32-sn handler
2025-10-29T21:10:35.360245523Z TRACE Z-Wave Switch Found CapabilityCommandDispatcher handler in zwave_switch -> inovelli vzw32-sn handler
2025-10-29T21:10:35.360498523Z TRACE Z-Wave Switch Found CapabilityCommandDispatcher handler in zwave_switch -> inovelli vzw32-sn handler
2025-10-29T21:10:35.373764815Z FATAL Z-Wave Switch memory error: not enough memory
2025-10-29T21:10:48.072288810Z TRACE Z-Wave Switch Setup driver zwave_switch with lifecycle handlers:

@greens
Copy link
Contributor

greens commented Oct 30, 2025

@InovelliUSA that was my mistake. Z-Wave and Zigbee handle device:refresh calls in slightly different ways. As you probably guessed, Z-Wave works by emulating a refresh command being sent, hence the infinite recursion and stack overflow.

The fix is to use device:default_refresh() instead.

Also I noticed the same thing with the z-wave version of the vzw-31 that we saw with zigbee, so I'd ask you to consolidate here as well. Good news is that there is already a parent driver: https://github.com/SmartThingsCommunity/SmartThingsEdgeDrivers/tree/main/drivers/SmartThings/zwave-switch/src/inovelli-LED

@InovelliUSA
Copy link
Contributor Author

@greens I've combined the Inovelli drivers. I had to make some tweaks to ensure backwards compatibility with our last gen switches (which is what the other drivers were written for). I've got things setup so I should be able to add the vzw31 and vzw30 with minimal code added. I'll work on the certification of those devices soon.

Comment on lines +71 to +72
["button1"] = {"pushed","held","down_hold","pushed_2x","pushed_3x","pushed_4x","pushed_5x"},
["button2"] = {"pushed","held","down_hold","pushed_2x","pushed_3x","pushed_4x","pushed_5x"},
Copy link
Contributor

Choose a reason for hiding this comment

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

The issue with this change is that added will not be called for already-installed devices. Devices that were installed with the previous version of the driver will not issue this updated supported button event, and your driver will cause issues when it tries to generate a "held" event for these devices.

You may want to add a check in the scene handler to make sure that the supportedButtonValues attribute is correct before generating a held or down_hold event.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I am working on this. I currently have it implemented to send the supportedButtonValues in the scene handler if the value doesn't exist. This means that a button will need to be pressed on the switch to make this fire off. Is there a way to just have it fire off when an update to the driver is pushed out? Like once the hub gets the updated driver it runs "init" or something else and does the check at that point?

Copy link
Contributor

Choose a reason for hiding this comment

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

@InovelliUSA unfortunately not. Updating it in the Scene Handler if the value is not what you expect it to be is probably the correct way to handle it. I'd leave a comment indicating that the code can be removed at some point in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is the VZM32-SN driver live or is there a link I can use to install it? I am trying to test the process going from that version to my new one and trying to find a quick way to do that.

Copy link
Contributor

Choose a reason for hiding this comment

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

We've got this fingerprint, which is the one I'm concerned about:

  - id: "Inovelli/Dimmer/Power/Energy"
    deviceLabel: Inovelli Dimmer Switch
    manufacturerId: 0x031E
    productType: 0x0001
    productId: 0x0001
    deviceProfileName: inovelli-dimmer-power-energy

That's in the production default driver. You could try driver-switching, but I think the added event gets fired in the event of a driver switch, so the best way to test is to probably first create a custom channel with the current top-of-tree version of z-wave switch, add and install it to your hub, and join the device with the above fingerprint. After it's installed, you can update the driver to the code you have here, and install it again on the hub to update. You should be able to verify that the version has changed in the app and then you should be able to verify what the behavior will be like when we update the driver via deploy.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've made the changes for backwards compatibility but now it looks like there are some conflicts from changes that have been happening while the PR has been open. I will have to look into how to resolve them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@greens The conflicts have been taken care of and it looks like the driver is passing.

Comment on lines 29 to 58
if device.network_type ~= st_device.NETWORK_TYPE_CHILD then
device:send(Association:Set({grouping_identifier = 1, node_ids = {driver.environment_info.hub_zwave_id}}))
for _, component in pairs(device.profile.components) do
if component.id ~= "main" and component.id ~= LED_BAR_COMPONENT_NAME then
device:emit_component_event(
component,
capabilities.button.supportedButtonValues(
supported_button_values[component.id],
{ visibility = { displayed = false } }
)
)
device:emit_component_event(
component,
capabilities.button.numberOfButtons({value = 1}, { visibility = { displayed = false } })
)
end
end
refresh_handler(driver, device)
local ledBarComponent = device.profile.components[LED_BAR_COMPONENT_NAME]
if ledBarComponent ~= nil then
device:emit_component_event(ledBarComponent, capabilities.colorControl.hue(1))
device:emit_component_event(ledBarComponent, capabilities.colorControl.saturation(1))
end
else
device:emit_event(capabilities.colorControl.hue(1))
device:emit_event(capabilities.colorControl.saturation(1))
device:emit_event(capabilities.colorTemperature.colorTemperatureRange({ value = {minimum = 2700, maximum = 6500} }))
device:emit_event(capabilities.switchLevel.level(100))
device:emit_event(capabilities.switch.switch("off"))
end
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: spacing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I make these changes even though the PR is approved, or should I make them in a different PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you make them now? I'll merge after.

Comment on lines 1 to 13
-- Copyright 2025 SmartThings
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: older copyright

@greens greens changed the title WWSTCERT-8357/8360 Inovelli VZW32-SN: Adding support for this device for the WWST program WWSTCERT-8360 Inovelli VZW32-SN: Adding support for this device for the WWST program Nov 25, 2025
@greens greens merged commit 37691d5 into SmartThingsCommunity:main Nov 26, 2025
12 checks passed
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.

2 participants