Preserve previous speed when turning on Inovelli fans - #854
Open
InovelliUSA wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add an InovelliFan entity implementation for the VZM35-SN and VZM36 fan switches that overrides the default turn_on() behavior.
Today, calling fan.turn_on() without specifying a speed or percentage causes the generic ZHA fan implementation to use default_on_percentage, which results in a FanMode write (typically Medium for a 3-speed fan). This changes the fan speed to 50% instead of simply restoring the previous speed.
The Inovelli fan switches support independent power and speed control. Sending an On command via the On/Off cluster powers the fan on while preserving the previously selected speed. The device then reports its current fan_mode, allowing the entity state to remain synchronized.
This change adds a model-specific InovelliFan entity that:
Matches the VZM35-SN and VZM36.
Sends an On command on the On/Off cluster when fan.turn_on() is called without a speed, percentage, or preset.
Preserves the existing behavior for explicit speed/percentage requests by delegating to the generic Fan implementation.
This only affects the default "turn on" behavior for these specific models and leaves all other Zigbee fan implementations unchanged.
Note: The Zigbee Fan Control specification defines FanMode.On as the preferred mechanism for turning a fan on while preserving its current speed. That would likely be the ideal implementation for the generic ZHA fan entity. However, the current Inovelli firmware does not yet implement FanMode.On correctly, and it is unclear whether all Zigbee fan manufacturers support this mode consistently. Until support is more broadly understood, using the On/Off cluster provides the desired behavior for these devices while avoiding changes to the generic fan implementation.