Skip to content

feat(atw): add extended ATW properties for Ecodan heat pumps#16

Open
RaHehl wants to merge 2 commits intoerwindouna:masterfrom
RaHehl:feature/atw-extended-properties
Open

feat(atw): add extended ATW properties for Ecodan heat pumps#16
RaHehl wants to merge 2 commits intoerwindouna:masterfrom
RaHehl:feature/atw-extended-properties

Conversation

@RaHehl
Copy link
Copy Markdown

@RaHehl RaHehl commented Apr 2, 2026

Summary

Adds ~20 missing ATW device properties that are available from the MELCloud API but were not exposed by pymelcloud. Also fixes two bugs and adds deprecation paths for breaking changes.

Tested against a real Mitsubishi PUD-SHWM120YAA + EHSD-YM9D Hydrobox (2-zone, heat-only, hot water tank).

New properties

System temperatures (on AtwDevice):

  • flow_temperature — system-level flow temperature
  • return_temperature — system-level return temperature
  • condensing_temperature

Zone-specific temperatures (on Zone):

  • zone_flow_temperature — per-zone flow temperature
  • zone_return_temperature — per-zone return temperature

Compressor & demand:

  • heat_pump_frequency — compressor frequency in Hz
  • demand_percentage — current demand (0–100%)

Component status (all bool):

  • boiler_status
  • booster_heater1_status, booster_heater2_status, booster_heater2plus_status
  • immersion_heater_status
  • water_pump1_status .. water_pump4_status
  • valve_3way_status, valve_2way_status

Daily energy (from ListDevices / device_conf):

  • daily_heating_energy_consumed / daily_heating_energy_produced
  • daily_cooling_energy_consumed / daily_cooling_energy_produced
  • daily_hot_water_energy_consumed / daily_hot_water_energy_produced

Bug fixes

  1. return_temperature_boiler was reading FlowTemperatureBoiler instead of ReturnTemperatureBoiler — fixed.
  2. PROPERTY_ZONE_*_COOL_FLOW_TEMPERATURE string values were "zone_X_target_heat_cool_temperature" (copy-paste from heat) — fixed to "zone_X_target_cool_flow_temperature".

Backwards compatibility

  • PROPERTY string rename: Old values ("zone_X_target_heat_cool_temperature") are preserved as deprecated aliases (PROPERTY_ZONE_1_TARGET_HEAT_COOL_TEMPERATURE, PROPERTY_ZONE_2_TARGET_HEAT_COOL_TEMPERATURE). apply_write() accepts both old and new string values.
  • Zone.flow_temperature / Zone.return_temperature: Deprecated with DeprecationWarning. These returned the system-level temperature, not zone-specific. Callers should migrate to device.flow_temperature (system) or zone.zone_flow_temperature (zone-specific). Return type changed from float to Optional[float] with .get() to prevent KeyError.

Test coverage

  • All 3 existing test scenarios (1-zone, 2-zone, 2-zone-cancool) extended with assertions for all new properties (before and after update())
  • New test: test_apply_write_old_cool_flow_property_strings — verifies backwards compat of old property strings
  • New test: test_zone_flow_return_temperature_deprecation — verifies DeprecationWarning is emitted
  • 12/12 tests pass, coverage 61% (above 55% threshold)

- Add system/zone temperatures, compressor, component status, daily energy
- Fix return_temperature_boiler reading wrong API field
- Fix PROPERTY_ZONE_*_COOL_FLOW string values with backwards compat
- Deprecate Zone.flow/return_temperature
Copilot AI review requested due to automatic review settings April 2, 2026 12:55
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds extended Air-To-Water (ATW) property coverage for Mitsubishi Ecodan devices by exposing additional MELCloud fields (system temps, zone temps, component status, compressor/demand, and daily energy), while fixing a couple of existing mapping bugs and adding deprecation/backwards-compat paths for renamed properties.

Changes:

  • Expose additional ATW properties on AtwDevice and new zone-specific temperature properties on Zone, plus deprecate Zone.flow_temperature / Zone.return_temperature.
  • Fix boiler return temperature mapping and correct cool-flow property string values; add backwards-compatible write handling for old property strings.
  • Extend sample payloads and test scenarios to assert the new properties and deprecation behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
src/pymelcloud/atw_device.py Adds new ATW/zone properties, fixes boiler return mapping, and introduces deprecated aliases + backwards-compatible apply_write() handling.
tests/test_atw_properties.py Expands assertions for new properties and adds tests for deprecated write keys and deprecation warnings.
tests/samples/atw_2zone_listdevice.json Adds daily energy fields to the list-device sample payload.
tests/samples/atw_2zone_get.json Adds DemandPercentage to the device-state sample payload.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Use PROPERTY_ZONE_*_HEAT_COOL_TEMPERATURE constants in apply_write
- Fix docstring grammar for return_temperature_boiler
- Extend test to cover both new and deprecated property strings
@erwindouna erwindouna added the enhancement New feature or request label Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants