Skip to content

Commit

Permalink
Update Readme and two yaml examples
Browse files Browse the repository at this point in the history
  • Loading branch information
tsunglung committed Jan 3, 2024
1 parent 810cfcd commit 6b0ea21
Show file tree
Hide file tree
Showing 5 changed files with 231 additions and 19 deletions.
27 changes: 12 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,28 @@
ESPHome TaiXia Custom Component


## Hardware

### Daikin S21 Port
## Special Thank
### Thanks for Andrew Wang provide the related hardware and spec.
### Thanks for Seven Hong provide Air Conditioner for test.
### Thanks for Mr. Wang and Mr Huang donate $230 and $200.

**NOTE:** The Daikin S21 port provides >5V, so if you intend to power your
board on this pin, be sure to test its output and regulate voltage accordingly.
## Hardware

On my Daikin units, the S21 port has the following pins:
### UART Port

|Pin|Meaning|
|---|-------|
|1|5V|
|2|Tx from aircon - 5V logic|
|3|Rx to aircon - 5V logic but most models accept 3.3V|
|4|12V, or 14V, or some such|
|5|GND|

The S21 plug is JST `EHR-5` and related header `B5B-EH-A(LF)(SN)`, though the
plug pins are at standard pin header widths.
|2|Tx from aircon or Fan- 5V logic|
|3|Rx to aircon or Fan - 5V logic|
|4|GND|

## Installation
Set wifi_ssid and wifi_password in your esphome's secrets.yaml first

1. Place the folder 'taixia' into the custom_components of your esphome configuration folder
1. Place the folder 'taixia' into the components of your esphome configuration folder
2. Create new device with the yaml in this repository
3. Or you can check the example "climate-taiseia.yaml" or "fan-taiseia.yaml"


## Configuration Example
Expand Down Expand Up @@ -112,4 +109,4 @@ text_sensor:
# Optional additional component.


```
```
113 changes: 113 additions & 0 deletions climate-taiseia.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
substitutions:
devicename: climate-taiseia
upper_devicename: "Climate TaiSeia"

esphome:
name: $devicename
friendly_name: ${upper_devicename}
comment: $upper_devicename
name_add_mac_suffix: true
project:
name: TaiSEIA.climate
version: "1.0"

external_components:
- source: github://tsunglung/taixia@master
components: [ taixia ]

esp32:
board: esp32dev

wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# reboot_timeout: 0s
ap:
password: "admin1234"
ap_timeout: 30s

# Enable logging
logger:
baud_rate: 0

# Enable Home Assistant API
api:

ota:

uart:
id: uart_taixia
tx_pin: TX
rx_pin: RX
baud_rate: 9600

binary_sensor:
- platform: status
name: "${upper_devicename} Status"

button:
- platform: restart
name: "${upper_devicename} Restart"


number:
- platform: taixia
type: airconditioner
off_timer:
name: "${upper_devicename} Off Timer"

sensor:
- platform: wifi_signal
name: "${upper_devicename} WiFi Signal"
update_interval: 60s

- platform: uptime
name: "${upper_devicename} Uptime"
filters:
- lambda: return x / 3600;
unit_of_measurement: "h"
accuracy_decimals: 1

- platform: taixia
type: airconditioner
temperature_indoor:
name: "${upper_devicename} Temperature Indoor"
humidity_indoor:
name: "${upper_devicename} Humidity Indoor"
temperature_outdoor:
name: "${upper_devicename} Temperature Outdoor"
energy_consumption:
name: "${upper_devicename} Energy"
operating_hours:
name: "${upper_devicename} Operating Hours"

switch:
- platform: taixia
type: airconditioner
power:
name: "${upper_devicename} Power Switch"
beeper:
name: "${upper_devicename} Buzzer"

text_sensor:
- platform: wifi_info
ip_address:
name: "${upper_devicename} IP Address"
- platform: taixia
sa_id:
name: "${upper_devicename} SA ID"
brand:
name: "${upper_devicename} SA Brand"
model:
name: "${upper_devicename} SA Model"
version:
name: "${upper_devicename} SA Version"
services:
name: "${upper_devicename} SA Services"

taixia:
sa_id: 1

time:
- platform: homeassistant
id: homeassistant_time
2 changes: 1 addition & 1 deletion components/taixia/taixia.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ class TaiXia : public uart::UARTDevice, public Component {

protected:
void readline(int readch, char *buffer, int len);
int state_{0};

std::vector<uint8_t> buffer_;
uint8_t protocol_;
uint8_t sa_id_;
Expand Down
5 changes: 2 additions & 3 deletions esphome-taiseia.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ esphome:
name_add_mac_suffix: true

external_components:
- source:
type: local
path: components
- source: github://tsunglung/taixia@master
components: [ taixia ]

esp8266:
board: esp01_1m
Expand Down
103 changes: 103 additions & 0 deletions fan-taiseia.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
substitutions:
devicename: fan-taiseia
upper_devicename: "Fan TaiSeia"

esphome:
name: $devicename
friendly_name: ${upper_devicename}
comment: $upper_devicename
name_add_mac_suffix: true
project:
name: TaiSEIA.climate
version: "1.0"

external_components:
- source: github://tsunglung/taixia@master
components: [ taixia ]

esp32:
board: esp32dev

wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# reboot_timeout: 0s
ap:
password: "admin1234"
ap_timeout: 30s

# Enable logging
logger:
baud_rate: 0

# Enable Home Assistant API
api:

ota:

uart:
id: uart_taixia
tx_pin: TX
rx_pin: RX
baud_rate: 9600

binary_sensor:
- platform: status
name: "${upper_devicename} Status"

button:
- platform: restart
name: "${upper_devicename} Restart"

fan:
- platform: taixia
name: ${upper_devicename}
speed: true
speed_count: 2

number:
- platform: taixia
type: electricfan
off_timer:
name: "${upper_devicename} Off Timer"

sensor:
- platform: wifi_signal
name: "${upper_devicename} WiFi Signal"
update_interval: 60s

- platform: uptime
name: "${upper_devicename} Uptime"
filters:
- lambda: return x / 3600;
unit_of_measurement: "h"
accuracy_decimals: 1

switch:
- platform: taixia
type: electricfan
power:
name: "${upper_devicename} Power Switch"

text_sensor:
- platform: wifi_info
ip_address:
name: "${upper_devicename} IP Address"
- platform: taixia
sa_id:
name: "${upper_devicename} SA ID"
brand:
name: "${upper_devicename} SA Brand"
model:
name: "${upper_devicename} SA Model"
version:
name: "${upper_devicename} SA Version"
services:
name: "${upper_devicename} SA Services"

taixia:
sa_id: 15

time:
- platform: homeassistant
id: homeassistant_time

0 comments on commit 6b0ea21

Please sign in to comment.