mirror of
https://github.com/GrKoR/esphome_aux_ac_component.git
synced 2025-12-06 11:36:55 +03:00
documentation update
This commit is contained in:
275
README-EN.md
275
README-EN.md
@@ -15,122 +15,38 @@ Component tested with ESPHome 1.15.3 and Rovex ALS1 air conditioner. It looks li
|
||||
|
||||
|
||||
## Supported air conditioners ##
|
||||
### List of compatible ACs (tested) ###
|
||||
These ACs were tested by the author or by users.
|
||||
+ AUX (models: ASW-H09A4/LK-700R1, ASW-H09B4/LK-700R1, AMWM-xxx multisplit)
|
||||
+ Centek (models: CT-65Q09, CT-65Z10)
|
||||
+ Hyundai (models: H-AR21-09H)
|
||||
+ IGC (models: RAK-07NH multysplit)
|
||||
+ Roda (models: RS-AL09F)
|
||||
+ Rovex (models: RS-07ALS1, RS-09ALS1, RS-12ALS1)
|
||||
+ Samurai (models: SMA-07HRN1 ION, SMA-09HRN1 ION)
|
||||
+ Subtropic (models: SUB-07HN1_18Y)
|
||||
|
||||
|
||||
### List of potential compatible ACs ###
|
||||
**NOT TESTED! TRY AT YOUR OWN RISK!**<br />
|
||||
AUX is one of the OEM air conditioner manufacturers. AUX produce ACs for many brands.
|
||||
|
||||
Internet says that following air conditioners may work with `aux_ac` component:
|
||||
+ Abion
|
||||
+ AC ELECTRIC
|
||||
+ Almacom
|
||||
+ Ballu
|
||||
+ Climer
|
||||
+ DAX
|
||||
+ Energolux
|
||||
+ ERISSON
|
||||
+ Green Energy
|
||||
+ Kentatsu (some series; Kentatsu KSGMA26HFAN1 was tested and **isn't supported**)
|
||||
+ Klimaire
|
||||
+ KOMANCHI
|
||||
+ LANZKRAFT
|
||||
+ LEBERG
|
||||
+ LGen
|
||||
+ Monroe
|
||||
+ Neoclima
|
||||
+ NEOLINE
|
||||
+ One Air
|
||||
+ Pioneer (до 2016 года)
|
||||
+ Royal Clima
|
||||
+ SAKATA
|
||||
+ SATURN
|
||||
+ Scarlett
|
||||
+ SmartWay
|
||||
+ Soling
|
||||
+ SUBTROPIC
|
||||
+ Supra
|
||||
+ Timberk
|
||||
+ Vertex
|
||||
+ Zanussi
|
||||
There is following list of AUX-based air conditioner in the internet: AUX, Abion, AC ELECTRIC, Almacom, Ballu , Centek, Climer, DAX, Energolux, ERISSON, Green Energy, Hyundai, IGC, Kentatsu (некоторые серии), Klimaire, KOMANCHI, LANZKRAFT, LEBERG, LGen, Monroe, Neoclima, NEOLINE, One Air, Pioneer (до 2016 года), Roda, Rovex, Royal Clima, SAKATA, Samurai, SATURN, Scarlett, SmartWay, Soling, Subtropic, SUBTROPIC, Supra, Timberk, Vertex, Zanussi. There are doubts about its completeness and reliability, but nothing better could be found.
|
||||
|
||||
### List of compatible ACs (tested) ###
|
||||
[The list of tested ACs](docs/AC_TESTED.md) is placed in a separate file and includes tested by the author or by users ACs. This list is permanently updated mainly based on feedback from users in [Telegram chat](https://t.me/aux_ac).<br />
|
||||
|
||||
|
||||
### If your AC is not in the list ###
|
||||
If your AC is listed above you should take a closer look at `aux_ac`.<br />
|
||||
If the User Manual of your HVAC describes connection to wifi with mobile app ACFreedom it seems you may go deeper with `aux_ac`. But try all soft and hardware for your own risk. You must clearly understand what you are doing.<br />
|
||||
If you are unsure it is better to wait while other users will test your model of AC (but it may never). Or please [go to telegram-chat](https://t.me/aux_ac) with your questions. Maybe you will get help there.
|
||||
|
||||
If you have tested your air conditioner and `aux_ac` works with it please let me know about it. I'll add this info to the list of tested ACs above.
|
||||
The best way to report about your test results is write a message [in the issue section](https://github.com/GrKoR/esphome_aux_ac_component/issues). Direct message in the [telegram](https://t.me/aux_ac) is possible too but probably I can miss your message among many others.
|
||||
The best way to report about your test results is write a message in the [telegram](https://t.me/aux_ac) or [in the issue section](https://github.com/GrKoR/esphome_aux_ac_component/issues).
|
||||
|
||||
|
||||
## How to use it ##
|
||||
### Hardware ###
|
||||
I tested it with an esp8266 chip (esp-12e). Minimal scheme:<br />
|
||||

|
||||
|
||||
At the first time in addition to scheme above IO0 (GPIO0) must be pulled down to GND at the boot and ESPHome can be uploaded through UART0. If your ESPHome configuration contains OTA you can pull up IO0 or leave it floating. All further updates can be uploaded over-the-air.<br />
|
||||
I leave GPIO0 in air cause I don't see any reason to solder additional components for single use.
|
||||
|
||||
ESP-12E before DC-DC and air conditioner connected:<br />
|
||||

|
||||
|
||||
Air conditioner internal block has a 5-wire connection to the wifi-module. Connector is [JST SM](https://www.jst-mfg.com/product/pdf/eng/eSM.pdf).
|
||||
|
||||
Wires:
|
||||
1. Yellow: +14V DC. Measured +14.70V max and +13.70V min. Service manual declares up to +16V.
|
||||
2. Black: ground.
|
||||
3. White: +5V DC (max: +5.63V; min: +4.43V) I have no idea what this is for. It goes directly to the air conditioner microcontroller through resistor 1kOhm and it does not affect the operation of the module.
|
||||
4. Blue: TX of air conditioner. High is +5V.
|
||||
5. Red: RX of air conditioner. High is +5V.
|
||||
|
||||
For power supply it is possible to use any kind of suitable modules. I use this:<br />
|
||||
.
|
||||
|
||||
Black wire of AC's connector goes to the middle pin of the power module and to the GND pin of esp-12e.<br />
|
||||
Yellow wire is connected to the Vin pin of the power module.<br />
|
||||
Blue wire is connected to the RXD pin of esp-12e.<br />
|
||||
Red wire is connected to the TXD pin of esp-12e.<br />
|
||||
|
||||
Here is it:<br />
|
||||

|
||||
|
||||
All connections in custom 3d-printed case looks like this:<br />
|
||||

|
||||
|
||||
Cause I haven't JST SM connector I made own:<br />
|
||||
.
|
||||
|
||||
It is made of standard 2.54mm pins and 3D-printed case.<br />
|
||||
All models for 3D-printing are available too: [STL-files for connector](https://github.com/GrKoR/esphome_aux_ac_component/tree/master/enclosure/JST%20SM%20connector), [models of case parts](https://github.com/GrKoR/esphome_aux_ac_component/tree/master/enclosure/case).
|
||||
|
||||
Here is the result:<br />
|
||||
<br />
|
||||
<br />
|
||||

|
||||
|
||||
|
||||
For correct component operation you need hardware and firmware. The hardware description is located [in separate file](docs/HARDWARE-EN.md).
|
||||
|
||||
### Firmware: Integration aux_ac to your configuration ###
|
||||
1. Copy aux_ac_custom_component.h to folder with your ESPHome YAML file.
|
||||
2. At the header of your YAML add include instruction like this:
|
||||
You need [ESPHome](https://esphome.io) v.1.18.0 or above. `External_components` have appeared in this version. But it is better to use ESPHome v.1.20.4 or above cause there was alot of `external_components` errors corrected before this version.
|
||||
|
||||
## Installing ##
|
||||
1. Declare external component. Read [the manual](https://esphome.io/components/external_components.html?highlight=external) for details.
|
||||
```yaml
|
||||
esphome:
|
||||
name: $devicename
|
||||
platform: ESP8266
|
||||
board: esp12e
|
||||
includes:
|
||||
- aux_ac_custom_component.h
|
||||
external_components:
|
||||
- source:
|
||||
type: git
|
||||
url: https://github.com/GrKoR/esphome_aux_ac_component
|
||||
```
|
||||
3. Configure UART to communicate with air conditioner:
|
||||
2. Configure UART to communicate with air conditioner:
|
||||
```yaml
|
||||
uart:
|
||||
id: ac_uart_bus
|
||||
@@ -141,28 +57,88 @@ uart:
|
||||
parity: EVEN
|
||||
stop_bits: 1
|
||||
```
|
||||
4. ESP8266 has two hardware UARTs: UART0 and UART1. Only UART0 suits for `aux_ac` cause only it has both TX and RX. In **uart:** section above we configure UART0 for `aux_ac`. But it used by **logger:**. So it is necessary to redefine UART for logger or switch it off:
|
||||
3. **ATTENTION!** You need to disable the ESPHome logger so that it does not send its data to the air conditioner. Disabling the logger from the UART bus will not affect the logger output to the console or web server in any way.
|
||||
```yaml
|
||||
logger:
|
||||
baud_rate: 0
|
||||
```
|
||||
If for some reason you need the logger output to the UART, you can switch it to another UART. ESP8266 has two hardware UARTs: UART0 and UART1. Only UART0 suits for `aux_ac` cause only it has both TX and RX. UART1 has TX only and it can be used by logger for output:
|
||||
```yaml
|
||||
logger:
|
||||
level: DEBUG
|
||||
baud_rate: 0
|
||||
# set hardware_uart to UART1 and comment out baud_rate above in case of boot crashes
|
||||
# it is suitable if you need hardware loggin
|
||||
# hardware_uart: UART1
|
||||
hardware_uart: UART1
|
||||
```
|
||||
5. Finally define climate component:
|
||||
|
||||
## AUX_AC Configuration ##
|
||||
Minimal configuration:
|
||||
```yaml
|
||||
climate:
|
||||
- platform: custom
|
||||
lambda: |-
|
||||
extern AirCon acAirCon;
|
||||
if (!acAirCon.get_initialized()) acAirCon.initAC(id(ac_uart_bus));
|
||||
App.register_component(&acAirCon);
|
||||
return {&acAirCon};
|
||||
climates:
|
||||
- name: "My awesome air conditioner"
|
||||
- platform: aux_ac
|
||||
name: "AC Name"
|
||||
```
|
||||
|
||||
Full configuration:
|
||||
```yaml
|
||||
climate:
|
||||
- platform: aux_ac
|
||||
name: "AC Name"
|
||||
id: aux_id
|
||||
uart_id: ac_uart_bus
|
||||
period: 7s
|
||||
show_action: true
|
||||
indoor_temperature:
|
||||
name: AC Indoor Temperature
|
||||
id: ac_indoor_temp
|
||||
internal: true
|
||||
visual:
|
||||
min_temperature: 16
|
||||
max_temperature: 32
|
||||
temperature_step: 0.5
|
||||
supported_modes:
|
||||
- HEAT_COOL
|
||||
- COOL
|
||||
- HEAT
|
||||
- DRY
|
||||
- FAN_ONLY
|
||||
custom_fan_modes:
|
||||
- MUTE
|
||||
- TURBO
|
||||
supported_presets:
|
||||
- SLEEP
|
||||
custom_presets:
|
||||
- CLEAN
|
||||
- FEEL
|
||||
- HEALTH
|
||||
- ANTIFUNGUS
|
||||
supported_swing_modes:
|
||||
- VERTICAL
|
||||
- HORIZONTAL
|
||||
- BOTH
|
||||
```
|
||||
|
||||
## Configuration variables: ##
|
||||
- **name** (**Required**, string): The name of the climate device. At least one of `id` or `name` is required!
|
||||
- **id** (*Optional*, [ID](https://esphome.io/guides/configuration-types.html#config-id)): Manually specify the ID used for code generation. At least one of `id` or `name` is required!
|
||||
- **uart_id** (*Optional*, [ID](https://esphome.io/guides/configuration-types.html#config-id)): Manually specify the ID of the [UART Bus](https://esphome.io/components/uart.html) if you want to use multiple UART buses.
|
||||
- **period** (*Optional*, [time](https://esphome.io/guides/configuration-types.html#config-time)): Period between status requests to the AC. Defaults to ``7s``. `Aux_ac` will receive the new air conditioner status only after a regular request, even if you change the settings of AC using IR-remote.
|
||||
- **show_action** (*Optional*, boolean): Whether to show current action of the device (experimental). For example in the HEAT-COOL mode AC hardware may be in one of the following actions:
|
||||
- HEATING: AC is heating the air in the room;
|
||||
- IDLE: AC is working in the FAN mode cause the target temperature is reached;
|
||||
- COOLING: AC is cooling the air.
|
||||
The same thing will be in HEAT or COOL modes, with the only difference of the list of actions (IDLE + HEATING or IDLE + COOLING).
|
||||
- **indoor_temperature** (*Optional*): The information for the air temperature sensor
|
||||
- **name** (**Required**, string): The name for the temperature sensor.
|
||||
- **id** (*Optional*, [ID](https://esphome.io/guides/configuration-types.html#config-id)): Set the ID of this sensor for use in lambdas.
|
||||
- **internal** (*Optional*, boolean): Mark this component as internal. Internal components will not be exposed to the frontend (like Home Assistant). As opposed to default [Sensor](https://esphome.io/components/sensor/index.html#base-sensor-configuration) behaviour this variable is **always true** except in cases where the user has set it directly.
|
||||
- All other options from [Sensor](https://esphome.io/components/sensor/index.html#base-sensor-configuration).
|
||||
- **supported_modes** (*Optional*, list): List of supported modes. Possible values are: ``HEAT_COOL``, ``COOL``, ``HEAT``, ``DRY``, ``FAN_ONLY``. Please note: some manufacturers call AUTO mode instead of HEAT_COOL. Defaults to ``FAN_ONLY``.
|
||||
- **custom_fan_modes** (*Optional*, list): List of supported custom fan modes. Possible values are: ``MUTE``, ``TURBO``. No custom fan modes by default.
|
||||
- **supported_presets** (*Optional*, list): List of supported presets. Possible values are: ``SLEEP``. No presets by default.
|
||||
- **custom_presets** (*Optional*, list): List of supported custom presets. Possible values are: ``CLEAN``, ``FEEL``, ``HEALTH``, ``ANTIFUNGUS``. Please note: presets ``FEEL``, ``HEALTH`` and ``ANTIFUNGUS`` have not been implemented yet. No custom presets by default.
|
||||
- **supported_swing_modes** (*Optional*, list): List of supported swing modes. Possible values are: ``VERTICAL``, ``HORIZONTAL``, ``BOTH``. No swing modes by default.
|
||||
- All other options from [Climate](https://esphome.io/components/climate/index.html#base-climate-configuration).
|
||||
|
||||
|
||||
## Simple example ##
|
||||
The source code of this example is located in the [aux_ac_simple.yaml](https://github.com/GrKoR/esphome_aux_ac_component/blob/master/examples/simple/aux_ac_simple.yaml) file.
|
||||
|
||||
@@ -179,72 +155,3 @@ All specific parts of configuration are located in the `ac_kitchen.yaml` and `ac
|
||||
**Don't forget** to specify `wifi_ip_kitchen`, `wifi_ota_ip_kitchen`, `wifi_ip_livingroom` and `wifi_ota_ip_livingroom` in the `secrets.yaml` along with the other sensitive information, such as passwords, tokens etc.
|
||||
|
||||
If you try to compile `ac_common.yaml` it will raise errors. You need to compile `ac_kitchen.yaml` or `ac_livingroom.yaml` instead.
|
||||
|
||||
## Additional functionality ##
|
||||
`Aux_ac` component provides three additional sensors: two temperatures and firmware version.
|
||||
|
||||
### Ambient temperature ###
|
||||
This is the current room air temperature from AC's sensor. If you need it in your configuration place this code to YAML file:
|
||||
```yaml
|
||||
sensor:
|
||||
- platform: custom
|
||||
lambda: |-
|
||||
extern AirCon acAirCon;
|
||||
if (!acAirCon.get_initialized()) acAirCon.initAC(id(ac_uart_bus));
|
||||
App.register_component(&acAirCon);
|
||||
return {acAirCon.sensor_ambient_temperature};
|
||||
sensors:
|
||||
- name: AC ambient temperature
|
||||
unit_of_measurement: "°C"
|
||||
accuracy_decimals: 1
|
||||
```
|
||||
|
||||
### Outdoor temperature ###
|
||||
Currently it shows weather on Mars =) Maybe it will change if we get more statistics and some smart guys for decoding.<br />
|
||||
If in spite of everything, you still want it in your configuration, just use this code:
|
||||
```yaml
|
||||
sensor:
|
||||
- platform: custom
|
||||
lambda: |-
|
||||
extern AirCon acAirCon;
|
||||
if (!acAirCon.get_initialized()) acAirCon.initAC(id(ac_uart_bus));
|
||||
App.register_component(&acAirCon);
|
||||
return {acAirCon.sensor_outdoor_temperature};
|
||||
sensors:
|
||||
- name: AC outdoor temperature
|
||||
unit_of_measurement: "°C"
|
||||
accuracy_decimals: 1
|
||||
```
|
||||
|
||||
### Both temperatures in one declaration ###
|
||||
It is possible to add room and outdoor temperatures to your configuration with one yaml block:
|
||||
```yaml
|
||||
sensor:
|
||||
- platform: custom
|
||||
lambda: |-
|
||||
extern AirCon acAirCon;
|
||||
if (!acAirCon.get_initialized()) acAirCon.initAC(id(ac_uart_bus));
|
||||
App.register_component(&acAirCon);
|
||||
return {acAirCon.sensor_outdoor_temperature, acAirCon.sensor_ambient_temperature};
|
||||
sensors:
|
||||
- name: AC outdoor temperature
|
||||
unit_of_measurement: "°C"
|
||||
accuracy_decimals: 1
|
||||
- name: AC ambient temperature
|
||||
unit_of_measurement: "°C"
|
||||
accuracy_decimals: 1
|
||||
```
|
||||
|
||||
### Firmware version ###
|
||||
`Aux_ac` component also gives information about source code version. You can add it to your config with this code:
|
||||
```yaml
|
||||
text_sensor:
|
||||
- platform: custom
|
||||
lambda: |-
|
||||
auto aircon_firmware_version = new AirConFirmwareVersion();
|
||||
App.register_component(aircon_firmware_version);
|
||||
return {aircon_firmware_version};
|
||||
text_sensors:
|
||||
name: AC firmware version
|
||||
icon: "mdi:chip"
|
||||
```
|
||||
|
||||
125
README.md
125
README.md
@@ -1,6 +1,6 @@
|
||||
# Кастомный компонент для ESPHome для управления кондиционером по wifi <!--[](https://github.com/GrKoR/esphome_aux_ac_component/releases/) [](https://t.me/aux_ac) -->
|
||||
|
||||
Readme in english [is here](README-EN.md#esphome-aux-air-conditioner-custom-component-aux_ac).
|
||||
English readme [is here](README-EN.md#esphome-aux-air-conditioner-custom-component-aux_ac).
|
||||
|
||||
Управляет кондиционерами на базе AUX по wifi.<br />
|
||||
По тексту ниже для компонента используется сокращение `aux_ac`.
|
||||
@@ -22,11 +22,11 @@ AUX - это один из нескольких OEM-производителей
|
||||
|
||||
|
||||
### Список совместимых (протестированных) кондиционеров ###
|
||||
[Список протестированных кондиционеров](docs/AC_TESTED.md) включает те модели, на которых `aux_ac` был запущен автором компонента или пользователями. Этот список постоянно пополняется, преимущественно по обратной связи от пользователей [в чате Телеграм](https://t.me/aux_ac).<br />
|
||||
[Список протестированных кондиционеров](docs/AC_TESTED.md) размещен в отдельном файле и включает те модели, на которых `aux_ac` был запущен автором компонента или пользователями. Этот список постоянно пополняется, преимущественно по обратной связи от пользователей [в чате Телеграм](https://t.me/aux_ac).<br />
|
||||
|
||||
### Если кондиционер в списке отсутствует ###
|
||||
Если производитель вашего кондиционера есть в списке выше, то стоит изучить вопрос. Возможно, вам тоже подойдет `aux_ac` для управления по wifi.<br />
|
||||
Если в инструкции пользователя вашего кондиционера что-то написано про возможность управления по wifi (особенно с помощью мобильного приложения ACFreedom), то есть весьма существенные шансы, что `aux_ac` сможет управлять и вашим кондиционером. Но будьте осмотрительны: ваш кондиционер никем не тестировался и важно четко понимать, что вы делаете. Иначе можете поломать кондиционер.<br />
|
||||
Если в инструкции пользователя вашего кондиционера что-то написано про возможность управления по wifi (особенно с помощью мобильного приложения ACFreedom), то есть весьма существенные шансы, что `aux_ac` сможет управлять и вашим кондиционером. Но будьте осмотрительны: ваш кондиционер никем не тестировался и важно четко понимать, что вы делаете. Иначе можете наломать дров.<br />
|
||||
Если вы не уверены в своих силах, лучше дождитесь, пока другие более опытные пользователи протестируют вашу модель кондиционера (правда, это может не случиться никогда). Или приходите с вопросами [в телеграм-чат](https://t.me/aux_ac). Возможно, там вам помогут.
|
||||
|
||||
Если вы протестировали ваш кондиционер и он работает, напишите мне, пожалуйста. Я внесу вашу модель в список протестированных. Возможно, это упростит кому-то жизнь =)<br />
|
||||
@@ -38,7 +38,7 @@ AUX - это один из нескольких OEM-производителей
|
||||
### Прошивка: интеграция aux_ac в вашу конфигурацию ESPHome ###
|
||||
Для использования требуется [ESPHome](https://esphome.io) версией не ниже 1.18.0. Именно в этой версии появились `external_components`. Но лучше использовать версию 1.20.4 или старше, так как до этой версии массированно исправлялись ошибки в механизме подключения внешних компонентов.<br />
|
||||
|
||||
## Установка
|
||||
## Установка ##
|
||||
1. Подключите компонент.
|
||||
За подробностями можно заглянуть в [официальную документацию ESPHome](https://esphome.io/components/external_components.html?highlight=external).
|
||||
```yaml
|
||||
@@ -72,25 +72,32 @@ logger:
|
||||
```
|
||||
|
||||
## Настройка компонента ##
|
||||
Минимальная конфигурация:
|
||||
```yaml
|
||||
climate:
|
||||
- platform: aux_ac
|
||||
name: "AC Name"
|
||||
```
|
||||
|
||||
Полная конфигурация:
|
||||
```yaml
|
||||
climate:
|
||||
- platform: aux_ac
|
||||
name: "AC Name"
|
||||
id: aux_id
|
||||
uart_id: ac_uart_bus
|
||||
period: 7s # период опроса состояния сплита, по дефолту 7 сек
|
||||
show_action: true # надо ли показывать текущий режим работы: при HEAT_COOL mode сплит может греть (HEAT), охлаждать (COOL) или бездействовать (IDLE)
|
||||
indoor_temperature: # сенсор, показывающий температуру воздуха на внутреннем блоке кондиционера; имеет все те же параметры, как и любой сенсор ESPHome
|
||||
period: 7s
|
||||
show_action: true
|
||||
indoor_temperature:
|
||||
name: AC Indoor Temperature
|
||||
id: ac_indoor_temp
|
||||
internal: true # сенсор установлен как внутренний по дефолту (не попадёт в Home Assistant)
|
||||
internal: true
|
||||
visual:
|
||||
min_temperature: 16
|
||||
max_temperature: 32
|
||||
temperature_step: 0.5
|
||||
supported_modes:
|
||||
- HEAT_COOL # не AUTO, так как только нагревает и остужает. В доках на ESPHome говорится, что AUTO - это если у устройства есть календарь и какие-то установки по расписанию.
|
||||
- HEAT_COOL
|
||||
- COOL
|
||||
- HEAT
|
||||
- DRY
|
||||
@@ -111,91 +118,43 @@ climate:
|
||||
- BOTH
|
||||
```
|
||||
|
||||
## Параметры компонента: ##
|
||||
- **name** (**Обязательный**, строка): Имя кондиционера. Как минимум один из параметров `id` или `name` должен быть указан!
|
||||
- **id** (*Опциональный*, [ID](https://esphome.io/guides/configuration-types.html#config-id)): Укажите идентификатор кондиционера чтобы обращаться к нему из кода. Как минимум один из параметров `id` или `name` должен быть указан!
|
||||
- **uart_id** (*Опциональный*, [ID](https://esphome.io/guides/configuration-types.html#config-id)): Укажите ID [шины UART](https://esphome.io/components/uart.html), к которой подключен кондиционер. Если сконфигурирована одна шина, то компонент подключит её автоматически. Если шин несколько, то лучше указать вручную.
|
||||
- **period** (*Опциональный*, [время](https://esphome.io/guides/configuration-types.html#config-time)): Период между запросами статуса кондиционера. По умолчанию ``7s``. `Aux_ac` получает новое состояние кондиционера только после регулярного запроса, потому что сам кондиционер об изменении параметров своеё работы не уведомляет. Поэтому нужно запрашивать его, вдруг пользователь установил иной режим работы с помощью ИК-пульта.
|
||||
- **show_action** (*Опциональный*, логическое): Показывать ли текущую задачу кондиционера (экспериментальная функция). Например, в режиме HEAT-COOL кондиционер может выполнять одну из следующих задач:
|
||||
- НАГРЕВ: нагревает воздух в комнате;
|
||||
- ПРОСТОЙ: кондиционер работает в режиме вентилятора для перемешивания воздуха в комнате, поскольку целевая температура уже достигнута;
|
||||
- ОХЛАЖДЕНИЕ: кондиционер охлаждает воздух в комнате.
|
||||
Аналогично будут отображаться действия кондиционера и для режимов ОТОПЛЕНИЕ и ОХЛАЖДЕНИЕ. Единственная разница будет в количестве действий: ПРОСТОЙ+НАГРЕВ для режима отопления и ПРОСТОЙ+ОХЛАЖДЕНИЕ для режима охлаждения комнаты.
|
||||
- **indoor_temperature** (*Опциональный*): Параметры создаваемого датчика температуры воздуха, если такой датчик нужен
|
||||
- **name** (**Обязательный**, строка): Имя датчика температуры.
|
||||
- **id** (*Опциональный*, [ID](https://esphome.io/guides/configuration-types.html#config-id)): Можно указать свой ID для датчика для использования в лямбдах.
|
||||
- **internal** (*Опциональный*, логическое): Пометить данный датчик как внутренний. Внутренний датчик не будет передаваться во фронтэнд (такой как Home Assistant). В противоположность стандартному поведению [сенсоров](https://esphome.io/components/sensor/index.html#base-sensor-configuration) этот параметр для датчика в кондиционере **всегда выставлен в true** за исключением случаев, когда пользователь не установил его в `false`. То есть по умолчанию значение сенсора не будет передаваться во фронтенд даже если указано `name` для сенсора.
|
||||
- Все остальные параметры [сенсора](https://esphome.io/components/sensor/index.html#base-sensor-configuration) ESPHome.
|
||||
- **supported_modes** (*Опциональный*, список): Список поддерживаемых режимов работы. Возможные значения: ``HEAT_COOL``, ``COOL``, ``HEAT``, ``DRY``, ``FAN_ONLY``. Обратите внимание: некоторые производители кондиционеров указывают на пульте режим AUTO, хотя по факту этот режим не работает по расписанию и только лишь поддерживает целевую температуру. Такой режим в ESPHome называется HEAT_COOL. По умолчанию список содержит только значение ``FAN_ONLY``.
|
||||
- **custom_fan_modes** (*Опциональный*, список): Список поддерживаемых дополнительных режимов вентилятора. Возможные значения: ``MUTE``, ``TURBO``. По умолчанию никакие дополнительные режимы не установлены.
|
||||
- **supported_presets** (*Опциональный*, список): Список поддерживаемых базовых функций кондиционера. Возможные значения: ``SLEEP``. По умолчанию никакие базовые функции не установлены.
|
||||
- **custom_presets** (*Опциональный*, список): Список поддерживаемых дополнительных функций кондиционера. Возможные значения: ``CLEAN``, ``FEEL``, ``HEALTH``, ``ANTIFUNGUS``. Обратите внимание: функции ``FEEL``, ``HEALTH`` и ``ANTIFUNGUS`` пока не в компоненте реализованы. По умолчанию никакие дополнительные функции не установлены.
|
||||
- **supported_swing_modes** (*Опциональный*, список): Список поддерживаемых режимов качания шторки. Возможные значения: ``VERTICAL``, ``HORIZONTAL``, ``BOTH``. По умолчанию устанавливается, что качание шторки кондиционером не поддерживается.
|
||||
- Все остальные параметры [климатического устройства](https://esphome.io/components/climate/index.html#base-climate-configuration) ESPHome.
|
||||
|
||||
|
||||
## Простейший пример ##
|
||||
Исходный код простейшего примера можно найти в файле [aux_ac_simple.yaml](https://github.com/GrKoR/esphome_aux_ac_component/blob/master/examples/simple/aux_ac_simple.yaml).
|
||||
|
||||
Все настройки в нем тривиальны и подробно описаны [в официальной документации на ESPHome](https://esphome.io/index.html) и дополнены [в разделе об интеграции компонента](https://github.com/GrKoR/esphome_aux_ac_component#%D0%BF%D1%80%D0%BE%D1%88%D0%B8%D0%B2%D0%BA%D0%B0-%D0%B8%D0%BD%D1%82%D0%B5%D0%B3%D1%80%D0%B0%D1%86%D0%B8%D1%8F-aux_ac-%D0%B2-%D0%B2%D0%B0%D1%88%D1%83-%D0%BA%D0%BE%D0%BD%D1%84%D0%B8%D0%B3%D1%83%D1%80%D0%B0%D1%86%D0%B8%D1%8E-esphome) в ваш девайс.<br />
|
||||
Просто скопируйте yaml-файл примера и `aux_ac_custom_component.h` в локальную папку у себя на компьютере, пропишите настройки вашей сети WiFi и откомпилируйте YAML с использованием ESPHome.
|
||||
Все настройки в нем тривиальны и подробно описаны [в официальной документации на ESPHome](https://esphome.io/index.html) и дополнены в разделе о настройке компонента выше.<br />
|
||||
Просто скопируйте yaml-файл примера в локальную папку у себя на компьютере, пропишите настройки вашей сети WiFi и откомпилируйте YAML с использованием ESPHome.
|
||||
|
||||
|
||||
## Продвинутый пример ##
|
||||
Все исходники продвинутого примера лежат [в соответствующей папке](https://github.com/GrKoR/esphome_aux_ac_component/tree/master/examples/advanced).
|
||||
|
||||
В это примере мы конфигурируем два относительно одинаковых кондиционера на работу с `aux_ac`.<br />
|
||||
В этом примере мы конфигурируем два относительно одинаковых кондиционера на работу с `aux_ac`.<br />
|
||||
Вводные: представим, что у нас есть два кондея, расположенных в кухне и в гостиной. Эти кондиционеры могут и не быть одного бренда. Главное, чтобы они были совместимы с `aux_ac`.<br />
|
||||
Поскольку мы ленивы, мы пропишем все общие настройки обоих кондиционеров в общем конфигурационном файле `ac_common.yaml`.<br />
|
||||
А все параметры, специфичные для каждого конкретного устройства, вынесем в отдельные файлы. Это файлы `ac_kitchen.yaml` и `ac_livingroom.yaml`. В них мы установим значения для подстановок `devicename` и `upper_devicename`, чтобы у устройств в сети были корректные имена самого компонента и его сенсоров. И здесь же мы указываем уникальные для каждого устройства IP-адреса, спрятанные в `secrets.yaml`.<br />
|
||||
Кстати да! **Не забудьте** присвоить корректные значения `wifi_ip_kitchen`, `wifi_ota_ip_kitchen`, `wifi_ip_livingroom` и `wifi_ota_ip_livingroom` в файле `secrets.yaml` наряду с остальной "секретной" информацией (например пароли, токены и т.п.). Файл `secrets.yaml` по понятным причинам на гитхаб не выложен.
|
||||
|
||||
Если попытаться компилировать файл `ac_common.yaml`, то ESPHome выдаст ошибку. Для корректной прошивки необходимо компилировать `ac_kitchen.yaml` или `ac_livingroom.yaml`.
|
||||
|
||||
## Дополнительная функциональность ##
|
||||
Компонент `aux_ac` предоставляет три дополнительных сенсора: два значения температуры и один номер версии прошивки.
|
||||
|
||||
### Комнатная температура ###
|
||||
Этот сенсор отдает значения комнатной температуры воздуха с внутреннего блока кондиционера. Если значение этого датчика вам нужно, пропишите подобную конфигурацию сенсора в вашем YAML-файле:
|
||||
```yaml
|
||||
sensor:
|
||||
- platform: custom
|
||||
lambda: |-
|
||||
extern AirCon acAirCon;
|
||||
if (!acAirCon.get_initialized()) acAirCon.initAC(id(ac_uart_bus));
|
||||
App.register_component(&acAirCon);
|
||||
return {acAirCon.sensor_ambient_temperature};
|
||||
sensors:
|
||||
- name: AC ambient temperature
|
||||
unit_of_measurement: "°C"
|
||||
accuracy_decimals: 1
|
||||
```
|
||||
|
||||
### Уличная температура ###
|
||||
К сожалению, пока этот сенсор показывает погоду на Марсе =) Значение, обрабатываемое `aux_ac` для нужд этого сенсора точно как-то связано с уличной температурой, но полностью расшифровка значения не известна. Есть предположение, что это температура испарителя во внешнем блоке, потому что при переключении кондиционера с обогрева на охлаждение или обратно эта температура стремительно меняется. А при выключенном кондиционере в течение суток меняется похожим на уличную температуру образом. Однако всё это при теплой погоде на улице. При отрицательной температуре показывает одно и то же значение. По крайней мере при температурах в диапазоне -25..-19 градусов Цельсия.<br />
|
||||
В общем, для расшифровки надо собрать больше статистики и коллективно подумать в чатике.
|
||||
|
||||
Если несмотря на сказанное вам нужно это значение в ESPHome, пропишите следующий сенсор в конфигурации:
|
||||
```yaml
|
||||
sensor:
|
||||
- platform: custom
|
||||
lambda: |-
|
||||
extern AirCon acAirCon;
|
||||
if (!acAirCon.get_initialized()) acAirCon.initAC(id(ac_uart_bus));
|
||||
App.register_component(&acAirCon);
|
||||
return {acAirCon.sensor_outdoor_temperature};
|
||||
sensors:
|
||||
- name: AC outdoor temperature
|
||||
unit_of_measurement: "°C"
|
||||
accuracy_decimals: 1
|
||||
```
|
||||
|
||||
### Обе температуры одновременно ###
|
||||
Возможно прописать конфигурацию обоих сенсоров в одном определении:
|
||||
```yaml
|
||||
sensor:
|
||||
- platform: custom
|
||||
lambda: |-
|
||||
extern AirCon acAirCon;
|
||||
if (!acAirCon.get_initialized()) acAirCon.initAC(id(ac_uart_bus));
|
||||
App.register_component(&acAirCon);
|
||||
return {acAirCon.sensor_outdoor_temperature, acAirCon.sensor_ambient_temperature};
|
||||
sensors:
|
||||
- name: AC outdoor temperature
|
||||
unit_of_measurement: "°C"
|
||||
accuracy_decimals: 1
|
||||
- name: AC ambient temperature
|
||||
unit_of_measurement: "°C"
|
||||
accuracy_decimals: 1
|
||||
```
|
||||
|
||||
### Версия прошивки ###
|
||||
Компонент `aux_ac` предоставляет информацию о своей версии в виде текстового сенсора. Соответствующая конфигурация показана ниже:
|
||||
```yaml
|
||||
text_sensor:
|
||||
- platform: custom
|
||||
lambda: |-
|
||||
auto aircon_firmware_version = new AirConFirmwareVersion();
|
||||
App.register_component(aircon_firmware_version);
|
||||
return {aircon_firmware_version};
|
||||
text_sensors:
|
||||
name: AC firmware version
|
||||
icon: "mdi:chip"
|
||||
```
|
||||
|
||||
@@ -2152,7 +2152,7 @@ class AirCon : public esphome::Component, public esphome::climate::Climate {
|
||||
//traits.add_supported_swing_mode(ClimateSwingMode::CLIMATE_SWING_VERTICAL);
|
||||
//traits.add_supported_swing_mode(ClimateSwingMode::CLIMATE_SWING_BOTH);
|
||||
traits.add_supported_preset(ClimatePreset::CLIMATE_PRESET_NONE);
|
||||
traits.add_supported_preset(ClimatePreset::CLIMATE_PRESET_SLEEP);
|
||||
//traits.add_supported_preset(ClimatePreset::CLIMATE_PRESET_SLEEP);
|
||||
|
||||
/* *************** TODO: надо сделать информирование о текущем режиме, сплит поддерживает ***************
|
||||
* смотри climate::ClimateAction
|
||||
|
||||
@@ -71,7 +71,7 @@ CUSTOM_PRESETS = {
|
||||
validate_custom_presets = cv.enum(CUSTOM_PRESETS, upper=True)
|
||||
|
||||
def output_info(config):
|
||||
_LOGGER.info(config)
|
||||
"""_LOGGER.info(config)"""
|
||||
return config
|
||||
|
||||
CONFIG_SCHEMA = cv.All(
|
||||
@@ -104,6 +104,8 @@ CONFIG_SCHEMA = cv.All(
|
||||
)
|
||||
|
||||
async def to_code(config):
|
||||
"""_LOGGER.info("--------------")"""
|
||||
"""_LOGGER.info(config)"""
|
||||
var = cg.new_Pvariable(config[CONF_ID])
|
||||
await cg.register_component(var, config)
|
||||
await climate.register_climate(var, config)
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
## Hardware ##
|
||||
I tested it with an esp8266 chip (esp-12e). Minimal scheme:<br />
|
||||

|
||||
|
||||
At the first time in addition to scheme above IO0 (GPIO0) must be pulled down to GND at the boot and ESPHome can be uploaded through UART0. If your ESPHome configuration contains OTA you can pull up IO0 or leave it floating. All further updates can be uploaded over-the-air.<br />
|
||||
I leave GPIO0 in air cause I don't see any reason to solder additional components for single use.
|
||||
|
||||
ESP-12E before DC-DC and air conditioner connected:<br />
|
||||

|
||||
|
||||
Air conditioner internal block has a 5-wire connection to the wifi-module. Connector is [JST SM](https://www.jst-mfg.com/product/pdf/eng/eSM.pdf).
|
||||
|
||||
Wires:
|
||||
1. Yellow: +14V DC. Measured +14.70V max and +13.70V min. Service manual declares up to +16V.
|
||||
2. Black: ground.
|
||||
3. White: +5V DC (max: +5.63V; min: +4.43V) I have no idea what this is for. It goes directly to the air conditioner microcontroller through resistor 1kOhm and it does not affect the operation of the module.
|
||||
4. Blue: TX of air conditioner. High is +5V.
|
||||
5. Red: RX of air conditioner. High is +5V.
|
||||
|
||||
For power supply it is possible to use any kind of suitable modules. I use this:<br />
|
||||
.
|
||||
|
||||
Black wire of AC's connector goes to the middle pin of the power module and to the GND pin of esp-12e.<br />
|
||||
Yellow wire is connected to the Vin pin of the power module.<br />
|
||||
Blue wire is connected to the RXD pin of esp-12e.<br />
|
||||
Red wire is connected to the TXD pin of esp-12e.<br />
|
||||
|
||||
Here is it:<br />
|
||||

|
||||
|
||||
All connections in custom 3d-printed case looks like this:<br />
|
||||

|
||||
|
||||
Cause I haven't JST SM connector I made own:<br />
|
||||
.
|
||||
|
||||
It is made of standard 2.54mm pins and 3D-printed case.<br />
|
||||
All models for 3D-printing are available too: [STL-files for connector](https://github.com/GrKoR/esphome_aux_ac_component/tree/master/enclosure/JST%20SM%20connector), [models of case parts](https://github.com/GrKoR/esphome_aux_ac_component/tree/master/enclosure/case).
|
||||
|
||||
Here is the result:<br />
|
||||
<br />
|
||||
<br />
|
||||

|
||||
@@ -1,12 +1,14 @@
|
||||
# DON'T COMPILE THIS FILE
|
||||
# This file contains common settings for all air conditioners of your house
|
||||
external_components:
|
||||
- source: github://GrKoR/esphome_aux_ac_component
|
||||
components: [ aux_ac ]
|
||||
refresh: 0s
|
||||
|
||||
esphome:
|
||||
name: $devicename
|
||||
platform: ESP8266
|
||||
board: esp12e
|
||||
includes:
|
||||
- aux_ac_custom_component.h
|
||||
|
||||
wifi:
|
||||
ssid: !secret wifi_ssid
|
||||
@@ -55,16 +57,40 @@ uart:
|
||||
|
||||
|
||||
climate:
|
||||
# register custom AC climate
|
||||
- platform: custom
|
||||
lambda: |-
|
||||
extern AirCon acAirCon;
|
||||
if (!acAirCon.get_initialized()) acAirCon.initAC(id(ac_uart_bus));
|
||||
App.register_component(&acAirCon);
|
||||
return {&acAirCon};
|
||||
climates:
|
||||
- name: ${upper_devicename}
|
||||
|
||||
- platform: aux_ac
|
||||
name: ${upper_devicename}
|
||||
id: aux_id
|
||||
uart_id: ac_uart_bus
|
||||
period: 7s
|
||||
show_action: true
|
||||
indoor_temperature:
|
||||
name: ${upper_devicename} AC Indoor Temperature
|
||||
id: ac_indoor_temp
|
||||
internal: true
|
||||
visual:
|
||||
min_temperature: 16
|
||||
max_temperature: 32
|
||||
temperature_step: 0.5
|
||||
supported_modes:
|
||||
- HEAT_COOL
|
||||
- COOL
|
||||
- HEAT
|
||||
- DRY
|
||||
- FAN_ONLY
|
||||
custom_fan_modes:
|
||||
- MUTE
|
||||
- TURBO
|
||||
supported_presets:
|
||||
- SLEEP
|
||||
custom_presets:
|
||||
- CLEAN
|
||||
- FEEL
|
||||
- HEALTH
|
||||
- ANTIFUNGUS
|
||||
supported_swing_modes:
|
||||
- VERTICAL
|
||||
- HORIZONTAL
|
||||
- BOTH
|
||||
|
||||
|
||||
sensor:
|
||||
@@ -74,33 +100,3 @@ sensor:
|
||||
update_interval: 30s
|
||||
unit_of_measurement: "dBa"
|
||||
accuracy_decimals: 0
|
||||
|
||||
- platform: custom
|
||||
# temperature sensors of AC
|
||||
# outdoor temperature currently shows weather on Mars; need more statistics and some smart guys for decoding =)
|
||||
# ambient temperature is an air temperature from indor AC unit
|
||||
lambda: |-
|
||||
extern AirCon acAirCon;
|
||||
if (!acAirCon.get_initialized()) acAirCon.initAC(id(ac_uart_bus));
|
||||
App.register_component(&acAirCon);
|
||||
return {acAirCon.sensor_outdoor_temperature, acAirCon.sensor_ambient_temperature};
|
||||
sensors:
|
||||
- name: ${upper_devicename} outdoor temperature
|
||||
unit_of_measurement: "°C"
|
||||
accuracy_decimals: 1
|
||||
- name: ${upper_devicename} ambient temperature
|
||||
unit_of_measurement: "°C"
|
||||
accuracy_decimals: 1
|
||||
|
||||
|
||||
|
||||
text_sensor:
|
||||
# firmvare version - version of custom component
|
||||
- platform: custom
|
||||
lambda: |-
|
||||
auto aircon_firmware_version = new AirConFirmwareVersion();
|
||||
App.register_component(aircon_firmware_version);
|
||||
return {aircon_firmware_version};
|
||||
text_sensors:
|
||||
name: ${upper_devicename} firmware version
|
||||
icon: "mdi:chip"
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
external_components:
|
||||
- source: github://GrKoR/esphome_aux_ac_component
|
||||
components: [ aux_ac ]
|
||||
refresh: 0s
|
||||
|
||||
esphome:
|
||||
name: aux_air_conditioner
|
||||
platform: ESP8266
|
||||
board: esp12e
|
||||
includes:
|
||||
- aux_ac_custom_component.h
|
||||
|
||||
# don't forget to set your's wifi settings!
|
||||
wifi:
|
||||
@@ -39,34 +42,5 @@ uart:
|
||||
stop_bits: 1
|
||||
|
||||
climate:
|
||||
# register custom AC climate
|
||||
- platform: custom
|
||||
lambda: |-
|
||||
extern AirCon acAirCon;
|
||||
if (!acAirCon.get_initialized()) acAirCon.initAC(id(ac_uart_bus));
|
||||
App.register_component(&acAirCon);
|
||||
return {&acAirCon};
|
||||
climates:
|
||||
- name: AUX hvac
|
||||
|
||||
sensor:
|
||||
- platform: custom
|
||||
lambda: |-
|
||||
extern AirCon acAirCon;
|
||||
if (!acAirCon.get_initialized()) acAirCon.initAC(id(ac_uart_bus));
|
||||
App.register_component(&acAirCon);
|
||||
return {acAirCon.sensor_ambient_temperature};
|
||||
sensors:
|
||||
- name: AUX ambient temperature
|
||||
unit_of_measurement: "°C"
|
||||
accuracy_decimals: 1
|
||||
|
||||
text_sensor:
|
||||
- platform: custom
|
||||
lambda: |-
|
||||
auto aircon_firmware_version = new AirConFirmwareVersion();
|
||||
App.register_component(aircon_firmware_version);
|
||||
return {aircon_firmware_version};
|
||||
text_sensors:
|
||||
name: AUX firmware version
|
||||
icon: "mdi:chip"
|
||||
- platform: aux_ac
|
||||
name: "AC Name"
|
||||
Reference in New Issue
Block a user