Skip to content

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

Merged
erwindouna merged 3 commits intoerwindouna:masterfrom
RaHehl:feature/atw-extended-properties
Apr 12, 2026
Merged

feat(atw): add extended ATW properties for Ecodan heat pumps#16
erwindouna merged 3 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.

Comment thread src/pymelcloud/atw_device.py
Comment thread src/pymelcloud/atw_device.py
Comment thread src/pymelcloud/atw_device.py Outdated
Comment thread tests/test_atw_properties.py
- 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
Comment thread src/pymelcloud/atw_device.py
Comment thread src/pymelcloud/atw_device.py Outdated
Comment thread src/pymelcloud/atw_device.py Outdated
Comment thread src/pymelcloud/atw_device.py Outdated
Comment thread src/pymelcloud/atw_device.py Outdated
- Replace Optional[float] with float | None (modern Python 3.12 syntax)
- Remove explicit result type annotations (type can be inferred)
- Apply same cleanup to zone_flow_temperature and zone_return_temperature
@erwindouna
Copy link
Copy Markdown
Owner

Thanks @RaHehl! From what I can judge now, this seems fine to merge (but as stated, I am no expert on these devices, so I rely on your expertise here). Do you want to do final checks or deliver some screenshots for the record, so when other debug this, we can confirm we tested it all properly? :)

@RaHehl
Copy link
Copy Markdown
Author

RaHehl commented Apr 12, 2026

@erwindouna

Test Results — ATW Extended Properties (Ecodan Heat Pump)

Tested with a live Ecodan heat pump device (2 zones)

==================================================
  Device: Wärmepumpe
==================================================
  Status:                                  heat_zones
  Operation mode:                          auto
  Holiday mode:                            False

==================================================
  Temperatures
==================================================
  Outside temperature:                     9.0
  Tank temperature:                        49.0
  Target tank temperature:                 50.0
  Target tank temp min:                    40.0
  Target tank temp max:                    60.0
  Flow temperature:                        48.5
  Return temperature:                      48.0
  Flow temperature (boiler):               32.52
  Return temperature (boiler):             25.0
  Mixing tank temperature:                 48.5
  Condensing temperature:                  40.57

==================================================
  System Status
==================================================
  Heat pump frequency (Hz):                0
  Demand percentage:                       100
  Boiler status:                           False
  Booster heater 1:                        False
  Booster heater 2:                        False
  Booster heater 2+:                       False
  Immersion heater:                        False
  Water pump 1:                            True
  Water pump 2:                            False
  Water pump 3:                            True
  Water pump 4:                            False
  3-way valve:                             False
  2-way valve:                             True

==================================================
  Daily Energy
==================================================
  Heating consumed (kWh):                  12.5
  Cooling consumed (kWh):                  0.0
  Hot water consumed (kWh):                7.18
  Heating produced (kWh):                  0.0
  Cooling produced (kWh):                  0.0
  Hot water produced (kWh):                0.0

==================================================
  Zone: Zone 1
==================================================
  Status:                                  idle
  Prohibit:                                False
  Operation mode:                          curve
  Available modes:                         ['heat-thermostat', 'heat-flow', 'curve']
  Room temperature:                        24.0
  Target temperature:                      26.0
  Target heat flow temp:                   25.0
  Target cool flow temp:                   20.0
  Zone flow temperature:                   48.0
  Zone return temperature:                 46.0

==================================================
  Zone: Zone 2
==================================================
  Status:                                  heat
  Prohibit:                                False
  Operation mode:                          curve
  Available modes:                         ['heat-thermostat', 'heat-flow', 'curve']
  Room temperature:                        24.0
  Target temperature:                      20.0
  Target heat flow temp:                   25.0
  Target cool flow temp:                   20.0
  Zone flow temperature:                   39.0
  Zone return temperature:                 21.0

Summary:

  • All new extended properties return plausible values from a live 2-zone Ecodan system
  • Temperature readings (flow, return, boiler, mixing tank, condensing) are consistent
  • System status flags (pumps, valves, heaters) reflect expected operating state
  • Zone-level flow/return temperatures are available per zone
  • Daily energy consumption values are populated correctly

@erwindouna erwindouna merged commit b60c336 into erwindouna:master Apr 12, 2026
7 of 13 checks passed
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