Zigbee device shows attributes but no controls in HA

I’m probably using all the wrong terms - just learning - but here goes…
I have a SkyConnect dongle on my RPi4 running HA and ZHA. All OK so far.
I have created my own Zigbee end device (based on an ESP32-H2) and using the Espressif ‘HA On-Off Light’ example I can connect to the HA, have it create a device that automatically has a switch displayed. Toggling the switch I can turn the LED on the ESP32-H2 dev kit board on and off.
I then extended the code to create another end device that has (only) an ‘Analog Input’ cluster in it. I can see the end device as an ‘attribute’ under the ‘Manage Device’ display and I can read the attribute value.
However I have no idea how to get the device to show a text box (or whatever) that will automatically show the attribute value (especially as it is updated within the device).
Questions:

  1. Am I missing something in the end device configuration that will tell the ZHA what to display automatically?
  2. What do I need to do on the HA side to properly understand the ‘analog input’ cluster values?
    Susan

No Zigbee/ZHA guru’s out there???
Susan

I think I need to create a ‘quirk’ for my device but I’m not having any luck with that.
In my ‘configuration.yaml’ file I have

zha:
  enable_quirks: true
  custom_quirks_path: /config/custom_zha_quirks/
  database_path: /config/zigbee.db

In the ‘custom_zha_quirks’ folder I’ve created a file called 'weather2_quirk.py" that contains:

""" Custom quirk for the ConMac Weather2 zigbee device"""
from zigpy.profiles import zha

from zigpy.quirks import CustomDevice

from zhaquirks.const import 
{
    DEVICE_TYPE,
    ENDPOINTS,
    INPUT_CLUSTERS,
    OUTPUT_CLUSTERS,
    PROFILE_ID,
}

from zigpy.zcl.clusters.general import
{
    AnalogInput,
    AnalogOutput,
    Basic,
    OnOff,
}

class ConMacWeather2( CustomDevice):
    
    def __init__(self. *args, **kwargs):
        """Init,"""
        super().__init__(*args, **kwargs)
    
    signature = {
        MODELS_INFO: [("Weather2", "manuforte.org")],
        ENDPOINTS: {
            # < SimpleDescriptor endpoint=2 profile=0x0104 device_type=0xfff0
            # device_version=1
            # input_clusters=[0,12]
            # output_clusters=[13]>
            2: {
                PROFILE_ID: 0x0104,
                DEVICE_TYPE: 0xfff0,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    AnalogInput.cluster_id,
                ],
                OUTPUT_CLUSTERS: [
                    AnalogOutput.cluster_id,
                ],
            },
        },
    }
    replacement = {
        SKIP_CONFIGURATION: True,
        ENDPOINTS: {
            2: {
                PROFILE_ID: 0x0104,
                DEVICE_TYPE: 0xfff0,
                INPUT_CLUSTERS: [
                    BasicCluster,
                    OnOff.cluster_id,
                    AnalogInput.cluster_id,
                ],
                OUTPUT_CLUSTERS: [
                    AnalogOutput.cluster_id,
                ],
            },
        "manufacturer": "ConMac",
    }

When I try to connect my device to ZHA, in the log I get:

[0x787c] Read model 'Weather2' and manufacturer 'ConMac' from <Endpoint id=2 in=[basic:0x0000, analog_input:0x000C] out=[analog_output:0x000D] status=<Status.ZDO_INIT: 1>>
[0x787c] Discovered basic device information for <Device model='Weather2' manuf='ConMac' nwk=0x787C ieee=xx:xx:xx:xx:xx:xx is_initialized=True>
Device is initialized <Device model='Weather2' manuf='ConMac' nwk=0x787C ieee=xx:xx:xx:xx:xx:xx is_initialized=True>
Checking quirks for ConMac Weather2 (xx:xx:xx:xx:xx:xx)
Considering <class 'zhaquirks.xiaomi.aqara.opple_switch.XiaomiOpple2ButtonSwitchFace2'>
Fail because endpoint list mismatch: {1, 2, 242} {2}
Considering <class 'zhaquirks.xiaomi.aqara.opple_switch.XiaomiOpple2ButtonSwitchFace1'>
Fail because endpoint list mismatch: {1, 2, 41, 42, 242, 51, 21, 31} {2}
Considering <class 'zhaquirks.xbee.xbee_io.XBeeSensor'>
Fail because endpoint list mismatch: {232, 230} {2}
Considering <class 'zhaquirks.xbee.xbee3_io.XBee3Sensor'>
Fail because endpoint list mismatch: {232, 230} {2}
Considering <class 'zhaquirks.tuya.ts0201.MoesTemperatureHumidtySensorWithScreen'>
Fail because endpoint list mismatch: {1} {2}
Considering <class 'zhaquirks.smartthings.tag_v4.SmartThingsTagV4'>
Fail because endpoint list mismatch: {1} {2}
Considering <class 'zhaquirks.smartthings.multi.SmartthingsMultiPurposeSensor'>
Fail because endpoint list mismatch: {1} {2}
Considering <class 'zhaquirks.netvox.z308e3ed.Z308E3ED'>
Fail because endpoint list mismatch: {1} {2}
Considering <class 'zhaquirks.gledopto.soposhgu10.SoposhGU10'>
Fail because endpoint list mismatch: {11, 13} {2}
Creating cluster handler for cluster id: 0 class: <class 'homeassistant.components.zha.core.cluster_handlers.general.BasicClusterHandler'>
Creating cluster handler for cluster id: 12 class: <class 'homeassistant.components.zha.core.cluster_handlers.general.AnalogInput'>
Discovering entities for endpoint: 48:31:b7:ff:fe:c0:71:27-2
'sensor' component -> 'RSSISensor' using ['basic']
'sensor' component -> 'LQISensor' using ['basic']

which seems to totally ignore my quirk.
After the device has connected to ZHA, the signature is:

{
  "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.MainsPowered|RxOnWhenIdle|AllocateAddress: 140>, manufacturer_code=4660, maximum_buffer_size=108, maximum_incoming_transfer_size=0, server_mask=11264, maximum_outgoing_transfer_size=0, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=False, *is_security_capable=False)",
  "endpoints": {
    "2": {
      "profile_id": "0x0104",
      "device_type": "0xfff0",
      "input_clusters": [
        "0x0000",
        "0x000c"
      ],
      "output_clusters": [
        "0x000d"
      ]
    }
  },
  "manufacturer": "ConMac",
  "model": "Weather2",
  "class": "zigpy.device.Device"
}

What have I done wrong? What am I missing?
Susan

Cross-posting reply from your cross-post → ZHA display of AnalogIn values

Assuming you already know that the ZHA integration will need a custom ZHA Device Handler (a.k.a. “quirk”) and perhaps even extend ZHA’s sensor or number code in Home Assistant’s core (zha component) if you want to expose clusters and attributes sensors or numbers as entities in the ZHA UI that are not considered standard or have not been previously added to the zha component, read and see:

https://www.home-assistant.io/integrations/zha#how-to-add-support-for-new-and-unsupported-devices

and

https://github.com/zigpy/zha-device-handlers/blob/aeca76da0ea81ecba5b17e0f7314620cd686faae/README.md

and

https://github.com/home-assistant/core/tree/dev/homeassistant/components/zha

Probably best if you post your questions to ZHA Device Handlers and/or zigpy’s repositories on GitHub for the attention of zigpy/zha/quirks developers to notice and discuss there (ZHA and zigpy developers usually don’t post in this community forum):

https://github.com/zigpy/zha-device-handlers/discussions

https://github.com/zigpy/zigpy

You could also try posting issues to esp-zigbee-sdk repo too for Espressif’s devs attention as well: