Skip to content

Add Inovelli VZM32-SN mmWave switch support #4153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

InovelliUSA
Copy link
Contributor

Proposed change

Add Support for Inovelli VZM32-SN mmWave Switch

Additional information

Checklist

  • The changes are tested and work correctly
  • pre-commit checks pass / the code has been formatted using Black
  • Tests have been added to verify that the new code works

Copy link

codecov bot commented Jun 29, 2025

Codecov Report

Attention: Patch coverage is 96.77419% with 1 line in your changes missing coverage. Please review.

Project coverage is 91.29%. Comparing base (79df871) to head (d951724).

Files with missing lines Patch % Lines
zhaquirks/inovelli/__init__.py 91.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #4153      +/-   ##
==========================================
+ Coverage   91.28%   91.29%   +0.01%     
==========================================
  Files         339      340       +1     
  Lines       10967    10998      +31     
==========================================
+ Hits        10011    10041      +30     
- Misses        956      957       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@puddly puddly left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

We have new APIs for building quirks, clusters, and commands. I think they'll greatly simplify the way your quirk is currently written.

  1. For the quirk itself, I think something like this should suffice and will match both variants of your device:

    from zigpy.quirks.v2 import QuirkBuilder
    
    (
        QuirkBuilder("Inovelli", "VZM32-SN")
        .replaces(InovelliVZM32SNCluster, endpoint_id=1)
        .replaces(InovelliVZM32SNMMWaveCluster, endpoint_id=1)
        .device_automation_triggers(INOVELLI_AUTOMATION_TRIGGERS)
        .add_to_registry()
    )
  2. Our ZCL cluster definition format has changed. Here's an example that rewrites a portion of your cluster definition:

    class MMWaveLightOnPresenceBehavior(t.enum8):
        Option_one = 0x00
        Some_other_option = 0x01
    
    
    class MMwaveControlId(t.enum8):
        ...
    
    
    class InovelliVZM32SNCluster(InovelliCluster):
        """Inovelli VZM32-SN custom cluster."""
    
        name = "Inovelli VZM32SN Custom"
    
        class AttributeDefs(InovelliCluster.AttributeDefs):
            dimming_speed_up_local: Final = foundation.ZCLAttributeDef(
                id=0x0002,
                type=t.uint8_t,
                access="rw",
                is_manufacturer_specific=True,
            )
    
            # For enum attributes that don't use an enum, please create one with all of the
            # known values and override the ZCL data type
            mmwave_light_on_presence_behavior: Final = foundation.ZCLAttributeDef(
                id=0x006E,
                zcl_type=foundation.DataTypeId.uint8,
                type=MMWaveLightOnPresenceBehavior,
                access="rw",
                is_manufacturer_specific=True,
            )
    
        class ServerCommands(foundation.ServerCommandDefs):
            mmwave_control_command = foundation.ZCLCommandDef(
                id=0x00,
                schema={
                    # If the command schema includes an enumeration, break it out into a new
                    # type
                    "control_id": MMwaveControlId,
                },
                is_manufacturer_specific=True
            )

@puddly puddly added this to ZHA Jun 30, 2025
@InovelliUSA
Copy link
Contributor Author

@puddly we are actually working with @codyhackw to move everything over to the new format:

#3232

This is more of an "interim" change to make sure the device is supported when it comes out.

@TheJulianJES TheJulianJES added the needs review This PR should be reviewed soon, as it generally looks good. label Jun 30, 2025
@TheJulianJES TheJulianJES changed the title Add Support for Inovelli VZM32-SN mmWave Switch Add Inovelli VZM32-SN mmWave switch support Jul 10, 2025
@TheJulianJES
Copy link
Collaborator

#3232 is merged now, slated for HA 2025.8.0.
I guess we can close this then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review This PR should be reviewed soon, as it generally looks good.
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants