Skip to content
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

Improve Aqara H1 switch quirks #2520

Open
TheJulianJES opened this issue Aug 10, 2023 · 5 comments
Open

Improve Aqara H1 switch quirks #2520

TheJulianJES opened this issue Aug 10, 2023 · 5 comments
Labels
code quality Improvement to code quality enhancement Improve an existing quirk Xiaomi Request/PR regarding a Xiaomi device

Comments

@TheJulianJES
Copy link
Collaborator

TheJulianJES commented Aug 10, 2023

This is for tracking the eventual improvement/cleanup of the Aqara (H1) switch quirks:

  1. https://github.com/zigpy/zha-device-handlers/blob/dev/zhaquirks/xiaomi/aqara/opple_switch.py is missing MODELS_INFO
  2. Clean up where H1 quirks are stored (single/double rocker):
  3. Figure out proper naming / should T1 relay quirk be related: Add Aqara T1 relay (with neutral) support #2513 ?
  4. Possibly change ep_attribute from aqara_cluster to opple_cluster, as ZHA matches that for custom matches
  5. Expose custom switches/sensors for something like switch_type in ZHA?
  6. Clean up XiaomiMeteringCluster vs MeteringCluster

Related PRs:

Also take a look at:

@TheJulianJES TheJulianJES added the enhancement Improve an existing quirk label Aug 10, 2023
@TheJulianJES TheJulianJES added the code quality Improvement to code quality label Nov 9, 2023
@TheJulianJES
Copy link
Collaborator Author

Add quirk with energy/power/custom attributes support for: #2194 (comment)

We already have the two rocker one (lumi.switch.b2naus01).

@TheJulianJES
Copy link
Collaborator Author

This PR will address some of the issues above:

@TheJulianJES TheJulianJES added the Xiaomi Request/PR regarding a Xiaomi device label Dec 24, 2023
@zanglang
Copy link
Contributor

zanglang commented Apr 9, 2024

My b2naus01 doesn't seem to be reporting any power usage on Home Assistant 2024.04, and shows 0 for all energy metrics. Should there be yet another signatures added to opple_switch.py?

This is in contrast to the PR in #3101 that I was testing for b1naus01, which seems to at least reports the power usage in watts.

Signature:

{
  "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.FullFunctionDevice|MainsPowered|RxOnWhenIdle|AllocateAddress: 142>, manufacturer_code=4447, maximum_buffer_size=127, maximum_incoming_transfer_size=100, server_mask=11264, maximum_outgoing_transfer_size=100, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)",
  "endpoints": {
    "1": {
      "profile_id": "0x0104",
      "device_type": "0x0000",
      "input_clusters": [
        "0x0000",
        "0x0002",
        "0x0003",
        "0x0004",
        "0x0005",
        "0x0006",
        "0x0009",
        "0x0012",
        "0x0702",
        "0x0b04",
        "0xfcc0"
      ],
      "output_clusters": [
        "0x000a",
        "0x0019"
      ]
    },
    "2": {
      "profile_id": "0x0104",
      "device_type": "0x0000",
      "input_clusters": [
        "0x0000",
        "0x0003",
        "0x0004",
        "0x0005",
        "0x0006",
        "0x0012",
        "0xfcc0"
      ],
      "output_clusters": []
    },
    "21": {
      "profile_id": "0x0104",
      "device_type": "0x0100",
      "input_clusters": [
        "0x000c"
      ],
      "output_clusters": []
    },
    "31": {
      "profile_id": "0x0104",
      "device_type": "0x0100",
      "input_clusters": [
        "0x000c"
      ],
      "output_clusters": []
    },
    "41": {
      "profile_id": "0x0104",
      "device_type": "0x0100",
      "input_clusters": [
        "0x0012"
      ],
      "output_clusters": []
    },
    "42": {
      "profile_id": "0x0104",
      "device_type": "0x0100",
      "input_clusters": [
        "0x0012"
      ],
      "output_clusters": []
    },
    "51": {
      "profile_id": "0x0104",
      "device_type": "0x0100",
      "input_clusters": [
        "0x0012"
      ],
      "output_clusters": []
    },
    "61": {
      "profile_id": "0x0104",
      "device_type": "0x0100",
      "input_clusters": [
        "0x0012"
      ],
      "output_clusters": []
    },
    "242": {
      "profile_id": "0xa1e0",
      "device_type": "0x0061",
      "input_clusters": [],
      "output_clusters": [
        "0x0021"
      ]
    }
  },
  "manufacturer": "LUMI",
  "model": "lumi.switch.b2naus01",
  "class": "zhaquirks.xiaomi.aqara.opple_switch.XiaomiOpple2ButtonSwitch4"
}

@MichaelVoelkel
Copy link

For my Aqara power sensor it also only shows 0 for wattage/voltage etc. It at least shows that a consumer is connected.

{
  "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.FullFunctionDevice|MainsPowered|RxOnWhenIdle|AllocateAddress: 142>, manufacturer_code=4447, maximum_buffer_size=127, maximum_incoming_transfer_size=100, server_mask=11264, maximum_outgoing_transfer_size=100, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)",
  "endpoints": {
    "1": {
      "profile_id": "0x0104",
      "device_type": "0x0051",
      "input_clusters": [
        "0x0000",
        "0x0002",
        "0x0003",
        "0x0004",
        "0x0005",
        "0x0006",
        "0x0009",
        "0x0702",
        "0x0b04",
        "0xfcc0"
      ],
      "output_clusters": [
        "0x000a",
        "0x0019"
      ]
    },
    "21": {
      "profile_id": "0x0104",
      "device_type": "0x0051",
      "input_clusters": [
        "0x000c"
      ],
      "output_clusters": []
    },
    "242": {
      "profile_id": "0xa1e0",
      "device_type": "0x0061",
      "input_clusters": [],
      "output_clusters": [
        "0x0021"
      ]
    }
  },
  "manufacturer": "LUMI",
  "model": "lumi.plug.maeu01",
  "class": "zhaquirks.xiaomi.aqara.plug_eu.PlugMAEU01"
}

Version is 2024.04.03, no updates available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality Improvement to code quality enhancement Improve an existing quirk Xiaomi Request/PR regarding a Xiaomi device
Projects
None yet
Development

No branches or pull requests

3 participants