Open codyhackw opened 9 months ago
So it looks like it is iterating through all of the attributes even though it should only go through a subset of them for the VZM35-SN (as opposed to the VZM31-SN)? When the device does not respond to the reading of the "active_power_reports" attribute, HA errors out and does not check the rest. This results in many entities not being created.
This is showing up as a Light instead of a Fan and it has a bunch of dimming parameters that don't make sense for the fan control. HA 2023.10.3
This is showing up as a Light instead of a Fan and it has a bunch of dimming parameters that don't make sense for the fan control. HA 2023.10.3
Dimming params are meant to be used in Smart Fan mode. Maybe they should be hidden by default?
So it looks like it is iterating through all of the attributes even though it should only go through a subset of them for the VZM35-SN (as opposed to the VZM31-SN)? When the device does not respond to the reading of the "active_power_reports" attribute, HA errors out and does not check the rest. This results in many entities not being created.
Yup. Logs:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/zha/core/helpers.py", line 338, in wrapper
return await func(cluster_handler, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/zha/core/cluster_handlers/__init__.py", line 380, in async_initialize
await self._get_attributes(
File "/usr/src/homeassistant/homeassistant/components/zha/core/cluster_handlers/__init__.py", line 491, in _get_attributes
read, _ = await self.cluster.read_attributes(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/zigpy/zcl/__init__.py", line 501, in read_attributes
attrid = self.attributes_by_name[attribute].id
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: 'active_power_reports'
It looks like the active power report is removed from the attributes list here
It does seem odd that the VZM35SN doesn't have its own attribute list.
It appears this is slated for 2023.12 https://rc.home-assistant.io/changelogs/core-2023.12
I've got 2023.12 installed, and my fans are still showing up as lights and not fans.
There were some favorable changes in 2023.12 (the configuration parameters are more correct/complete but still not all there), but I also have had to reconfigure them manually to fans as they appeared as lights.
There were some favorable changes in 2023.12 (the configuration parameters are more correct/complete but still not all there), but I also have had to reconfigure them manually to fans as they appeared as lights.
I've been unable to use helpers to alter a light type to a fan type, do you have any insight?
I had to reconfigure them manually to fans as they appeared as lights.
I've been unable to use helpers to alter a light type to a fan type, do you have any insight?
I set the device type to "switch" via YAML and then used the UI to make a helper to convert the switch into a fan. Not intuitive, but it works.
Do you get the discrete 3 speed settings with the switch as X workaround or is it still a %? I want to use the tile card features for hi/med/low. It would be really great if this three speed fan controller was a three speed fan controller. 😃
It's functioning on the switch itself as 3 speed control but there is no control over that in HA. I can only turn it on/off remotely. Speed must be adjusted manually.
Do you get the discrete 3 speed settings with the switch as X workaround or is it still a %? I want to use the tile card features for hi/med/low. It would be really great if this three speed fan controller was a three speed fan controller. 😃
We are working on a firmware update that will have an additional fan endpoint. It will show up as a dimmer and a fan in HA, but you can disable either one if you want to. We keep the dimmer endpoint so it can be bound to dimmable devices that are not fans.
In the meantime there is a template that you can use. You can see in the screenshot what it will look like.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
This has been closed. The quirk has been updated to remove the power/energy functions and Firmware 1.05+ has an endpoint that shows up as a fan in ZHA.
Problem description
The Inovelli VZM35-SN Fan Switch only creates a subset of the entities expected within HA. It errors out on the active_power_reports attribute, which should only be checked for the VZM31-SN switch, but is likely being hit because both devices use the same manufacturer cluster (0xfc31).
Solution description
The device should create all applicable attributes, as identified under the Inovelli_VZM35SN_Cluster attributes in the init.py file.
Screenshots/Video
Screenshots/Video
[Paste/upload your media here]Device signature
Device signature
```json { "node_descriptor": "NodeDescriptor(logical_type=Diagnostic information
Diagnostic information
```json [Paste the diagnostic information here] ```Logs
Logs
```python 2023-10-10 19:19:31.235 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0xBC21:1:0x0006]: initializing cluster handler: from_cache: False 2023-10-10 19:19:31.235 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0xBC21:1:0x0006]: initializing cached cluster handler attributes: ['start_up_on_off'] 2023-10-10 19:19:31.235 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0xBC21:1:0x0006]: Reading attributes in chunks: ['start_up_on_off'] 2023-10-10 19:19:31.235 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0xBC21:1:0x0006]: initializing uncached cluster handler attributes: ['on_off'] - from cache[False] 2023-10-10 19:19:31.235 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0xBC21:1:0x0006]: Reading attributes in chunks: ['on_off'] 2023-10-10 19:19:31.235 DEBUG (MainThread) [zigpy.zcl] [0xBC21:1:0x0006] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=Custom quirk
Custom quirk
```python [Paste your custom quirk here] ```Additional information
Relevant __init__.py section for Inovelli VZM31-SN Cluster
```python class Inovelli_VZM31SN_Cluster(CustomCluster): """Inovelli VZM31-SN custom cluster.""" cluster_id = 0xFC31 name = "InovelliVZM31SNCluster" ep_attribute = "inovelli_vzm31sn_cluster" attributes = ManufacturerSpecificCluster.attributes.copy() attributes.update( { 0x0001: ("dimming_speed_up_remote", t.uint8_t, True), 0x0002: ("dimming_speed_up_local", t.uint8_t, True), 0x0003: ("ramp_rate_off_to_on_local", t.uint8_t, True), 0x0004: ("ramp_rate_off_to_on_remote", t.uint8_t, True), 0x0005: ("dimming_speed_down_remote", t.uint8_t, True), 0x0006: ("dimming_speed_down_local", t.uint8_t, True), 0x0007: ("ramp_rate_on_to_off_local", t.uint8_t, True), 0x0008: ("ramp_rate_on_to_off_remote", t.uint8_t, True), 0x0009: ("minimum_level", t.uint8_t, True), 0x000A: ("maximum_level", t.uint8_t, True), 0x000B: ("invert_switch", t.Bool, True), 0x000C: ("auto_off_timer", t.uint16_t, True), 0x000D: ("default_level_local", t.uint8_t, True), 0x000E: ("default_level_remote", t.uint8_t, True), 0x000F: ("state_after_power_restored", t.uint8_t, True), 0x0010: ("disable_remote_control", t.uint8_t, True), 0x0011: ("load_level_indicator_timeout", t.uint8_t, True), 0x0012: ("active_power_reports", t.uint8_t, True), 0x0013: ("periodic_power_and_energy_reports", t.uint8_t, True), 0x0014: ("active_energy_reports", t.uint16_t, True), 0x0015: ("power_type", t.uint8_t, True), 0x0016: ("switch_type", t.uint8_t, True), 0x0019: ("increased_non_neutral_output", t.Bool, True), 0x0032: ("button_delay", t.uint8_t, True), 0x0033: ("device_bind_number", t.uint8_t, True), 0x0034: ("smart_bulb_mode", t.Bool, True), 0x0035: ("double_tap_up_enabled", t.Bool, True), 0x0036: ("double_tap_down_enabled", t.Bool, True), 0x0037: ("double_tap_up_level", t.uint8_t, True), 0x0038: ("double_tap_down_level", t.uint8_t, True), 0x003C: ("default_led1_strip_color_when_on", t.uint8_t, True), 0x003D: ("default_led1_strip_color_when_off", t.uint8_t, True), 0x003E: ("default_led1_strip_intensity_when_on", t.uint8_t, True), 0x003F: ("default_led1_strip_intensity_when_off", t.uint8_t, True), 0x0041: ("default_led2_strip_color_when_on", t.uint8_t, True), 0x0042: ("default_led2_strip_color_when_off", t.uint8_t, True), 0x0043: ("default_led2_strip_intensity_when_on", t.uint8_t, True), 0x0044: ("default_led2_strip_intensity_when_off", t.uint8_t, True), 0x0046: ("default_led3_strip_color_when_on", t.uint8_t, True), 0x0047: ("default_led3_strip_color_when_off", t.uint8_t, True), 0x0048: ("default_led3_strip_intensity_when_on", t.uint8_t, True), 0x0049: ("default_led3_strip_intensity_when_off", t.uint8_t, True), 0x004B: ("default_led4_strip_color_when_on", t.uint8_t, True), 0x004C: ("default_led4_strip_color_when_off", t.uint8_t, True), 0x004D: ("default_led4_strip_intensity_when_on", t.uint8_t, True), 0x004E: ("default_led4_strip_intensity_when_off", t.uint8_t, True), 0x0050: ("default_led5_strip_color_when_on", t.uint8_t, True), 0x0051: ("default_led5_strip_color_when_off", t.uint8_t, True), 0x0052: ("default_led5_strip_intensity_when_on", t.uint8_t, True), 0x0053: ("default_led5_strip_intensity_when_off", t.uint8_t, True), 0x0055: ("default_led6_strip_color_when_on", t.uint8_t, True), 0x0056: ("default_led6_strip_color_when_off", t.uint8_t, True), 0x0057: ("default_led6_strip_intensity_when_on", t.uint8_t, True), 0x0058: ("default_led6_strip_intensity_when_off", t.uint8_t, True), 0x005A: ("default_led7_strip_color_when_on", t.uint8_t, True), 0x005B: ("default_led7_strip_color_when_off", t.uint8_t, True), 0x005C: ("default_led7_strip_intensity_when_on", t.uint8_t, True), 0x005D: ("default_led7_strip_intensity_when_off", t.uint8_t, True), 0x005F: ("led_color_when_on", t.uint8_t, True), 0x0060: ("led_color_when_off", t.uint8_t, True), 0x0061: ("led_intensity_when_on", t.uint8_t, True), 0x0062: ("led_intensity_when_off", t.uint8_t, True), 0x0064: ("led_scaling_mode", t.Bool, True), 0x007B: ("aux_switch_scenes", t.Bool, True), 0x007D: ("binding_off_to_on_sync_level", t.Bool, True), 0x0100: ("local_protection", t.Bool, True), 0x0101: ("remote_protection", t.Bool, True), 0x0102: ("output_mode", t.Bool, True), 0x0103: ("on_off_led_mode", t.Bool, True), 0x0104: ("firmware_progress_led", t.Bool, True), 0x0105: ("relay_click_in_on_off_mode", t.Bool, True), 0x0106: ("disable_clear_notifications_double_tap", t.Bool, True), } ) ```Relevant __init__.py section for Inovelli VZM35-SN Cluster
```python VZM35SN_REMOVES = [ 0x0012, 0x0013, 0x0014, 0x0019, 0x0034, 0x0064, 0x007D, 0x0105, ] class Inovelli_VZM35SN_Cluster(Inovelli_VZM31SN_Cluster): """Inovelli VZM35-SN custom cluster.""" attributes = { key: Inovelli_VZM31SN_Cluster.attributes[key] for key in Inovelli_VZM31SN_Cluster.attributes if key not in VZM35SN_REMOVES } attributes.update( { 0x0017: ("quick_start_time", t.uint8_t, True), 0x001E: ("non_neutral_aux_med_gear_learn_value", t.uint8_t, True), 0x001F: ("non_neutral_aux_low_gear_learn_value", t.uint8_t, True), 0x0034: ("smart_fan_mode", t.Bool, True), 0x0106: ("smart_fan_led_display_levels", t.uint8_t, True), } ) ```You can see from the device page that the entities are created for the attributes prior to active_power_reports, but anything after is never created due to the validation failing for that attribute -![image](https://github.com/zigpy/zha-device-handlers/assets/49957005/e8bb93d8-c099-46a3-9025-6766dc3b0ece)