feat(atw): add extended ATW properties for Ecodan heat pumps#16
Conversation
- 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
There was a problem hiding this comment.
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
AtwDeviceand new zone-specific temperature properties onZone, plus deprecateZone.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
- 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
|
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? :) |
Test Results — ATW Extended Properties (Ecodan Heat Pump)Tested with a live Ecodan heat pump device (2 zones) Summary:
|
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 temperaturereturn_temperature— system-level return temperaturecondensing_temperatureZone-specific temperatures (on
Zone):zone_flow_temperature— per-zone flow temperaturezone_return_temperature— per-zone return temperatureCompressor & demand:
heat_pump_frequency— compressor frequency in Hzdemand_percentage— current demand (0–100%)Component status (all
bool):boiler_statusbooster_heater1_status,booster_heater2_status,booster_heater2plus_statusimmersion_heater_statuswater_pump1_status..water_pump4_statusvalve_3way_status,valve_2way_statusDaily energy (from
ListDevices/ device_conf):daily_heating_energy_consumed/daily_heating_energy_produceddaily_cooling_energy_consumed/daily_cooling_energy_produceddaily_hot_water_energy_consumed/daily_hot_water_energy_producedBug fixes
return_temperature_boilerwas readingFlowTemperatureBoilerinstead ofReturnTemperatureBoiler— fixed.PROPERTY_ZONE_*_COOL_FLOW_TEMPERATUREstring values were"zone_X_target_heat_cool_temperature"(copy-paste from heat) — fixed to"zone_X_target_cool_flow_temperature".Backwards compatibility
"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 withDeprecationWarning. These returned the system-level temperature, not zone-specific. Callers should migrate todevice.flow_temperature(system) orzone.zone_flow_temperature(zone-specific). Return type changed fromfloattoOptional[float]with.get()to preventKeyError.Test coverage
update())test_apply_write_old_cool_flow_property_strings— verifies backwards compat of old property stringstest_zone_flow_return_temperature_deprecation— verifiesDeprecationWarningis emitted