Skip to content

Conversation

@0anton
Copy link

@0anton 0anton commented Nov 2, 2025

Adds support for _TZE204_u9bfwha0 Moes BHT-006GBZB electric floor heating thermostat. This variant uses a single mode attribute
instead of separate manual/schedule attributes and includes endpoint 242 with GreenPowerProxy support.

It builds on contribution created in #2627 and follows the successful support
of the same device in z2m with Koenkk/zigbee-herdsman-converters#6369.

Proposed change

This PR adds support for the Tuya electric floor heating thermostat _TZE204_u9bfwha0 (Moes BHT-006GBZB model TS0601) to
zhaquirks/tuya/ts0601_electric_heating.py.

Implementation details:

The quirk includes four new classes:

  • MoesBHT6ManufCluster - Manufacturer-specific cluster with custom command handling for on/off operations via command_bus
  • MoesBHT6Thermostat - Thermostat cluster that maps ZCL attributes to Tuya-specific values
  • MoesBHT6UserInterface - User interface cluster for child lock functionality
  • MoesBHT6 - Main device quirk with signature matching for _TZE204_u9bfwha0

Key differences from existing MoesBHT quirk:

  • Uses a single mode attribute (0x0402) for manual/scheduled mode instead of separate manual_mode/schedule_mode attributes
  • Includes endpoint 242 with GreenPowerProxy cluster support
  • Implements custom command() method for on/off operations routed through command_bus
  • Separate event handling for running_mode and running_state attributes

Supported features:

  • Temperature setpoint control (occupied_heating_setpoint)
  • Current temperature reporting (local_temperature)
  • System mode (Off/Heat)
  • Programming operation mode (Manual/Schedule)
  • Running state detection (Idle/Heating)
  • Child lock functionality

Additional information

Fixes #2627

This implementation is based on the successful integration in zigbee2mqtt:
Koenkk/zigbee-herdsman-converters#6369

The device signature shows it presents as a Smart Plug (device_type=81) but is replaced with a Thermostat device type in the quirk
replacement configuration.

Device diagnostics are attached from the original issue report for the _TZE200_u9bfwha0 variant (TZE200 vs TZE204 are typically
firmware variations of the same hardware).

Device diagnostics

zha-01JWS5EQDD5DRF54AD0BCKK3M1-_TZE200_u9bfwha0 TS0601-98e0276de7d342b7d929f0ada449640c.json

Checklist

  • The changes are tested and work correctly
  • pre-commit checks pass / the code has been formatted using Black
  • Tests have been added to verify that the new code works
  • Device diagnostics data has been attached

Adds support for _TZE204_u9bfwha0 Moes BHT-006GBZB electric floor heating thermostat. This variant uses a single mode attribute instead of separate manual/schedule attributes and includes endpoint 242 with GreenPowerProxy support.
Apply ruff formatting and fix linting issues:
- Merge multiple attribute comparisons using tuple membership
- Fix docstring to use imperative mood
- Alphabetize imports
@codecov
Copy link

codecov bot commented Nov 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.32%. Comparing base (aa7b32d) to head (2c8fef5).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #4461      +/-   ##
==========================================
+ Coverage   92.24%   92.32%   +0.08%     
==========================================
  Files         369      369              
  Lines       12088    12181      +93     
==========================================
+ Hits        11150    11246      +96     
+ Misses        938      935       -3     

☔ 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.

Add test coverage for the new MoesBHT6 quirk including:
- Temperature and target temperature reporting
- Mode reporting (manual/scheduled)
- System mode reporting (on/off)
- Running state reporting (heating/idle)
- Attribute writing (setpoint, system mode, programming mode)

These tests follow the same pattern as existing MoesBHT tests and should
significantly improve code coverage for the new quirk.
Add test coverage for the custom command() method in MoesBHT6ManufCluster
that handles on/off commands. This improves coverage from 70% to 73%.
Adds 6 new test functions to improve coverage from 73% to 82%:
- Setpoint rounding with various boundary values (half-steps, extremes)
- Error handling for unsupported system modes (Cool, Auto)
- Error handling for unsupported programming modes
- Error handling for unsupported running states (Cool_State_On)
- Error handling for unsupported running modes (Cool)
- Program change with various mode strings

All error branches now exercised and verified to log errors correctly.
Test child lock on/off reporting through UI cluster to improve
coverage to 83%. Verifies child_lock attribute updates correctly.
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.

TZE204_u9bfwha0 TS0601[Device Support Request]

2 participants