Skip to content

Make Bosch RM230Z HA climate modes configurable#12498

Merged
Koenkk merged 1 commit into
Koenkk:masterfrom
MaxRink:bosch-rm230z-heating-only-ha
Jun 25, 2026
Merged

Make Bosch RM230Z HA climate modes configurable#12498
Koenkk merged 1 commit into
Koenkk:masterfrom
MaxRink:bosch-rm230z-heating-only-ha

Conversation

@MaxRink

@MaxRink MaxRink commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a homeassistant_climate_modes device option for Bosch Room thermostat II 230V.
  • Default Home Assistant climate discovery to heating-only modes (off, heat, auto) for normal RM230Z radiator/floor-heating installs.
  • Allow explicit cool or heat_cool discovery only when the installation really supports cooling, e.g. a heat-pump setup.
  • Use the readable option label Home Assistant climate modes in Zigbee2MQTT settings.

Dependency

Review feedback addressed

  • Cooling is no longer exposed unconditionally.
  • The default is now heating-only, while the optional override covers installations where this thermostat is paired with equipment that can cool.
  • The option is generic for HA discovery only; it does not change the actual Zigbee thermostat system mode support.
  • The shared hook typing was split into Type HA discovery override options #12526 instead of being bundled into this device-specific PR.

Validation

  • pnpm run build
  • pnpm run check
  • pnpm test (19 files, 615 tests)
  • pnpm test test/bosch.test.ts
  • git diff --check

Live validation on my Home Assistant instance

  • Deployed the built dist/devices/bosch.js and dist/lib/exposes.js to the Zigbee2MQTT add-on and restarted the add-on.
  • Verified all five live Bosch RM230Z devices now advertise the homeassistant_climate_modes option under definition.options in zigbee2mqtt/bridge/devices: Bad Thermostat, Schlafzimmer Thermostat, Arbeitszimmer Thermostat, Wohnzimmer Thermostat Flur, Wohnzimmer Thermostat Küche.
  • Verified Home Assistant exposes all five live climate entities with hvac_modes: ["off", "heat", "auto"] by default.
  • Revalidated Arbeitszimmer Thermostat through zigbee2mqtt/bridge/request/device/options:
    • homeassistant_climate_modes: cool -> retained HA discovery modes: ["off", "cool", "auto"].
    • homeassistant_climate_modes: heat_cool -> retained HA discovery modes: ["off", "heat", "cool", "auto"].
    • Reverted to heat -> retained HA discovery modes: ["off", "heat", "auto"] and the bridge device payload returned to no custom persisted options.

@MaxRink

MaxRink commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by the current live validation notes in the PR description.

@MaxRink MaxRink force-pushed the bosch-rm230z-heating-only-ha branch from 7f8e3e7 to 9bcda6f Compare June 22, 2026 10:12
@MaxRink MaxRink changed the title Hide Bosch RM230Z cooling mode from Home Assistant Make Bosch RM230Z HA cooling optional Jun 22, 2026
@Koenkk

Koenkk commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Expose cooling mode in Home Assistant climate discovery. Disabled by default because this model is a heating-only thermostat.

I don't understand why an option is introduced to expose the unsupported cooling mode?

@MaxRink

MaxRink commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

I should reword: its unsupported in my (and most installs) but if paied with a heatpump that can cool and proper additional setup around this its a valid operating mode 😓

@MaxRink MaxRink force-pushed the bosch-rm230z-heating-only-ha branch from 9bcda6f to ade11c4 Compare June 22, 2026 19:44
@MaxRink MaxRink changed the title Make Bosch RM230Z HA cooling optional Hide Bosch RM230Z HA cooling mode Jun 22, 2026
@MaxRink MaxRink force-pushed the bosch-rm230z-heating-only-ha branch from ade11c4 to a86daf6 Compare June 22, 2026 23:02
@MaxRink MaxRink changed the title Hide Bosch RM230Z HA cooling mode Make Bosch RM230Z HA climate modes configurable Jun 22, 2026
@MaxRink

MaxRink commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

Updated this based on the feedback: cooling is no longer exposed by default. The RM230Z now discovers as heating-only in HA (off, heat, auto) unless the user explicitly sets the new homeassistant_climate_modes option to cool or heat_cool for installations where the thermostat is actually paired with cooling-capable equipment.

@TheMagnetar

Copy link
Copy Markdown
Contributor

I am not sure why this is necessary. Cannot this be done entirely in HA instead of bringing specific HA code in here?

@MaxRink

MaxRink commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

Home Assistant cannot cleanly remove or rewrite the MQTT climate modes list after discovery has been generated. A user could build a separate template climate or hide/replace the entity locally, but the original MQTT climate entity would still be discovered with the unsupported mode list.

The problem is generated by the Zigbee2MQTT HA discovery payload, so this keeps the default payload accurate for the common heating-only RM230Z install while still allowing cool / heat_cool only for installs that explicitly configure that support. The option only changes HA discovery; it does not change the raw Zigbee thermostat expose or ZCL behavior.

@MaxRink

MaxRink commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

I split the Zigbee2MQTT-side option plumbing into its own granular PR: Koenkk/zigbee2mqtt#32379.

That PR passes entity.options into overrideHaDiscoveryPayload, which is what makes this converter option actually affect HA discovery on current Zigbee2MQTT dev. I also live-tested the full path on my Home Assistant instance by temporarily setting one RM230Z from heat to heat_cool, verifying retained HA discovery switched to ["off", "heat", "cool", "auto"], then reverting it to heat and verifying it returned to ["off", "heat", "auto"].

@MaxRink MaxRink force-pushed the bosch-rm230z-heating-only-ha branch from a86daf6 to 6b1d9b0 Compare June 23, 2026 06:17
@MaxRink MaxRink marked this pull request as draft June 23, 2026 10:44
@MaxRink MaxRink force-pushed the bosch-rm230z-heating-only-ha branch from 6b1d9b0 to d851f2b Compare June 23, 2026 13:43
@MaxRink MaxRink marked this pull request as ready for review June 23, 2026 13:47
@MaxRink MaxRink marked this pull request as draft June 23, 2026 13:52
@MaxRink MaxRink marked this pull request as ready for review June 23, 2026 15:31
@Koenkk

Koenkk commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Could you fix the merge conflicts?

@MaxRink MaxRink force-pushed the bosch-rm230z-heating-only-ha branch from d851f2b to bbb4f54 Compare June 23, 2026 18:26
@MaxRink

MaxRink commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

done

@MaxRink MaxRink force-pushed the bosch-rm230z-heating-only-ha branch from bbb4f54 to 7479a60 Compare June 25, 2026 17:05
@Koenkk

Koenkk commented Jun 25, 2026

Copy link
Copy Markdown
Owner

thanks!

@Koenkk Koenkk merged commit 7c78731 into Koenkk:master Jun 25, 2026
3 checks passed
@burmistrzak

Copy link
Copy Markdown
Contributor

@MaxRink Good job! 👏
I was planning to implement this myself over the summer, but haven't had a chance to do so...

Your improvements to overrideHaDiscoveryPayload are very much appreciated and make the entire thing more useful. 💪

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.

4 participants