Skip to content

vNext: Climate: skip devices without modes, offer only what the unit has - #549

Merged
RobHofmann merged 1 commit into
RobHofmann:5.0-devfrom
Twintop:fix-climate-unsupported-features
Oct 9, 2026
Merged

RobHofmann merged 1 commit into
RobHofmann:5.0-devfrom
Twintop:fix-climate-unsupported-features

Conversation

@Twintop

@Twintop Twintop commented Oct 9, 2026

Copy link
Copy Markdown

Context

This is a bug fix and a small behavior change in preparation for Gree zone controller support. I found it while porting the changes I made for my own zone controller (Gree LE60-13/GH) to this project. The ducted unit behind a zone controller has no target temperature and no swing, and the climate entity offered both. The zone controller support itself will come in a later PR. Background and the full plan: https://github.com/Twintop/ha-gree-zone-controller/blob/main/upstream/README.md

Symptoms

  1. If one device has an empty HVAC mode list (for example cleared in its options), the climate setup returns. No climate entity is created for that device, and none for any device after it in the entry.
  2. A unit without a target temperature (no SetTem) still gets one in its climate entity when Heat, Cool or Auto is in the mode list. It shows 0, and a change only logs Property SetTem is unsupported on this device. Seen on the ducted unit of a LE60-13/GH zone controller.
  3. A unit without swing still gets swing modes. The options form leaves the swing lists out when the unit has no swing, and the climate entity then falls back to DEFAULT_SWING_MODES and DEFAULT_SWING_HORIZONTAL_MODES. Seen on the same unit, which listed vertical and horizontal swing modes.

Change

  1. continue instead of return in async_setup_entry() of the climate platform.
  2. ClimateEntityFeature.TARGET_TEMPERATURE is only added when the unit supports SetTem.
  3. SWING_MODE and SWING_HORIZONTAL_MODE are only added when the unit supports SwUpDn and SwingLfRig.
  4. docs/entities.md says when the target temperature and the swing modes are shown.

Units that have these features behave as before. Units without them no longer show controls that do nothing. The state restore already checks for a missing swing list, so it needs no change.

Testing

  • The test suite does not cover the entities. pytest: 254 passed, as before.
  • Ruff passes. Mypy and Pylint show nothing new compared with 5.0-dev. I ran them without Home Assistant installed, so I compared the findings with the base branch.
  • Real device, the ducted unit of a LE60-13/GH zone controller on Home Assistant 2026.10: before the change, its climate entity listed swing modes. With the change, it has no swing modes and no target temperature, and HVAC mode and fan mode work as before.
  • Symptom 1 comes from reading the code. I did not set up a device with an empty mode list.

- A device without HVAC modes made the climate setup return, so no climate
  entity was created for any device after it. It now skips that device.
- The target temperature was offered whenever Heat, Cool or Auto was in the
  mode list, also on a unit that has no SetTem (seen: the ducted unit of a
  Gree zone controller). It showed 0 and did nothing. It is now offered only
  when the unit has a target temperature.
- The options form leaves the swing lists out for a unit without swing, and
  the climate entity then used the default lists and offered swing anyway.
  Swing is now offered only when the unit has it.

Units that have these features are not affected.
@Twintop Twintop changed the title Climate: skip devices without modes, offer only what the unit has vNext: Climate: skip devices without modes, offer only what the unit has Oct 9, 2026
@p-monteiro

Copy link
Copy Markdown
Contributor

I'll hijack this PR for commenting on all
They all look good. Thanks for the contribution

About the full plan:

  • One thing that I think is of value is to extend the "zone_memory" behaviour to all devices that support target temperature, not only zones. Seems like it is a nice feature for all to have, to recall the target temperature by active mode. For ac_units/vrf_units they can read the mode from themselves, and for zones from the zone_controller as in the plan.
  • It might be worth thinking about extending ZoneRole to be something like DeviceType to allow all the devices to have a type (ac_unit, vrf_unit, zone_controller, zone) and do logic based on that. Can be useful in the future.

@RobHofmann
RobHofmann merged commit 3e4afff into RobHofmann:5.0-dev Oct 9, 2026
3 of 4 checks passed
RobHofmann added a commit that referenced this pull request Oct 9, 2026
Lint installed ruff>=0.16.3, so CI picked up Ruff 0.17.0 the day it came
out. 0.17 sorts an import with a trailing pragma comment differently, and
const.py failed I001 on every push and PR since #547. None of #547, #548
or #549 touched const.py.

0.16.10 and 0.17.0 want opposite forms of that import, so no code passes
both. Pin Ruff to an exact version in lint.yml and requirements_dev.txt
so a new release cannot break CI again, and apply the 0.17 fix.
Twintop added a commit to Twintop/HomeAssistant-GreeClimateComponent that referenced this pull request Oct 10, 2026
ZoneRole only knew the sub-units of a zone controller. It is now DeviceType
and every device gets one after the info fetch: ac_unit (a standalone
unit), vrf_unit (an indoor unit behind a VRF gateway), zone_controller (the
ducted unit, sub-unit 00 of a zone controller) and zone. Only the two zone
controller types change behaviour, so standalone and VRF units work as
before. The type is in the device diagnostics. Suggested by @p-monteiro in
RobHofmann#549.

The controller device of a zone controller was labelled "VRF gateway". It
is now "Zone controller", taken from the type of a bound sub-unit. With no
bound sub-unit the registry keeps what it has. The lookup moved into a
small helper, so reconcile_vrf_controllers stays simple.
Twintop added a commit to Twintop/HomeAssistant-GreeClimateComponent that referenced this pull request Oct 10, 2026
The zones of a zone controller remember their target temperature per mode,
as the wall panel does. Standalone and VRF units can now do the same, as an
opt-in device option, "Remember Target Temperature per Mode"
(setpoint_memory, off by default). Suggested by @p-monteiro in RobHofmann#549.

- GreeDevice.target_temperature_props also gives SetTem and TemRec for a
  standalone or VRF unit. Raw columns are stored, so a unit set to
  Fahrenheit needs no conversion.
- The unit learns from its own polls: mode and target come in one reply.
- On a mode change from Home Assistant, SetpointMemory.apply() sets the
  stored target of the new mode without sending it, so it goes out in the
  same command as the mode. Nothing is recalled into Auto, where the unit
  ignores the target temperature.
- The option is in the device options form for units with a target
  temperature, and in the YAML schema.

Tested against fakes. This project has no standalone or VRF unit to try it
on.
Twintop added a commit to Twintop/HomeAssistant-GreeClimateComponent that referenced this pull request Oct 10, 2026
The zones of a zone controller remember their target temperature per mode,
as the wall panel does. Standalone and VRF units can now do the same, as an
opt-in device option, "Remember Target Temperature per Mode"
(setpoint_memory, off by default). Suggested by @p-monteiro in RobHofmann#549.

- GreeDevice.target_temperature_props also gives SetTem and TemRec for a
  standalone or VRF unit. Raw columns are stored, so a unit set to
  Fahrenheit needs no conversion.
- The unit learns from its own polls: mode and target come in one reply.
- On a mode change from Home Assistant, SetpointMemory.apply() sets the
  stored target of the new mode without sending it, so it goes out in the
  same command as the mode. Nothing is recalled into Auto, where the unit
  ignores the target temperature.
- The option is in the device options form for units with a target
  temperature, and in the YAML schema.

Tested against fakes. This project has no standalone or VRF unit to try it
on.
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