Control over My Airconditioning/Heatpump

3 months ago 4

Control over my Airconditioning/Heatpump

2025-08-03 11:07:47

It started with our Mitsubishi heatpump. Someone on the internet had found a way to control it via Home Assistant. Sadly, this heatpump broke down in April... In July (yes, 10 weeks later!) we got a new one. A Panasonic this time.

A side-note, I recently started working at the New Zealand Meteorological Service (MetService)... So the title is a double joke...

Articles » 😶‍🌫️ Controlling the weather 🌦️

IMG20250803215312 compy

Controlling a heatpump

Control over most heatpumps isn't that hard. You go and ask for a wifi module to be installed, create an account with the "cloud service" of whoever makes the heatpump, and away you go!

One little problem here, is of course, the cloud service of the manufacturer. Yet Another Cloud Account. Yet Another Spy. And I don't like that one bit. No sirey, I don't like it at all.

Let's get to work

I was actually halfway writing a Raspberry Pi plus MQTT compatible version of the Python integration for a Mitsubishi Split Unit, when our heatpump broke, so I ehm... gave up. You can find my half-finished work on codeberg.

Let's try again

Our new heatpump, aside from having the capacity to heat up our lounge, which is nice during winter (did I mention we were out of proper heating for 10 weeks already? If not, well, it was cold!), is a Panasonic. And lo and behold, one of my favourite maker groups has a way to build a Home Assistant supporting integration.

Without a NZ$200 wifi module, but with about NZ$25 of parts from Ali Express and a PCB print you can get for free (I'll upload it here as well later), you can have your Home Assistant integration done!

Constructing a Wifi module

The following instructions are adapted from Ingenious Makers. Some parts can be skipped for certain models, and I've only written/updated for my model here.

Parts list

Part Amount Code Board placement
PCB 1 N/A, Upload soon X
Resistor - 10k 4 R10K R1,R2,R3,R4
Mosfet 2 2N7000 TO92
Small Signal MOSFET 200 mAmps, 60 Volts
T1,T2
Diode 1 1N4001 D1
Capacitor 1 470µF / 10V or 16V C1
ESP32-C3 Super Mini 1 ESP32-C3 Super Mini development board with header pins X2
5-pin cable 1 5 pin PAP-05V-S JP1

It is, from looking at the PCB, pretty obvious where everything should go.

Putting it together

To put everything together, you'll need a pretty fine-tipped soldering iron. And I also suggest to have a steady hand, and if possible, a "third hand" with a magnifying glass.

DO NOT BREATH IN THE SOLDERING SMOKE, IT IS NOT HEALTHY FOR YOU!

The easiest order of soldering everything:

  1. Solder the headers on your ESP32 board
    1. Tip: position the header pins in the PCB, then place the ESP32 on top. Don't solder them to the PCB (yet), but it helps getting them nice and cleanly poking through the holes.
  2. Solder the 10k resistors in place. Do not solder anything in the 4k7 slot!
  3. Solder the mosfets in place, the correct way round, with the middle pin sticking "out"
  4. Solder the diode in place (note the orientation!)
  5. Position the ESP32
    1. Now, attempt to connect a USB cable to the ESP32. You'll notice that it won't fit if you also solder the capacitor in place flush with the board
    2. Position the capacitor and ESP32 board loosely, so that you can still connect the cable.
    3. Take a photo of your positioning
  6. Solder the capacitor in its place, according to the photo you just took
  7. Solder the ESP32 in place, or solder a row of header-connectors in place so you can plug it in and pull it out easily (In case of the latter, ignore the positioning malarky above)
  8. WASH YOUR BOARD!
  9. Seriously, make sure there are no remnants of flux etc. on the board. Flux is not funny stuff.

Yay! Your chip board is done! It's time to give it a quick run through, before the final step of soldering.

Configuring the ESP32

You can use either the ESPHome web interface, or a self-hosted interface.

Create your YAML for ESPHome. Here's mine:

yaml:

  1. substitutions:

  2.   devicename: esp32-airco-01

  3.   long_devicename: Panasonic Climate Lounge

  4.   pcb_version: "P11-PTH-C3 250214"

  5. esphome:

  6.   name: "${devicename}"

  7.   name_add_mac_suffix: false

  8.   comment: "${long_devicename} ${pcb_version}"

  9. esp32:

  10.   board: esp32-c3-devkitm-1

  11.   framework:

  12.     type: esp-idf

  13.   variant: ESP32C3

  14. external_components:

  15.   source: "github://DomiStyle/esphome-panasonic-ac"

  16.   components:

  17.     - panasonic_ac

  18. wifi:

  19.   ssid: !secret esphome_wifi_ssid

  20.   password: !secret esphome_wifi_password

  21.   ap:

  22.     ssid: "${devicename} Hotspot"

  23.     password: !secret esphome_ap_password

  24. captive_portal:

  25. web_server:

  26.   port: 80

  27. logger:

  28.   level: DEBUG

  29. # Enable Home Assistant API

  30. api:

  31.   encryption:

  32.     key: "your_encryption_key_here"

  33. ota:

  34.   - platform: esphome

  35.     password: !secret ota_password

  36. bluetooth_proxy:

  37. uart:

  38.   tx_pin: GPIO21

  39.   rx_pin: GPIO20

  40.   id: ac_uart

  41.   baud_rate: 9600

  42.   parity: EVEN

  43. switch:

  44.   - platform: restart

  45.     name: "$long_devicename Restart"

  46. climate:

  47.   - platform: panasonic_ac

  48.     id: lounge

  49.     type: cnt

  50.     name: "$long_devicename"

  51.     vertical_swing_select:

  52.       name: "$long_devicename Vertical Swing Mode"

  53.     outside_temperature:

  54.       name: "$long_devicename Outside Temperature"

  55.     current_power_consumption:

  56.       id: power_consumption_lounge

  57.       name: "$long_devicename Power Consumption"

  58.       unit_of_measurement: W

  59.       accuracy_decimals: 0

  60.       device_class: power

  61.       state_class: measurement

  62. sensor:

  63.   - platform: total_daily_energy

  64.     name: "$long_devicename Total Daily Energy"

  65.     power_id: power_consumption_lounge

  66.     filters:

  67.         - multiply: 0.001

  68.     unit_of_measurement: kWh

  69.     device_class: energy

  70. time:

  71.   - platform: homeassistant

  72.     timezone: "Pacific/Auckland"

  73.     id: my_time

Uploading the firmware

My procedure of loading an ESP32 is via building through a self-hosted web version of ESPHome, downloading the factory binary file, and uploading it via the CLI

bash:

  1. esptool write_flash 0 esp32-airco-01.factory.bin

I prefer using the CLI over the web interface, as the web interface has been quite flaky for me from time to time.

Once the flashing of the ESP32 is done, give it a test-run. Connect it to power, and see if you can get the logs via the web interface, and if you can find it in Home Assistant. Give it at least a few minutes to power up.

Final wiring

Finally, solder the wiring to connect the whole chip to the heatpump. I prefer to do this last, because when the wires are connected, the chip has a bit of a wobbly stand, so it is easier to do the pre-connection tests without the wires.

To connect the wires, grab your PAP cable. Put the clip facing downward, and the not-wires-sticking-out part of the clip facing you.

The cables to solder on to the JP1 points 1, 2, 3, and 5 are from left to right

Wire up as follows:

Wire at clip, from left to right PCB
1 JP1 - 1 (+5V)
2 JP1 - 2 (Rx)
3 JP1 - 3 (Tx)
4 SKIP
5 JP1 - 5 (GND)

In the photo above, you can see it a bit. Note that the clip is facing upward in my photo, due to the twisting of the cables. For the colours in the photo, the order is:
Black - Red - White - Orange - Dark Orange
The Orange (second to last) is snipped short.

Plugging it in

DISCONNECT AND FULLY POWER OFF YOUR HEATPUMP/AC

Plugging in this construction is pretty straight forward. Open the front flap of your heatpump. You'll notice on the right side a manual Start/Stop button (that's your emergency control button), and a cover that is held in place by a Philips Head screw at the bottom right of the cover.

Unscrew the cover, and you should see the connector in which you can plug your device. Be careful plugging it in, the pins bend quite easily. Don't use any force!

Carefully position your board in the space next to the access point. Be careful, you'll probably see the mains power lines. Don't touch those, and ensure your board is well clear of them!

Close the cover, screw it back in place, close the front main cover, and you're done. Restore power to your heatpump and listen out for any issues.

If all goes to plan, the heatpump should power up, and with that, provide power to your device. After a few minutes, your device should start showing in ESPHome to read out the logs wirelessly, and in Home Assistant!

Congratulations! You're done!

Location


Wellington
New Zealand

Phone


+64 (0) 21 20 80 443

Read Entire Article