Skip to content

Add support for the Valve platform#673

Draft
puddly wants to merge 3 commits intozigpy:devfrom
puddly:puddly/valve-platform2
Draft

Add support for the Valve platform#673
puddly wants to merge 3 commits intozigpy:devfrom
puddly:puddly/valve-platform2

Conversation

@puddly
Copy link
Contributor

@puddly puddly commented Feb 23, 2026

This PR adds support for the Valve platform from Home Assistant.

This is a bit of a strange platform because the ZCL R8 spec does not actually support valves in any way. There are no clusters, there are no device types, nothing. So this functionality is again provided by an entity class relying on the existence of OnOff + (optional) LevelControl, accessible at the moment only with YAML platform overrides. It is a lower priority than the generic Switch entity and thus will never be discovered by default. This will be available for quirks to use in the near future.


level_cluster = zigpy_device.endpoints[1].level

with patch.object(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests are sort of auto-generated and will be rewritten later.

@codecov
Copy link

codecov bot commented Feb 23, 2026

Codecov Report

❌ Patch coverage is 87.58170% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.30%. Comparing base (a0d4782) to head (8663724).
⚠️ Report is 5 commits behind head on dev.

Files with missing lines Patch % Lines
zha/application/platforms/valve/__init__.py 85.92% 19 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #673      +/-   ##
==========================================
- Coverage   97.44%   97.30%   -0.14%     
==========================================
  Files          62       64       +2     
  Lines       10733    10883     +150     
==========================================
+ Hits        10459    10590     +131     
- Misses        274      293      +19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dmulcahey
Copy link
Contributor

I can provide diagnostic files for:

{
  "node_descriptor": {
    "logical_type": 2,
    "complex_descriptor_available": 0,
    "user_descriptor_available": 0,
    "reserved": 0,
    "aps_flags": 0,
    "frequency_band": 8,
    "mac_capability_flags": 128,
    "manufacturer_code": 4447,
    "maximum_buffer_size": 82,
    "maximum_incoming_transfer_size": 82,
    "server_mask": 11264,
    "maximum_outgoing_transfer_size": 82,
    "descriptor_capability_field": 0
  },
  "endpoints": {
    "1": {
      "profile_id": "0x0104",
      "device_type": "0x0000",
      "input_clusters": [
        "0x0000",
        "0x0001",
        "0x0003",
        "0x0006",
        "0xfcc0"
      ],
      "output_clusters": [
        "0x000a",
        "0x0019"
      ]
    }
  },
  "manufacturer": "Aqara",
  "model": "lumi.valve.agl001",
  "class": "zigpy.device.Device"
}

and

{
  "node_descriptor": {
    "logical_type": 2,
    "complex_descriptor_available": 0,
    "user_descriptor_available": 0,
    "reserved": 0,
    "aps_flags": 0,
    "frequency_band": 8,
    "mac_capability_flags": 128,
    "manufacturer_code": 4098,
    "maximum_buffer_size": 82,
    "maximum_incoming_transfer_size": 512,
    "server_mask": 11264,
    "maximum_outgoing_transfer_size": 512,
    "descriptor_capability_field": 0
  },
  "endpoints": {
    "1": {
      "profile_id": "0x0104",
      "device_type": "0x0100",
      "input_clusters": [
        "0x0000",
        "0x0004",
        "0x0005",
        "0x0006"
      ],
      "output_clusters": [
        "0x0019"
      ]
    }
  },
  "manufacturer": "_TYZB01_rifa0wlb",
  "model": "TS0011",
  "class": "zigpy.device.Device"
}

if they would be helpful.

@puddly
Copy link
Contributor Author

puddly commented Feb 24, 2026

Thanks! It looks like these are ON_OFF_SWITCH and ON_OFF_LIGHT, definitely valves 😅.

@Hedda
Copy link

Hedda commented Feb 25, 2026

This PR should close #528 (valve support feature request) however believe that matching device type support also needs to be added to the downstream zha component in Home Assistant’s core as well for valve entiry to be exposed in Home Assistant?

By the way, I think that this should also kind of similar to the new PRs by @TheJulianJES that add siren entity by adding basic siren device support for Zigbee devices which often rely on OnOff as well?

Also see related PR:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants