ptvoinfo / zigbee-configurable-firmware

PTVO firmware for CC2530, CC2531, and CC2652 Zigbee chips
https://ptvo.info/zigbee-configurable-firmware-features/
MIT License
210 stars 22 forks source link

Autogenerated ZHA quirk need modification #279

Closed bullar closed 2 months ago

bullar commented 6 months ago

I used the provided UART sensor example:

Screenshot 2024-05-05 at 15 46 25

The integration into Home Assistant based on the auto-generated ZHA quirk only works with the following modifications:

[+ = original / - = modified]

--- /Volumes/config/custom_zha_quirks/ptvo_dirb_uart.py
+++ /Users/rolfbulla/Desktop/ptvo_dirb_uart_orig.py
@@ -12,7 +12,6 @@
 from zigpy.zcl.clusters.general import LevelControl
 from zigpy.zcl.clusters.lightlink import LightLink
 from zigpy.zcl.clusters.general import MultistateInput
-from zigpy.zcl.clusters.general import MultistateValue
 from zigpy.zcl.clusters.general import OnOffConfiguration

@@ -316,8 +315,8 @@
             # output_clusters=[0, 18, 6]>
             1: {
                 PROFILE_ID: zha.PROFILE_ID,
-                DEVICE_TYPE: PTVO_DEVICE_TYPE_GENERIC, #PTVO_DEVICE_TYPE_REMOTE_CONTROL,
-                INPUT_CLUSTERS: [Basic.cluster_id, MultistateValue.cluster_id, OnOffConfiguration.cluster_id],
+                DEVICE_TYPE: PTVO_DEVICE_TYPE_REMOTE_CONTROL,
+                INPUT_CLUSTERS: [Basic.cluster_id, OnOffConfiguration.cluster_id],
                 OUTPUT_CLUSTERS: [Basic.cluster_id, PtvoMultistateInput.cluster_id, OnOff.cluster_id],
             },
             # <SimpleDescriptor endpoint=2 profile=260 device_type=65535
@@ -325,7 +324,7 @@
             # output_clusters=[6]>
             2: {
                 PROFILE_ID: zha.PROFILE_ID,
-                DEVICE_TYPE: PTVO_DEVICE_TYPE_GENERIC, #PTVO_DEVICE_TYPE_ON_OFF_OUTPUT,
+                DEVICE_TYPE: PTVO_DEVICE_TYPE_ON_OFF_OUTPUT,
                 INPUT_CLUSTERS: [OnOff.cluster_id],
                 OUTPUT_CLUSTERS: [OnOff.cluster_id],
             },
@@ -343,7 +342,7 @@
             # output_clusters=[6]>
             4: {
                 PROFILE_ID: zha.PROFILE_ID,
-                DEVICE_TYPE: PTVO_DEVICE_TYPE_GENERIC, #PTVO_DEVICE_TYPE_LEVEL_CONTROLLABLE_OUTPUT,
+                DEVICE_TYPE: PTVO_DEVICE_TYPE_LEVEL_CONTROLLABLE_OUTPUT,
                 INPUT_CLUSTERS: [OnOff.cluster_id, AnalogInput.cluster_id, LevelControl.cluster_id],
                 OUTPUT_CLUSTERS: [OnOff.cluster_id],
             },
@@ -384,7 +383,7 @@
                 PROFILE_ID: zha.PROFILE_ID,
                 DEVICE_TYPE: zha.DeviceType.DIMMABLE_LIGHT,
                 INPUT_CLUSTERS: [OnOff.cluster_id, LevelControl, LightLink],
-                OUTPUT_CLUSTERS: [OnOff.cluster_id],
+                OUTPUT_CLUSTERS: [],