Skip to content

Commit 8e35947

Browse files
committed
feat: add power-reset turn_off for E-heater assist and fix sterilize profile mapping
1 parent fa26791 commit 8e35947

3 files changed

Lines changed: 53 additions & 2 deletions

File tree

TESTING_NOTE.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Midea Heat Pump Modbus Integration - Testing & Handover Note
2+
3+
**Date:** July 31, 2026
4+
**Status:** Deployed & Stable on `nova-old` (`192.168.1.32`)
5+
**Fork Branch:** `tazomatalax/Midea-Heat-Pump-HA:feat/e-heater-support`
6+
**Draft PR:** https://github.com/0xAHA/Midea-Heat-Pump-HA/pull/28
7+
8+
---
9+
10+
## 1. Summary of Work Completed Today
11+
12+
### Modbus Discovery & Hardware Optimization
13+
- **Modbus Timeout Fix:** Identified that the Waveshare/USR NA111 adapter (`192.168.1.77:502`) was dropping TCP connections after 10 seconds of idle time. Adjusting `Modbus keep time` to `120s` completely resolved all Home Assistant timeout and connection errors.
14+
- **Manual E-Heater Control (Register 4):** Proven that writing `1` to Register `4` triggers the manual Electric Booster element. Writing `0` is rejected by the controller; the trigger self-clears back to `0` when the target temperature setpoint is reached (operating like the Sanitize register `R3`).
15+
- **Sanitize Substate Split:** Proven that Register `109` value `32` represents active immediate sanitize, whereas value `33` represents a pending/scheduled weekly sanitize cycle.
16+
17+
### Custom Component Enhancements Deployed
18+
- **[switch.py](file:///home/tazomatalax/homelab-command-center/playground/midea-heatpump/custom_components/midea_heatpump_hws/switch.py):** Added `MideaHeaterAssistSwitch` to trigger manual booster heating (`R4 = 1`).
19+
- **[binary_sensor.py](file:///home/tazomatalax/homelab-command-center/playground/midea-heatpump/custom_components/midea_heatpump_hws/binary_sensor.py):**
20+
- `Electric Booster Active`: Uses `R108 & 8` bitwise mask (accurately reports OFF when element is idle).
21+
- `Sanitize Cycle Active`: Triggers only on `R109 = 32`.
22+
- `Sanitize Cycle Scheduled`: Triggers on `R109 = 33`.
23+
- **[ecospring_hp300.json](file:///home/tazomatalax/homelab-command-center/playground/midea-heatpump/custom_components/midea_heatpump_hws/models/defaults/ecospring_hp300.json):** Added default mapping `"heater_assist_trigger_register": 4`.
24+
25+
---
26+
27+
## 2. Checklist for Tomorrow's Testing Session
28+
29+
### [ ] Test 1: Manual E-Heater Assist Override
30+
1. Open Home Assistant -> Go to **Hot Water System** / **Midea Heat Pump** device controls.
31+
2. Toggle **`Manual Heater Assist`** to **ON**.
32+
3. Verify that `Electric Booster Active` sensor switches to **Running** within 30 seconds.
33+
4. Verify that water heating rate accelerates.
34+
35+
### [ ] Test 2: Sanitize Cycle Activation
36+
1. Monitor when the scheduled weekly sanitize cycle fires (when `R109` transitions from `33` to `32`).
37+
2. Verify that **`Sanitize Cycle Active`** flips to **Running** and **`Sanitize Cycle Scheduled`** changes to **Not running**.
38+
3. Verify that target setpoint jumps to 65°C on the controller.
39+
40+
### [ ] Test 3: Dashboard & Entity Cleanup
41+
1. Go to **Settings -> Devices & Services -> Entities**.
42+
2. Filter for `midea`.
43+
3. Select and delete the old orphaned entity `Compressor Status (Unavailable)` left over from early testing.
44+
45+
### [ ] Test 4: Upstream Pull Request
46+
Once Tests 1–3 are verified live:
47+
1. Open GitHub: [tazomatalax/Midea-Heat-Pump-HA](https://github.com/tazomatalax/Midea-Heat-Pump-HA)
48+
2. Submit a Pull Request from branch `feat/e-heater-support` to `0xAHA/Midea-Heat-Pump-HA:main`.

custom_components/midea_heatpump_hws/profile_manager.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ def apply_profile_to_config(self, profile_data: dict[str, Any], user_input: dict
236236
config["mode_register"] = registers.get("mode", 1)
237237
config["temp_register"] = registers.get("current_temp", 102)
238238
config["target_temp_register"] = registers.get("target_temp", 2)
239+
config["sterilize_register"] = registers.get("sterilize", 3)
239240
config["tank_top_temp_register"] = registers.get("tank_top_temp", 101)
240241
config["tank_bottom_temp_register"] = registers.get("tank_bottom_temp", 102)
241242
config["condensor_temp_register"] = registers.get("condensor_temp", 103)

custom_components/midea_heatpump_hws/switch.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,5 +197,7 @@ async def async_turn_on(self, **kwargs: Any) -> None:
197197
await self.coordinator.write_register("heater_assist_trigger", 1)
198198

199199
async def async_turn_off(self, **kwargs: Any) -> None:
200-
"""Off writes are not directly supported by the controller, warn user."""
201-
_LOGGER.warning("Direct off-toggle for E-heater assist is not supported by the controller. It will automatically self-clear when the target temperature is reached.")
200+
"""Turn off E-heater assist by resetting power state to clear R4 trigger."""
201+
_LOGGER.info("Resetting power state to turn off manual E-heater assist")
202+
await self.coordinator.write_register("power_state", False)
203+
await self.coordinator.write_register("power_state", True)

0 commit comments

Comments
 (0)