Skip to content

Commit

Permalink
Merge pull request #20 from DomiStyle/dev-cztacg1
Browse files Browse the repository at this point in the history
Add support for CZ-TACG1
  • Loading branch information
DomiStyle authored Aug 18, 2021
2 parents effede4 + c9736fa commit f85315b
Show file tree
Hide file tree
Showing 35 changed files with 2,299 additions and 1,822 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/.esphome/
**/.pioenvs/
**/.piolibdeps/
**/lib/
**/src/
**/platformio.ini
.vscode/
venv/
builds/
*.py[cod]
32 changes: 32 additions & 0 deletions README.CZTACG1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Hardware installation

This hardware installation guide assumes you already have a Panasonic CZ-TACG1 installed and want to replace it.

* Solder your ESP to your logic converter like this:

| **ESP32** | **Logic Converter** | **AC connector** | **Notes** |
| --------- | ------------- | ---------------- | ----------- |
| 5V/VIN | VCC/HV | 5V | Provides the ESP32 with power from the AC, make sure to connect it to the high voltage side if your logic converter has one |
| 3.3V | VCC/LV | - | Connect the logic converter to 3.3V on the LV side |
| GND | GND | GND | Connect any ground from the ESP32 to the ground of the logic converter low voltage side |
| GPIO16 | LV1 | - | Connect GPIO16 to the first of your logic converter channels (Low voltage) |
| GPIO17 | LV2 | - | Connect GPIO17 to the second of your logic converter channels (Low voltage |
| - | HV1 | RX | Connect the first of your logic converter channels to the AC RX pin (High voltage) |
| - | HV2 | TX | Connect the second of your logic converter channels to the AX TX pin (High voltage) |

* Disconnect the AC mains supply
* Open up the front of your AC
* Open up the mains supply on the right to gain easier access to the CN-CNT connector
* Your wifi adapter should be located in a plastic slot or outside of your AC
![wifi adapter](images/cztacg1/wifi_module.jpg)
* Remove the old wifi adapter and unplug it
* Solder 4 jumper cables to the CN-CNT wires (https://github.com/Egyras/HeishaMon#where-to-get-connectors)
![wifi adapter](images/cztacg1/connector.jpg)
* Note: RX/TX is from the direction of the ESP, not the AC.
* Heat shrink the individual wires (**do not skip this step to avoid short ciruits**)
* Connect the jumper cables to your logic converter
* Place the ESP and the logic converter in the slot for the wifi adapter (you can use some velcro to fix it in place)
* Plug in the ESP at the CN-CNT connector
![wifi adapter](images/cztacg1/cncnt.jpg)

Reconnect the AC mains supply. You can now connect this ESP to Home Assistant and control it from there.
37 changes: 37 additions & 0 deletions README.DNSKP11.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Hardware installation

This hardware installation guide assumes you already have a Panasonic DNSK-P11 installed and want to replace it. If you do not have a DNSK-P11 installed but your AC has the CN-WLAN connector you will have to find a fitting connector and route a cable from the mainboard yourself.

* Solder your ESP to your logic converter like this:

| **ESP32** | **Logic Converter** | **AC connector** | **Notes** |
| --------- | ------------- | ---------------- | ----------- |
| 5V/VIN | VCC/HV | 5V | Provides the ESP32 with power from the AC, make sure to connect it to the high voltage side if your logic converter has one |
| 3.3V | VCC/LV | - | Connect the logic converter to 3.3V on the LV side |
| GND | GND | GND | Connect any ground from the ESP32 to the ground of the logic converter low voltage side |
| GPIO16 | LV1 | - | Connect GPIO16 to the first of your logic converter channels (Low voltage) |
| GPIO17 | LV2 | - | Connect GPIO17 to the second of your logic converter channels (Low voltage |
| - | HV1 | RX | Connect the first of your logic converter channels to the AC RX pin (High voltage) |
| - | HV2 | TX | Connect the second of your logic converter channels to the AX TX pin (High voltage) |

* Disconnect the AC mains supply
* Open up your AC according to the manual
* Your wifi adapter should be located on the left side of the unit like this:
![wifi adapter](images/wifi_module.jpg)
* Remove the old wifi adapter and unplug it
* Optional: While you can install the ESP where the old unit was I recommend rerouting the wire to the right side of the unit and placing the ESP where the external adapter sits. This makes it easier to replace in the future and doesn't require you to open your AC again
* Cut off the cable where the wifi connector sits:
![wifi adapter](images/connector.jpg)
Note: RX/TX is from the direction of the ESP, not the AC.
* Solder 4 jumper cables to the exposed wires
* Heat shrink the individual wires (**do not skip this step to avoid short ciruits**)
![wifi adapter](images/jumper_wires.jpg)
* Thread the now dangling wire through the front of the case
* Reinstall the front case of the AC as you would normally do
* Connect the jumper cables to your logic converter
* Place the ESP and the logic converter in the top right slot for the wifi adapter (you can use some velcro to fix it in place)
* Install the front cover and we are done

![wifi adapter](images/installed_controller.jpg)

Reconnect the AC mains supply and turn wifi back on. You should see a flashing wifi LED, followed by a faster flashing wifi LED and a solid wifi LED after about a minute. You can now connect this ESP to Home Assistant and control it from there.
20 changes: 20 additions & 0 deletions README.UPGRADING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Upgrading from 1.x to 2.x

v2.0 introduces support for the CZ-TACG1 wifi module but also comes with many breaking changes. In order to update your existing config you will have to move your config over to the new external component format.

The climate entity and all sensors and switches are now automatically exposed to Home Assistant.
Take a look at [the new example file](ac.yaml.example) to see what has changed.

## Cleanup

If you previously pulled the old version of this repository you may remove the `esphome-panasonic-ac` folder, the repo gets pulled automatically now.

## Move from input_selects to select

If you previously added any input_select entities in Home Assistant to control the manual swing position you may remove them. They are not used anymore.

## Update automations

In case you added any automations to Home Assistant you might have to update them as powerful and quiet have moved to the preset and fan modes have been renamed.

Also, all previously added `input_select` are not used anymore and all automations now have to point to the new `select` elements.
88 changes: 37 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,83 +8,69 @@ An open source alternative for the Panasonic wi-fi adapter that works locally wi
* Instantly control the AC without any delay like in the Comfort Cloud app
* Receive live reports and state from the AC
* Uses the UART interface on the AC instead of the IR interface
* Provides a drop-in replacement for the Panasonic DNSK-P11 wifi module
* Provides a drop-in replacement for the Panasonic DNSK-P11 and the CZ-TACG1 wifi module

# Supported hardware

Confirmed working with the Etherea series split and multi split units via the internal CN-WLAN connector. The library was only tested with the integrated wifi adapter, not via the CN-CNT connector or the external wifi adapter.
This library works with both the CN-CNT port and the CN-WLAN port. CN-WLAN is only available on newer units.

Tested on ESP32, should work on ESP8266 but ESP32 is preferred for the multiple hardware serial ports.
Works on the ESP8266 but ESP32 is preferred for the multiple hardware serial ports.

# Requirements

* ESP32 or ESP8266 ([supported by ESPHome](https://esphome.io/#devices))
* ESP32 (or ESP8266) ([supported by ESPHome](https://esphome.io/#devices))
* 5V to 3.3V bi-directional Logic Converter (minimum 2 channels, available as pre-soldered prototyping boards)
* Female-Female Jumper cables
* Soldering iron
* Wires to solder from Logic converter to ESP
* Heat shrink
* ESPHome 1.19.1 or newer
* ESPHome 2021.8.0 or newer
* Home Assistant 2021.8.0 or newer

# Notes

* **Make sure to disconnect mains power before opening your AC, the mains contacts are exposed and can be touched by accident!**
* **Do not connect your ESP32/ESP8266 directly to the AC, the AC uses 5V while the ESPs use 3.3V!**
* **While installation is fairly straightforward I do not take any responsibility for any damage done to you or your AC during installation**
* This library was only tested with the CN-WLAN connector, not on the CN-CNT connector that the old wifi adapter uses. **Make sure your AC can use the Panasonic DNSK-P11.**
* The DNSK-P11 and the CZ-TACG1 use different types of connectors, make sure to connect to the correct one

# Software installation

This software installation guide assumes some familiarity with ESPHome.

* Pull this repository
* Copy the ac.yaml one directory above so your directory structure looks like this:
```
ac.yaml
esphome-panasonic-ac/
esppac.cpp
...
```
* Adjust the ac.yaml to your needs
* Pull this repository or copy the `ac.yaml.example` from the root folder
* Rename the `ac.yaml.example` to `ac.yaml`
* Uncomment the `type` field depending on which AC protocol you want to use
* Adjust the `ac.yaml` to your needs
* Connect your ESP
* Run `esphome ac.yaml run` and choose your serial port (or do this via the Home Assistant UI)
* If you see the handshake messages being sent in the log you are good to go
* If you see the handshake messages being sent (DNSK-P11) or polling requests being sent (CZ-TACG1) in the log you are good to go
* Disconnect the ESP and continue with hardware installation

## Setting supported features

Since Panasonic ACs support different features you can comment out the lines at the bottom of your `ac.yaml`:

```
# Enable as needed
# eco_switch:
# name: Panasonic AC Eco Switch
# nanoex_switch:
# name: Panasonic AC NanoeX Switch
# mild_dry_switch:
# name: Panasonic AC Mild Dry Switch
```

In order to find out which features are supported by your AC, check the remote that came with it. Please note that eco switch and mild dry switch are not supported on DNSK-P11.

**Enabling unsupported features can lead to undefined behavior and may damage your AC. Make sure to check your remote or manual first.**

## Upgrading from 1.x to 2.x

[Upgrade instructions](README.UPGRADING.md)

# Hardware installation

This hardware installation guide assumes you already have a Panasonic DNSK-P11 installed and want to replace it. If you do not have a DNSK-P11 installed but your AC has the CN-WLAN connector you will have to find a fitting connector and route a cable from the mainboard yourself.

* Solder your ESP to your logic converter like this:

| **ESP32** | **Logic Converter** | **AC connector** | **Notes** |
| --------- | ------------- | ---------------- | ----------- |
| 5V/VIN | VCC/HV | 5V | Provides the ESP32 with power from the AC, make sure to connect it to the high voltage side if your logic converter has one |
| 3.3V | VCC/LV | - | Connect the logic converter to 3.3V on the LV side |
| GND | GND | GND | Connect any ground from the ESP32 to the ground of the logic converter low voltage side |
| GPIO16 | LV1 | - | Connect GPIO16 to the first of your logic converter channels (Low voltage) |
| GPIO17 | LV2 | - | Connect GPIO17 to the second of your logic converter channels (Low voltage |
| - | HV1 | RX | Connect the first of your logic converter channels to the AC RX pin (High voltage) |
| - | HV2 | TX | Connect the second of your logic converter channels to the AX TX pin (High voltage) |

* Disconnect the AC mains supply
* Open up your AC according to the manual
* Your wifi adapter should be located on the left side of the unit like this:
![wifi adapter](images/wifi_module.jpg)
* Remove the old wifi adapter and unplug it
* Optional: While you can install the ESP where the old unit was I recommend rerouting the wire to the right side of the unit and placing the ESP where the external adapter sits. This makes it easier to replace in the future and doesn't require you to open your AC again
* Cut off the cable where the wifi connector sits:
![wifi adapter](images/connector.jpg)
Note: RX/TX is from the direction of the ESP, not the AC.
* Solder 4 jumper cables to the exposed wires
* Heat shrink the individual wires (**do not skip this step to avoid short ciruits**)
![wifi adapter](images/jumper_wires.jpg)
* Thread the now dangling wire through the front of the case
* Reinstall the front case of the AC as you would normally do
* Connect the jumper cables to your logic converter
* Place the ESP and the logic converter in the top right slot for the wifi adapter (you can use some velcro to fix it in place)
* Install the front cover and we are done

![wifi adapter](images/installed_controller.jpg)

Reconnect the AC mains supply and turn wifi back on. You should see a flashing wifi LED, followed by a faster flashing wifi LED and a solid wifi LED after about a minute. You can now connect this ESP to Home Assistant and control it from there.
[Hardware installation for DNSK-P11](README.DNSKP11.md)

[Hardware installation for CZ-TACG1](README.CZTACG1.md)
91 changes: 0 additions & 91 deletions ac.yaml

This file was deleted.

52 changes: 52 additions & 0 deletions ac.yaml.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
esphome:
name: panasonic-ac
platform: ESP32
board: nodemcu-32s

wifi:
networks:
ap: {}

logger:
level: DEBUG
# baud_rate: 0 # ESP8266 only

api:

ota:

# Requires ESPHome 1.15.0+ for the even parity option
uart:
tx_pin: GPIO17
rx_pin: GPIO16
baud_rate: 9600
parity: EVEN

external_components:
source: github://DomiStyle/esphome-panasonic-ac
components: [panasonic_ac]


climate:
- platform: panasonic_ac
# For CZ-TACG1
# type: cnt

# For DNSK-P11
# type: wlan

name: Panasonic AC
horizontal_swing_select:
name: Panasonic AC Horizontal Swing Mode
vertical_swing_select:
name: Panasonic AC Vertical Swing Mode
outside_temperature:
name: Panasonic AC Outside Temperature

# Enable as needed
# eco_switch:
# name: Panasonic AC Eco Switch
# nanoex_switch:
# name: Panasonic AC NanoeX Switch
# mild_dry_switch:
# name: Panasonic AC Mild Dry Switch
Empty file.
Loading

0 comments on commit f85315b

Please sign in to comment.