mirror of
https://github.com/GrKoR/esphome_aux_ac_component.git
synced 2026-01-27 04:40:43 +03:00
Merge pull request #47 from GrKoR:dev
Added: + vertical louvers fixed positions + target temperature in AUTO mode + many internal sensors for temperature of HVAC elements + invertor power sensor + minor changes and improvements
This commit is contained in:
121
README-EN.md
121
README-EN.md
@@ -89,15 +89,44 @@ climate:
|
||||
indoor_temperature:
|
||||
name: AC Indoor Temperature
|
||||
id: ac_indoor_temp
|
||||
internal: true
|
||||
accuracy_decimals: 1
|
||||
internal: false
|
||||
outdoor_temperature:
|
||||
name: AC Outdoor Temperature
|
||||
id: ac_outdoor_temp
|
||||
internal: false
|
||||
outbound_temperature:
|
||||
name: AC Colant Outbound Temperature
|
||||
id: ac_outbound_temp
|
||||
internal: false
|
||||
inbound_temperature:
|
||||
name: AC Colant Inbound Temperature
|
||||
id: ac_inbound_temp
|
||||
internal: false
|
||||
compressor_temperature:
|
||||
name: AC Compressor Temperature
|
||||
id: ac_strange_temp
|
||||
internal: false
|
||||
display_state:
|
||||
name: AC Display
|
||||
id: ac_display
|
||||
name: AC Display State
|
||||
id: ac_display_state
|
||||
internal: false
|
||||
defrost_state:
|
||||
name: AC Defrost State
|
||||
id: ac_defrost_state
|
||||
internal: false
|
||||
invertor_power:
|
||||
name: AC Invertor Power
|
||||
id: ac_invertor_power
|
||||
internal: false
|
||||
preset_reporter:
|
||||
name: AC Preset Reporter
|
||||
id: ac_preset_reporter
|
||||
internal: false
|
||||
visual:
|
||||
min_temperature: 16
|
||||
max_temperature: 32
|
||||
temperature_step: 0.5
|
||||
temperature_step: 1
|
||||
supported_modes:
|
||||
- HEAT_COOL
|
||||
- COOL
|
||||
@@ -111,7 +140,6 @@ climate:
|
||||
- SLEEP
|
||||
custom_presets:
|
||||
- CLEAN
|
||||
- FEEL
|
||||
- HEALTH
|
||||
- ANTIFUNGUS
|
||||
supported_swing_modes:
|
||||
@@ -131,20 +159,28 @@ climate:
|
||||
- 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).
|
||||
- **display_inverted** (*Optional*, boolean, default ``false``): It configures display driver logic level. As it turned out in the issue [#31](https://github.com/GrKoR/esphome_aux_ac_component/issues/31), different models of conditioners manage display different way. Rovex ACs powers off display by bit `1` in command packet and power it on by bit `0`. Many other conditioners do this vice versa.
|
||||
- **indoor_temperature** (*Optional*): The information for the air temperature sensor
|
||||
- **indoor_temperature** (*Optional*): Parameters of the room 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).
|
||||
- **outdoor_temperature** (*Optional*): Parameters of the outdoor temperature sensor. Thay are the same as the **indoor_temperature** (see description above).
|
||||
- **inbound_temperature** (*Optional*): Parameters of the coolant inbound temperature sensor. Thay are the same as the **indoor_temperature** (see description above).
|
||||
- **outbound_temperature** (*Optional*): Parameters of the coolant outbound temperature sensor. Thay are the same as the **indoor_temperature** (see description above).
|
||||
- **compressor_temperature** (*Optional*): Parameters of the compressor temperature sensor. Thay are the same as the **indoor_temperature** (see description above).
|
||||
- **display_state** (*Optional*): The information for the HVAC display state sensor (is display ON or OFF)
|
||||
- **name** (**Required**, string): The name for the display state 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 [Binary Sensor](https://esphome.io/components/binary_sensor/index.html#base-binary-sensor-configuration) behaviour this variable is **always true** except in cases where the user has set it directly.
|
||||
- All other options from [Binary Sensor](https://esphome.io/components/binary_sensor/index.html#base-binary-sensor-configuration).
|
||||
- **defrost_state** (*Optional*): The information for the HVAC defrost function state sensor (is it ON or OFF). All settings are the same as for the **display_state** (see description above).
|
||||
- **invertor_power** (*Optional*): The information for the invertor power sensor. All settings are the same as for the **display_state** (see description above).
|
||||
- **preset_reporter** (*Optional*): Parameters of text sensor with current preset. All settings are the same as for the **display_state** (see description above).
|
||||
ESPHome Climate devices are not report their active presets (from **supported_presets** and **custom_presets** lists) to MQTT. In case you are using mqtt and want to receive information about active preset you should declare this sensor in your yaml.
|
||||
- **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.
|
||||
- **custom_presets** (*Optional*, list): List of supported custom presets. Possible values are: ``CLEAN``, ``HEALTH``, ``ANTIFUNGUS``. 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).
|
||||
|
||||
@@ -169,6 +205,77 @@ on_...:
|
||||
```
|
||||
- **aux_id** (**Requared**, string): ID of `aux_ac` component.
|
||||
|
||||
### ``aux_ac.vlouver_stop`` ###
|
||||
This action stops vertical swing of louvers.
|
||||
|
||||
```yaml
|
||||
on_...:
|
||||
then:
|
||||
- aux_ac.vlouver_stop: aux_id
|
||||
```
|
||||
- **aux_id** (**Requared**, string): ID of `aux_ac` component.
|
||||
|
||||
### ``aux_ac.vlouver_swing`` ###
|
||||
This action starts vertical swing of louvers.
|
||||
|
||||
```yaml
|
||||
on_...:
|
||||
then:
|
||||
- aux_ac.vlouver_swing: aux_id
|
||||
```
|
||||
- **aux_id** (**Requared**, string): ID of `aux_ac` component.
|
||||
|
||||
### ``aux_ac.vlouver_top`` ###
|
||||
This action moves HVAC louvers to the topmost position.
|
||||
|
||||
```yaml
|
||||
on_...:
|
||||
then:
|
||||
- aux_ac.vlouver_top: aux_id
|
||||
```
|
||||
- **aux_id** (**Requared**, string): ID of `aux_ac` component.
|
||||
|
||||
### ``aux_ac.vlouver_middle_above`` ###
|
||||
This action moves HVAC louvers to the position one step under the topmost.
|
||||
|
||||
```yaml
|
||||
on_...:
|
||||
then:
|
||||
- aux_ac.vlouver_middle_above: aux_id
|
||||
```
|
||||
- **aux_id** (**Requared**, string): ID of `aux_ac` component.
|
||||
|
||||
### ``aux_ac.vlouver_middle`` ###
|
||||
This action moves HVAC louvers to the middle position.
|
||||
|
||||
```yaml
|
||||
on_...:
|
||||
then:
|
||||
- aux_ac.vlouver_middle: aux_id
|
||||
```
|
||||
- **aux_id** (**Requared**, string): ID of `aux_ac` component.
|
||||
|
||||
### ``aux_ac.vlouver_middle_below`` ###
|
||||
This action moves HVAC louvers to the position one step under the middle position.
|
||||
|
||||
```yaml
|
||||
on_...:
|
||||
then:
|
||||
- aux_ac.vlouver_middle_below: aux_id
|
||||
```
|
||||
- **aux_id** (**Requared**, string): ID of `aux_ac` component.
|
||||
|
||||
### ``aux_ac.vlouver_bottom`` ###
|
||||
This action moves HVAC louvers to the lowest position.
|
||||
|
||||
```yaml
|
||||
on_...:
|
||||
then:
|
||||
- aux_ac.vlouver_bottom: aux_id
|
||||
```
|
||||
- **aux_id** (**Requared**, string): ID of `aux_ac` component.
|
||||
|
||||
|
||||
|
||||
## 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.
|
||||
|
||||
117
README.md
117
README.md
@@ -98,15 +98,44 @@ climate:
|
||||
indoor_temperature:
|
||||
name: AC Indoor Temperature
|
||||
id: ac_indoor_temp
|
||||
internal: true
|
||||
accuracy_decimals: 1
|
||||
internal: false
|
||||
outdoor_temperature:
|
||||
name: AC Outdoor Temperature
|
||||
id: ac_outdoor_temp
|
||||
internal: false
|
||||
outbound_temperature:
|
||||
name: AC Colant Outbound Temperature
|
||||
id: ac_outbound_temp
|
||||
internal: false
|
||||
inbound_temperature:
|
||||
name: AC Colant Inbound Temperature
|
||||
id: ac_inbound_temp
|
||||
internal: false
|
||||
compressor_temperature:
|
||||
name: AC Compressor Temperature
|
||||
id: ac_strange_temp
|
||||
internal: false
|
||||
display_state:
|
||||
name: AC Display
|
||||
id: ac_display
|
||||
name: AC Display State
|
||||
id: ac_display_state
|
||||
internal: false
|
||||
defrost_state:
|
||||
name: AC Defrost State
|
||||
id: ac_defrost_state
|
||||
internal: false
|
||||
invertor_power:
|
||||
name: AC Invertor Power
|
||||
id: ac_invertor_power
|
||||
internal: false
|
||||
preset_reporter:
|
||||
name: AC Preset Reporter
|
||||
id: ac_preset_reporter
|
||||
internal: false
|
||||
visual:
|
||||
min_temperature: 16
|
||||
max_temperature: 32
|
||||
temperature_step: 0.5
|
||||
temperature_step: 1
|
||||
supported_modes:
|
||||
- HEAT_COOL
|
||||
- COOL
|
||||
@@ -120,7 +149,6 @@ climate:
|
||||
- SLEEP
|
||||
custom_presets:
|
||||
- CLEAN
|
||||
- FEEL
|
||||
- HEALTH
|
||||
- ANTIFUNGUS
|
||||
supported_swing_modes:
|
||||
@@ -145,15 +173,23 @@ climate:
|
||||
- **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.
|
||||
- **outdoor_temperature** (*Опциональный*): Параметры создаваемого датчика уличной температуры воздуха, если такой датчик нужен. Параметры аналогичны датчику внутренней температуры **indoor_temperature** (см. выше).
|
||||
- **inbound_temperature** (*Опциональный*): Параметры создаваемого датчика температуры на подаче теплоносителя, если такой датчик нужен. Параметры аналогичны датчику внутренней температуры **indoor_temperature** (см. выше).
|
||||
- **outbound_temperature** (*Опциональный*): Параметры создаваемого датчика температуры на обратке теплоносителя, если такой датчик нужен. Параметры аналогичны датчику внутренней температуры **indoor_temperature** (см. выше).
|
||||
- **compressor_temperature** (*Опциональный*): Параметры создаваемого датчика температуры компрессора, если такой датчик нужен. Параметры аналогичны датчику внутренней температуры **indoor_temperature** (см. выше).
|
||||
- **display_state** (*Опциональный*): Параметры создаваемого датчика дисплея (включен или выключен), если такой датчик нужен.
|
||||
- **name** (**Обязательный**, строка): Имя датчика дисплея.
|
||||
- **id** (*Опциональный*, [ID](https://esphome.io/guides/configuration-types.html#config-id)): Можно указать свой ID для датчика для использования в лямбдах.
|
||||
- **internal** (*Опциональный*, логическое): Пометить данный датчик как внутренний. Внутренний датчик не будет передаваться во фронтэнд (такой как Home Assistant). В противоположность стандартному поведению [бинарных сенсоров](https://esphome.io/components/binary_sensor/index.html#base-binary-sensor-configuration) этот параметр для датчика в кондиционере **всегда выставлен в true** за исключением случаев, когда пользователь не установил его в `false`. То есть по умолчанию значение сенсора не будет передаваться во фронтенд даже если указано `name` для сенсора.
|
||||
- Все остальные параметры [бинарного сенсора](https://esphome.io/components/binary_sensor/index.html#base-binary-sensor-configuration) ESPHome.
|
||||
- **defrost_state** (*Опциональный*): Параметры создаваемого датчика состояния разморозки (включена или выключена), если такой датчик нужен. Параметры аналогичны датчику дисплея **display_state**.
|
||||
- **invertor_power** (*Опциональный*): Параметры создаваемого датчика мощности инвертора, если такой датчик нужен. Параметры аналогичны датчику дисплея **display_state**.
|
||||
- **preset_reporter** (*Опциональный*): Параметры создаваемого текстового датчика текущего активного пресета. Параметры аналогичны датчику дисплея **display_state**.
|
||||
Климатические устройства ESPHome не отправляют по MQTT активный пресет (см. **supported_presets** и **custom_presets**), в котором работает устройство. Если вы используете MQTT и хотите получать информацию о пресетах, то пропишите этот датчик в конфигурации.
|
||||
- **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`` пока не в компоненте реализованы. По умолчанию никакие дополнительные функции не установлены.
|
||||
- **custom_presets** (*Опциональный*, список): Список поддерживаемых дополнительных функций кондиционера. Возможные значения: ``CLEAN``, ``HEALTH``, ``ANTIFUNGUS``. По умолчанию никакие дополнительные функции не установлены.
|
||||
- **supported_swing_modes** (*Опциональный*, список): Список поддерживаемых режимов качания шторки. Возможные значения: ``VERTICAL``, ``HORIZONTAL``, ``BOTH``. По умолчанию устанавливается, что качание шторки кондиционером не поддерживается.
|
||||
- Все остальные параметры [климатического устройства](https://esphome.io/components/climate/index.html#base-climate-configuration) ESPHome.
|
||||
|
||||
@@ -178,6 +214,75 @@ on_...:
|
||||
```
|
||||
- **aux_id** (**Обязательный**, строка): ID компонента `aux_ac`.
|
||||
|
||||
### ``aux_ac.vlouver_stop`` ###
|
||||
Остановка вертикального движения жалюзи кондиционера. Если жалюзи качались в вертикальном направлении, то можно их остановить в нужном положении.
|
||||
|
||||
```yaml
|
||||
on_...:
|
||||
then:
|
||||
- aux_ac.vlouver_stop: aux_id
|
||||
```
|
||||
- **aux_id** (**Обязательный**, строка): ID компонента `aux_ac`.
|
||||
|
||||
### ``aux_ac.vlouver_swing`` ###
|
||||
Включение вертикального качания жалюзи кондиционера.
|
||||
|
||||
```yaml
|
||||
on_...:
|
||||
then:
|
||||
- aux_ac.vlouver_swing: aux_id
|
||||
```
|
||||
- **aux_id** (**Обязательный**, строка): ID компонента `aux_ac`.
|
||||
|
||||
### ``aux_ac.vlouver_top`` ###
|
||||
Установка жалюзи в самое верхнее положение.
|
||||
|
||||
```yaml
|
||||
on_...:
|
||||
then:
|
||||
- aux_ac.vlouver_top: aux_id
|
||||
```
|
||||
- **aux_id** (**Обязательный**, строка): ID компонента `aux_ac`.
|
||||
|
||||
### ``aux_ac.vlouver_middle_above`` ###
|
||||
Установка жалюзи во второе сверху положение. Это положение между верхним и средним.
|
||||
|
||||
```yaml
|
||||
on_...:
|
||||
then:
|
||||
- aux_ac.vlouver_middle_above: aux_id
|
||||
```
|
||||
- **aux_id** (**Обязательный**, строка): ID компонента `aux_ac`.
|
||||
|
||||
### ``aux_ac.vlouver_middle`` ###
|
||||
Установка жалюзи в среднее положение.
|
||||
|
||||
```yaml
|
||||
on_...:
|
||||
then:
|
||||
- aux_ac.vlouver_middle: aux_id
|
||||
```
|
||||
- **aux_id** (**Обязательный**, строка): ID компонента `aux_ac`.
|
||||
|
||||
### ``aux_ac.vlouver_middle_below`` ###
|
||||
Установка жалюзи в положение ниже среднего.
|
||||
|
||||
```yaml
|
||||
on_...:
|
||||
then:
|
||||
- aux_ac.vlouver_middle_below: aux_id
|
||||
```
|
||||
- **aux_id** (**Обязательный**, строка): ID компонента `aux_ac`.
|
||||
|
||||
### ``aux_ac.vlouver_bottom`` ###
|
||||
Установка жалюзи в самое нижнее положение.
|
||||
|
||||
```yaml
|
||||
on_...:
|
||||
then:
|
||||
- aux_ac.vlouver_bottom: aux_id
|
||||
```
|
||||
- **aux_id** (**Обязательный**, строка): ID компонента `aux_ac`.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
namespace esphome {
|
||||
namespace aux_ac {
|
||||
|
||||
// **************************************** DISPLAY ACTIONS ****************************************
|
||||
template <typename... Ts>
|
||||
class AirConDisplayOffAction : public Action<Ts...>
|
||||
{
|
||||
@@ -31,6 +32,96 @@ namespace aux_ac {
|
||||
AirCon *ac_;
|
||||
};
|
||||
|
||||
|
||||
|
||||
// **************************************** VERTICAL LOUVER ACTIONS ****************************************
|
||||
template <typename... Ts>
|
||||
class AirConVLouverSwingAction : public Action<Ts...>
|
||||
{
|
||||
public:
|
||||
explicit AirConVLouverSwingAction(AirCon *ac) : ac_(ac) {}
|
||||
|
||||
void play(Ts... x) override { this->ac_->setVLouverSwingSequence(); }
|
||||
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
};
|
||||
|
||||
template <typename... Ts>
|
||||
class AirConVLouverStopAction : public Action<Ts...>
|
||||
{
|
||||
public:
|
||||
explicit AirConVLouverStopAction(AirCon *ac) : ac_(ac) {}
|
||||
|
||||
void play(Ts... x) override { this->ac_->setVLouverStopSequence(); }
|
||||
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
};
|
||||
|
||||
template <typename... Ts>
|
||||
class AirConVLouverTopAction : public Action<Ts...>
|
||||
{
|
||||
public:
|
||||
explicit AirConVLouverTopAction(AirCon *ac) : ac_(ac) {}
|
||||
|
||||
void play(Ts... x) override { this->ac_->setVLouverTopSequence(); }
|
||||
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
};
|
||||
|
||||
template <typename... Ts>
|
||||
class AirConVLouverMiddleAboveAction : public Action<Ts...>
|
||||
{
|
||||
public:
|
||||
explicit AirConVLouverMiddleAboveAction(AirCon *ac) : ac_(ac) {}
|
||||
|
||||
void play(Ts... x) override { this->ac_->setVLouverMiddleAboveSequence(); }
|
||||
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
};
|
||||
|
||||
template <typename... Ts>
|
||||
class AirConVLouverMiddleAction : public Action<Ts...>
|
||||
{
|
||||
public:
|
||||
explicit AirConVLouverMiddleAction(AirCon *ac) : ac_(ac) {}
|
||||
|
||||
void play(Ts... x) override { this->ac_->setVLouverMiddleSequence(); }
|
||||
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
};
|
||||
|
||||
template <typename... Ts>
|
||||
class AirConVLouverMiddleBelowAction : public Action<Ts...>
|
||||
{
|
||||
public:
|
||||
explicit AirConVLouverMiddleBelowAction(AirCon *ac) : ac_(ac) {}
|
||||
|
||||
void play(Ts... x) override { this->ac_->setVLouverMiddleBelowSequence(); }
|
||||
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
};
|
||||
|
||||
template <typename... Ts>
|
||||
class AirConVLouverBottomAction : public Action<Ts...>
|
||||
{
|
||||
public:
|
||||
explicit AirConVLouverBottomAction(AirCon *ac) : ac_(ac) {}
|
||||
|
||||
void play(Ts... x) override { this->ac_->setVLouverBottomSequence(); }
|
||||
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
};
|
||||
|
||||
|
||||
|
||||
// **************************************** SEND TEST PACKET ACTION ****************************************
|
||||
template <typename... Ts>
|
||||
class AirConSendTestPacketAction : public Action<Ts...>
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
import logging
|
||||
import esphome.config_validation as cv
|
||||
import esphome.codegen as cg
|
||||
from esphome.components import climate, uart, sensor, binary_sensor
|
||||
from esphome.components import climate, uart, sensor, binary_sensor, text_sensor
|
||||
from esphome import automation
|
||||
from esphome.automation import maybe_simple_id
|
||||
from esphome.const import (
|
||||
@@ -12,9 +12,15 @@ from esphome.const import (
|
||||
CONF_CUSTOM_PRESETS,
|
||||
CONF_INTERNAL,
|
||||
CONF_DATA,
|
||||
CONF_SUPPORTED_MODES,
|
||||
CONF_SUPPORTED_SWING_MODES,
|
||||
CONF_SUPPORTED_PRESETS,
|
||||
UNIT_CELSIUS,
|
||||
UNIT_PERCENT,
|
||||
ICON_POWER,
|
||||
ICON_THERMOMETER,
|
||||
DEVICE_CLASS_TEMPERATURE,
|
||||
DEVICE_CLASS_POWER_FACTOR,
|
||||
STATE_CLASS_MEASUREMENT,
|
||||
)
|
||||
from esphome.components.climate import (
|
||||
@@ -27,17 +33,27 @@ _LOGGER = logging.getLogger(__name__)
|
||||
|
||||
CODEOWNERS = ["@GrKoR"]
|
||||
DEPENDENCIES = ["climate", "uart"]
|
||||
AUTO_LOAD = ["sensor", "binary_sensor"]
|
||||
AUTO_LOAD = ["sensor", "binary_sensor", "text_sensor"]
|
||||
|
||||
CONF_SUPPORTED_MODES = 'supported_modes'
|
||||
CONF_SUPPORTED_SWING_MODES = 'supported_swing_modes'
|
||||
CONF_SUPPORTED_PRESETS = 'supported_presets'
|
||||
CONF_SHOW_ACTION = 'show_action'
|
||||
CONF_INDOOR_TEMPERATURE = 'indoor_temperature'
|
||||
CONF_OUTDOOR_TEMPERATURE = 'outdoor_temperature'
|
||||
ICON_OUTDOOR_TEMPERATURE = 'mdi:home-thermometer-outline'
|
||||
CONF_INBOUND_TEMPERATURE = 'inbound_temperature'
|
||||
ICON_INBOUND_TEMPERATURE = 'mdi:thermometer-plus'
|
||||
CONF_OUTBOUND_TEMPERATURE = 'outbound_temperature'
|
||||
ICON_OUTBOUND_TEMPERATURE = 'mdi:thermometer-minus'
|
||||
CONF_COMPRESSOR_TEMPERATURE = 'compressor_temperature'
|
||||
ICON_COMPRESSOR_TEMPERATURE = 'mdi:thermometer-lines'
|
||||
CONF_DISPLAY_STATE = 'display_state'
|
||||
|
||||
CONF_INVERTOR_POWER = 'invertor_power'
|
||||
CONF_DEFROST_STATE = 'defrost_state'
|
||||
ICON_DEFROST = "mdi:snowflake-melt"
|
||||
CONF_DISPLAY_INVERTED = 'display_inverted'
|
||||
ICON_DISPLAY = "mdi:numeric"
|
||||
ICON_DISPLAY = "mdi:clock-digital"
|
||||
CONF_PRESET_REPORTER = "preset_reporter"
|
||||
ICON_PRESET_REPORTER = "mdi:format-list-group"
|
||||
|
||||
|
||||
aux_ac_ns = cg.esphome_ns.namespace("aux_ac")
|
||||
AirCon = aux_ac_ns.class_("AirCon", climate.Climate, cg.Component)
|
||||
@@ -45,6 +61,13 @@ Capabilities = aux_ac_ns.namespace("Constants")
|
||||
|
||||
AirConDisplayOffAction = aux_ac_ns.class_("AirConDisplayOffAction", automation.Action)
|
||||
AirConDisplayOnAction = aux_ac_ns.class_("AirConDisplayOnAction", automation.Action)
|
||||
AirConVLouverSwingAction = aux_ac_ns.class_("AirConVLouverSwingAction", automation.Action)
|
||||
AirConVLouverStopAction = aux_ac_ns.class_("AirConVLouverStopAction", automation.Action)
|
||||
AirConVLouverTopAction = aux_ac_ns.class_("AirConVLouverTopAction", automation.Action)
|
||||
AirConVLouverMiddleAboveAction = aux_ac_ns.class_("AirConVLouverMiddleAboveAction", automation.Action)
|
||||
AirConVLouverMiddleAction = aux_ac_ns.class_("AirConVLouverMiddleAction", automation.Action)
|
||||
AirConVLouverMiddleBelowAction = aux_ac_ns.class_("AirConVLouverMiddleBelowAction", automation.Action)
|
||||
AirConVLouverBottomAction = aux_ac_ns.class_("AirConVLouverBottomAction", automation.Action)
|
||||
AirConSendTestPacketAction = aux_ac_ns.class_("AirConSendTestPacketAction", automation.Action)
|
||||
|
||||
ALLOWED_CLIMATE_MODES = {
|
||||
@@ -76,7 +99,6 @@ validate_custom_fan_modes = cv.enum(CUSTOM_FAN_MODES, upper=True)
|
||||
|
||||
CUSTOM_PRESETS = {
|
||||
"CLEAN": Capabilities.CLEAN,
|
||||
"FEEL": Capabilities.FEEL,
|
||||
"HEALTH": Capabilities.HEALTH,
|
||||
"ANTIFUNGUS": Capabilities.ANTIFUNGUS,
|
||||
}
|
||||
@@ -102,6 +124,17 @@ CONFIG_SCHEMA = cv.All(
|
||||
cv.Optional(CONF_PERIOD, default="7s"): cv.time_period,
|
||||
cv.Optional(CONF_SHOW_ACTION, default="true"): cv.boolean,
|
||||
cv.Optional(CONF_DISPLAY_INVERTED, default="false"): cv.boolean,
|
||||
cv.Optional(CONF_INVERTOR_POWER): sensor.sensor_schema(
|
||||
unit_of_measurement=UNIT_PERCENT,
|
||||
icon=ICON_POWER,
|
||||
accuracy_decimals=0,
|
||||
device_class=DEVICE_CLASS_POWER_FACTOR,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
).extend(
|
||||
{
|
||||
cv.Optional(CONF_INTERNAL, default="true"): cv.boolean,
|
||||
}
|
||||
),
|
||||
cv.Optional(CONF_INDOOR_TEMPERATURE): sensor.sensor_schema(
|
||||
unit_of_measurement=UNIT_CELSIUS,
|
||||
icon=ICON_THERMOMETER,
|
||||
@@ -113,11 +146,69 @@ CONFIG_SCHEMA = cv.All(
|
||||
cv.Optional(CONF_INTERNAL, default="true"): cv.boolean,
|
||||
}
|
||||
),
|
||||
cv.Optional(CONF_DISPLAY_STATE): binary_sensor.binary_sensor_schema(
|
||||
icon=ICON_DISPLAY
|
||||
cv.Optional(CONF_OUTDOOR_TEMPERATURE): sensor.sensor_schema(
|
||||
unit_of_measurement=UNIT_CELSIUS,
|
||||
icon=ICON_OUTDOOR_TEMPERATURE,
|
||||
accuracy_decimals=0,
|
||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
).extend(
|
||||
{
|
||||
cv.Optional(CONF_INTERNAL, default="true"): cv.boolean
|
||||
cv.Optional(CONF_INTERNAL, default="true"): cv.boolean,
|
||||
}
|
||||
),
|
||||
cv.Optional(CONF_INBOUND_TEMPERATURE): sensor.sensor_schema(
|
||||
unit_of_measurement=UNIT_CELSIUS,
|
||||
icon=ICON_INBOUND_TEMPERATURE,
|
||||
accuracy_decimals=0,
|
||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
).extend(
|
||||
{
|
||||
cv.Optional(CONF_INTERNAL, default="true"): cv.boolean,
|
||||
}
|
||||
),
|
||||
cv.Optional(CONF_OUTBOUND_TEMPERATURE): sensor.sensor_schema(
|
||||
unit_of_measurement=UNIT_CELSIUS,
|
||||
icon=ICON_OUTBOUND_TEMPERATURE,
|
||||
accuracy_decimals=0,
|
||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
).extend(
|
||||
{
|
||||
cv.Optional(CONF_INTERNAL, default="true"): cv.boolean,
|
||||
}
|
||||
),
|
||||
cv.Optional(CONF_COMPRESSOR_TEMPERATURE): sensor.sensor_schema(
|
||||
unit_of_measurement=UNIT_CELSIUS,
|
||||
icon=ICON_COMPRESSOR_TEMPERATURE,
|
||||
accuracy_decimals=0,
|
||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
).extend(
|
||||
{
|
||||
cv.Optional(CONF_INTERNAL, default="true"): cv.boolean,
|
||||
}
|
||||
),
|
||||
cv.Optional(CONF_DISPLAY_STATE): binary_sensor.binary_sensor_schema(
|
||||
icon=ICON_DISPLAY,
|
||||
).extend(
|
||||
{
|
||||
cv.Optional(CONF_INTERNAL, default="true"): cv.boolean,
|
||||
}
|
||||
),
|
||||
cv.Optional(CONF_DEFROST_STATE): binary_sensor.binary_sensor_schema(
|
||||
icon=ICON_DEFROST,
|
||||
).extend(
|
||||
{
|
||||
cv.Optional(CONF_INTERNAL, default="true"): cv.boolean,
|
||||
}
|
||||
),
|
||||
cv.Optional(CONF_PRESET_REPORTER): text_sensor.text_sensor_schema(
|
||||
icon=ICON_PRESET_REPORTER,
|
||||
).extend(
|
||||
{
|
||||
cv.Optional(CONF_INTERNAL, default="true"): cv.boolean,
|
||||
}
|
||||
),
|
||||
cv.Optional(CONF_SUPPORTED_MODES): cv.ensure_list(validate_modes),
|
||||
@@ -146,12 +237,47 @@ async def to_code(config):
|
||||
conf = config[CONF_INDOOR_TEMPERATURE]
|
||||
sens = await sensor.new_sensor(conf)
|
||||
cg.add(var.set_indoor_temperature_sensor(sens))
|
||||
|
||||
if CONF_OUTDOOR_TEMPERATURE in config:
|
||||
conf = config[CONF_OUTDOOR_TEMPERATURE]
|
||||
sens = await sensor.new_sensor(conf)
|
||||
cg.add(var.set_outdoor_temperature_sensor(sens))
|
||||
|
||||
if CONF_OUTBOUND_TEMPERATURE in config:
|
||||
conf = config[CONF_OUTBOUND_TEMPERATURE]
|
||||
sens = await sensor.new_sensor(conf)
|
||||
cg.add(var.set_outbound_temperature_sensor(sens))
|
||||
|
||||
if CONF_INBOUND_TEMPERATURE in config:
|
||||
conf = config[CONF_INBOUND_TEMPERATURE]
|
||||
sens = await sensor.new_sensor(conf)
|
||||
cg.add(var.set_inbound_temperature_sensor(sens))
|
||||
|
||||
if CONF_COMPRESSOR_TEMPERATURE in config:
|
||||
conf = config[CONF_COMPRESSOR_TEMPERATURE]
|
||||
sens = await sensor.new_sensor(conf)
|
||||
cg.add(var.set_compressor_temperature_sensor(sens))
|
||||
|
||||
if CONF_DISPLAY_STATE in config:
|
||||
conf = config[CONF_DISPLAY_STATE]
|
||||
sens = await binary_sensor.new_binary_sensor(conf)
|
||||
cg.add(var.set_display_sensor(sens))
|
||||
|
||||
if CONF_DEFROST_STATE in config:
|
||||
conf = config[CONF_DEFROST_STATE]
|
||||
sens = await binary_sensor.new_binary_sensor(conf)
|
||||
cg.add(var.set_defrost_state(sens))
|
||||
|
||||
if CONF_INVERTOR_POWER in config:
|
||||
conf = config[CONF_INVERTOR_POWER]
|
||||
sens = await sensor.new_sensor(conf)
|
||||
cg.add(var.set_invertor_power_sensor(sens))
|
||||
|
||||
if CONF_PRESET_REPORTER in config:
|
||||
conf = config[CONF_PRESET_REPORTER]
|
||||
sens = await text_sensor.new_text_sensor(conf)
|
||||
cg.add(var.set_preset_reporter_sensor(sens))
|
||||
|
||||
cg.add(var.set_period(config[CONF_PERIOD].total_milliseconds))
|
||||
cg.add(var.set_show_action(config[CONF_SHOW_ACTION]))
|
||||
cg.add(var.set_display_inverted(config[CONF_DISPLAY_INVERTED]))
|
||||
@@ -185,13 +311,48 @@ async def display_on_to_code(config, action_id, template_arg, args):
|
||||
return cg.new_Pvariable(action_id, template_arg, paren)
|
||||
|
||||
|
||||
SEND_TEST_PACKET_ACTION_SCHEMA = maybe_simple_id(
|
||||
VLOUVER_ACTION_SCHEMA = maybe_simple_id(
|
||||
{
|
||||
cv.Required(CONF_ID): cv.use_id(AirCon),
|
||||
cv.Required(CONF_DATA): cv.templatable(validate_raw_data),
|
||||
}
|
||||
)
|
||||
|
||||
@automation.register_action("aux_ac.vlouver_stop", AirConVLouverStopAction, VLOUVER_ACTION_SCHEMA)
|
||||
async def vlouver_stop_to_code(config, action_id, template_arg, args):
|
||||
paren = await cg.get_variable(config[CONF_ID])
|
||||
return cg.new_Pvariable(action_id, template_arg, paren)
|
||||
|
||||
@automation.register_action("aux_ac.vlouver_swing", AirConVLouverSwingAction, VLOUVER_ACTION_SCHEMA)
|
||||
async def vlouver_swing_to_code(config, action_id, template_arg, args):
|
||||
paren = await cg.get_variable(config[CONF_ID])
|
||||
return cg.new_Pvariable(action_id, template_arg, paren)
|
||||
|
||||
|
||||
@automation.register_action("aux_ac.vlouver_top", AirConVLouverTopAction, VLOUVER_ACTION_SCHEMA)
|
||||
async def vlouver_top_to_code(config, action_id, template_arg, args):
|
||||
paren = await cg.get_variable(config[CONF_ID])
|
||||
return cg.new_Pvariable(action_id, template_arg, paren)
|
||||
|
||||
@automation.register_action("aux_ac.vlouver_middle_above", AirConVLouverMiddleAboveAction, VLOUVER_ACTION_SCHEMA)
|
||||
async def vlouver_middle_above_to_code(config, action_id, template_arg, args):
|
||||
paren = await cg.get_variable(config[CONF_ID])
|
||||
return cg.new_Pvariable(action_id, template_arg, paren)
|
||||
|
||||
@automation.register_action("aux_ac.vlouver_middle", AirConVLouverMiddleAction, VLOUVER_ACTION_SCHEMA)
|
||||
async def vlouver_middle_to_code(config, action_id, template_arg, args):
|
||||
paren = await cg.get_variable(config[CONF_ID])
|
||||
return cg.new_Pvariable(action_id, template_arg, paren)
|
||||
|
||||
@automation.register_action("aux_ac.vlouver_middle_below", AirConVLouverMiddleBelowAction, VLOUVER_ACTION_SCHEMA)
|
||||
async def vlouver_middle_below_to_code(config, action_id, template_arg, args):
|
||||
paren = await cg.get_variable(config[CONF_ID])
|
||||
return cg.new_Pvariable(action_id, template_arg, paren)
|
||||
|
||||
@automation.register_action("aux_ac.vlouver_bottom", AirConVLouverBottomAction, VLOUVER_ACTION_SCHEMA)
|
||||
async def vlouver_bottom_to_code(config, action_id, template_arg, args):
|
||||
paren = await cg.get_variable(config[CONF_ID])
|
||||
return cg.new_Pvariable(action_id, template_arg, paren)
|
||||
|
||||
|
||||
# *********************************************************************************************************
|
||||
# ВАЖНО! Только для инженеров!
|
||||
@@ -199,6 +360,13 @@ SEND_TEST_PACKET_ACTION_SCHEMA = maybe_simple_id(
|
||||
# кондиционеру всё как есть. Какой эффект получится от передачи кондиционеру рандомных байт, никто не знает.
|
||||
# Вы действуете на свой страх и риск.
|
||||
# *********************************************************************************************************
|
||||
SEND_TEST_PACKET_ACTION_SCHEMA = maybe_simple_id(
|
||||
{
|
||||
cv.Required(CONF_ID): cv.use_id(AirCon),
|
||||
cv.Required(CONF_DATA): cv.templatable(validate_raw_data),
|
||||
}
|
||||
)
|
||||
|
||||
@automation.register_action(
|
||||
"aux_ac.send_packet",
|
||||
AirConSendTestPacketAction,
|
||||
@@ -218,4 +386,4 @@ async def send_packet_to_code(config, action_id, template_arg, args):
|
||||
else:
|
||||
cg.add(var.set_data_static(data))
|
||||
|
||||
return var
|
||||
return var
|
||||
@@ -69,9 +69,37 @@ climate:
|
||||
id: ${devicename}_indoor_temp
|
||||
internal: false
|
||||
display_state:
|
||||
name: $upper_devicename Display State
|
||||
name: ${upper_devicename} Display State
|
||||
id: ${devicename}_display_state
|
||||
internal: false
|
||||
outdoor_temperature:
|
||||
name: ${upper_devicename} Outdoor Temperature
|
||||
id: ${devicename}_outdoor_temp
|
||||
internal: false
|
||||
outbound_temperature:
|
||||
name: ${upper_devicename} Colant Outbound Temperature
|
||||
id: ${devicename}_outbound_temp
|
||||
internal: false
|
||||
inbound_temperature:
|
||||
name: ${upper_devicename} Colant Inbound Temperature
|
||||
id: ${devicename}_inbound_temp
|
||||
internal: false
|
||||
compressor_temperature:
|
||||
name: ${upper_devicename} Compressor Temperature
|
||||
id: ${devicename}_strange_temp
|
||||
internal: false
|
||||
defrost_state:
|
||||
name: ${upper_devicename} Defrost State
|
||||
id: ${devicename}_defrost_state
|
||||
internal: false
|
||||
invertor_power:
|
||||
name: ${upper_devicename} Invertor Power
|
||||
id: ${devicename}_invertor_power
|
||||
internal: false
|
||||
preset_reporter:
|
||||
name: ${upper_devicename} Preset Reporter
|
||||
id: ${devicename}_preset_reporter
|
||||
internal: false
|
||||
visual:
|
||||
min_temperature: 16
|
||||
max_temperature: 32
|
||||
@@ -89,7 +117,6 @@ climate:
|
||||
- SLEEP
|
||||
custom_presets:
|
||||
- CLEAN
|
||||
- FEEL
|
||||
- HEALTH
|
||||
- ANTIFUNGUS
|
||||
supported_swing_modes:
|
||||
@@ -109,7 +136,7 @@ sensor:
|
||||
|
||||
switch:
|
||||
- platform: template
|
||||
name: $upper_devicename Display
|
||||
name: ${upper_devicename} Display
|
||||
lambda: |-
|
||||
if (id(${devicename}_display_state).state) {
|
||||
return true;
|
||||
@@ -120,3 +147,62 @@ switch:
|
||||
- aux_ac.display_on: aux_id
|
||||
turn_off_action:
|
||||
- aux_ac.display_off: aux_id
|
||||
|
||||
button:
|
||||
- platform: template
|
||||
name: ${upper_devicename} VLouver Stop
|
||||
icon: "mdi:circle-small"
|
||||
on_press:
|
||||
- aux_ac.vlouver_stop: aux_id
|
||||
|
||||
- platform: template
|
||||
name: ${upper_devicename} VLouver Swing
|
||||
icon: "mdi:pan-vertical"
|
||||
on_press:
|
||||
- aux_ac.vlouver_swing: aux_id
|
||||
|
||||
- platform: template
|
||||
name: ${upper_devicename} VLouver Top
|
||||
icon: "mdi:pan-up"
|
||||
on_press:
|
||||
- aux_ac.vlouver_top: aux_id
|
||||
|
||||
- platform: template
|
||||
name: ${upper_devicename} VLouver Middle Above
|
||||
icon: "mdi:pan-top-left"
|
||||
on_press:
|
||||
- aux_ac.vlouver_middle_above: aux_id
|
||||
|
||||
- platform: template
|
||||
name: ${upper_devicename} VLouver Middle
|
||||
icon: "mdi:pan-left"
|
||||
on_press:
|
||||
- aux_ac.vlouver_middle: aux_id
|
||||
|
||||
- platform: template
|
||||
name: ${upper_devicename} VLouver Middle Below
|
||||
icon: "mdi:pan-bottom-left"
|
||||
on_press:
|
||||
- aux_ac.vlouver_middle_below: aux_id
|
||||
|
||||
- platform: template
|
||||
name: ${upper_devicename} VLouver Bottom
|
||||
icon: "mdi:pan-down"
|
||||
on_press:
|
||||
- aux_ac.vlouver_bottom: aux_id
|
||||
|
||||
|
||||
number:
|
||||
- platform: template
|
||||
name: ${upper_devicename} Vertical Louver
|
||||
id: ${devicename}_vlouver
|
||||
icon: "mdi:circle-small"
|
||||
mode: "slider"
|
||||
min_value: 0
|
||||
max_value: 6
|
||||
step: 1
|
||||
set_action:
|
||||
then:
|
||||
- lambda: !lambda |-
|
||||
if (x == 6) x = 7; // 6 is incorrect louver position, 7 is stopped louver
|
||||
id(aux_id).setVLouverSequence( static_cast<esphome::aux_ac::ac_louver_V>(x) );
|
||||
@@ -21,8 +21,6 @@ def createParser ():
|
||||
parent_group.add_argument ('--help', '-h', action='help', help='show this help message and exit')
|
||||
parent_group.add_argument ('-i', '--ip', nargs=1, required=True, help='IP address of the esphome device')
|
||||
parent_group.add_argument ('-p', '--pwd', nargs=1, required=True, help='native API password for the esphome device')
|
||||
parent_group.add_argument ('-n', '--name', nargs=1, default=['noname'], help='name of this devace in the log')
|
||||
parent_group.add_argument ('-l', '--logfile', nargs=1, default=['%4d-%02d-%02d %02d-%02d-%02d log.csv' % time.localtime()[0:6]], help='log file name')
|
||||
return parser
|
||||
|
||||
async def main():
|
||||
@@ -36,57 +34,77 @@ async def main():
|
||||
|
||||
print(api.api_version)
|
||||
|
||||
def log_AC(isAirConLog):
|
||||
parts = re.search("(\d{10}): (\[\S{2}\]) \[([0-9A-F ]{23})\]\s?((?:[0-9A-F]{2}\s*)*) \[([0-9A-F ]{5})\]", isAirConLog.group(1))
|
||||
packString = '\n' + namespace.name[0]
|
||||
packString += ";" + "%4d-%02d-%02d %02d:%02d:%02d" % time.localtime()[0:6]
|
||||
"""millis of message"""
|
||||
packString += ";" + parts.group(1)
|
||||
"""direction"""
|
||||
packString += ";" + parts.group(2)
|
||||
"""header"""
|
||||
packString += ";" + ';'.join(parts.group(3).split(" "))
|
||||
"""body (may be void)"""
|
||||
if len(parts.group(4)) > 0:
|
||||
packString += ";" + ';'.join(parts.group(4).split(" "))
|
||||
"""crc"""
|
||||
packString += ";" + ';'.join(parts.group(5).split(" "))
|
||||
print(packString)
|
||||
with open(namespace.logfile[0], 'a+') as file:
|
||||
file.write( packString )
|
||||
async def display_off():
|
||||
await api.execute_service(
|
||||
service,
|
||||
data={
|
||||
# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
||||
"data_buf": [0xBB, 0x00, 0x06, 0x80, 0x01, 0x00, 0x0F, 0x00, 0x01, 0x01, 0x97, 0xE0, 0x00, 0x20, 0x00, 0xC0, 0x00, 0x00, 0x20, 0x00, 0x10, 0x00, 0x00],
|
||||
}
|
||||
)
|
||||
|
||||
def log_Dallas(isDallasLog):
|
||||
parts = re.search("'([\w ]+)': Got Temperature=([-]?\d+\.\d+)°C", isDallasLog.group(1))
|
||||
packString = '\n' + parts.group(1)
|
||||
packString += ";" + "%4d-%02d-%02d %02d:%02d:%02d" % time.localtime()[0:6]
|
||||
"""millis of message always empty"""
|
||||
packString += ";"
|
||||
"""direction"""
|
||||
packString += ";[<=]"
|
||||
"""additional data flag"""
|
||||
packString += ";AA"
|
||||
"""dallas temperature"""
|
||||
packString += ";" + parts.group(2)
|
||||
print(packString)
|
||||
with open(namespace.logfile[0], 'a+') as file:
|
||||
file.write( packString )
|
||||
async def display_on():
|
||||
await api.execute_service(
|
||||
service,
|
||||
data={
|
||||
# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
||||
"data_buf": [0xBB, 0x00, 0x06, 0x80, 0x01, 0x00, 0x0F, 0x00, 0x01, 0x01, 0x97, 0xE0, 0x00, 0x20, 0x00, 0xC0, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00],
|
||||
}
|
||||
)
|
||||
|
||||
def log_callback(log):
|
||||
"""Print the log for AirCon"""
|
||||
isAirConLog = re.search("\[AirCon:\d+\]: (.+\])", log.message.decode('utf-8'))
|
||||
if isAirConLog:
|
||||
log_AC(isAirConLog)
|
||||
if namespace.logdallas:
|
||||
isDallasLog = re.search("\[dallas.sensor:\d+\]: (.+C)", log.message.decode('utf-8'))
|
||||
if isDallasLog:
|
||||
log_Dallas(isDallasLog)
|
||||
async def ac_enable():
|
||||
await api.execute_service(
|
||||
service,
|
||||
data={
|
||||
# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
||||
"data_buf": [0xBB, 0x00, 0x06, 0x80, 0x00, 0x00, 0x0F, 0x00, 0x01, 0x00, 0x87, 0xE0, 0x2F, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00],
|
||||
}
|
||||
)
|
||||
|
||||
async def ac_disable():
|
||||
await api.execute_service(
|
||||
service,
|
||||
data={
|
||||
# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
||||
"data_buf": [0xBB, 0x00, 0x06, 0x80, 0x00, 0x00, 0x0F, 0x00, 0x01, 0x00, 0x87, 0xE0, 0x2F, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
|
||||
}
|
||||
)
|
||||
|
||||
# Subscribe to the log
|
||||
# await api.subscribe_logs(log_callback, LOG_LEVEL_DEBUG)
|
||||
async def ac_get11_01():
|
||||
await api.execute_service(
|
||||
service,
|
||||
data={
|
||||
# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
||||
"data_buf": [0xBB, 0x00, 0x06, 0x80, 0x00, 0x00, 0x02, 0x00, 0x11, 0x01],
|
||||
}
|
||||
)
|
||||
|
||||
# print(await api.device_info())
|
||||
print(f"%s" % (await api.list_entities_services(),))
|
||||
async def ac_get11_00():
|
||||
await api.execute_service(
|
||||
service,
|
||||
data={
|
||||
# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
||||
"data_buf": [0xBB, 0x00, 0x06, 0x80, 0x00, 0x00, 0x02, 0x00, 0x11, 0x00],
|
||||
}
|
||||
)
|
||||
|
||||
async def ac_set_vlouver(lvr):
|
||||
await api.execute_service(
|
||||
service,
|
||||
data={
|
||||
# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
||||
"data_buf": [0xBB, 0x00, 0x06, 0x80, 0x00, 0x00, 0x0F, 0x00, 0x01, 0x01, lvr, 0xE0, 0x00, 0x20, 0x00, 0xC0, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00],
|
||||
}
|
||||
)
|
||||
|
||||
async def ac_set_hlouver(lvr):
|
||||
await api.execute_service(
|
||||
service,
|
||||
data={
|
||||
# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
||||
"data_buf": [0xBB, 0x00, 0x06, 0x80, 0x00, 0x00, 0x0F, 0x00, 0x01, 0x01, 0x97, lvr, 0x00, 0x20, 0x00, 0xC0, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00],
|
||||
}
|
||||
)
|
||||
|
||||
# key надо искать в выводе list_entities_services
|
||||
service = aioesphomeapi.UserService(
|
||||
@@ -97,27 +115,66 @@ async def main():
|
||||
],
|
||||
)
|
||||
|
||||
await api.execute_service(
|
||||
service,
|
||||
data={
|
||||
# display off
|
||||
"data_buf": [0xBB, 0x00, 0x06, 0x80, 0x00, 0x00, 0x0F, 0x00, 0x01, 0x01, 0x7F, 0xE0, 0x00, 0x20, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00],
|
||||
}
|
||||
)
|
||||
time.sleep(7)
|
||||
await ac_get11_00()
|
||||
time.sleep(7)
|
||||
await ac_get11_01()
|
||||
|
||||
time.sleep(3)
|
||||
#await ac_set_vlouver( 0b10010000 ) # swing on
|
||||
#await ac_set_vlouver( 0b10010111 ) # swing off
|
||||
#await ac_set_vlouver( 0b10010001 ) # 1
|
||||
#await ac_set_vlouver( 0b10010010 ) # 2
|
||||
#await ac_set_vlouver( 0b10010011 ) # 3
|
||||
#await ac_set_vlouver( 0b10010100 ) # 4
|
||||
#await ac_set_vlouver( 0b10010101 ) # 5
|
||||
#await ac_set_vlouver( 0b10010110 ) # не работает, сбрасывает на swing on
|
||||
#time.sleep(5)
|
||||
|
||||
#await ac_set_hlouver( 0b00000000 ) # swing on
|
||||
#await ac_set_hlouver( 0b11100000 ) # swing off
|
||||
#await ac_set_hlouver( 0b00100000 ) # не работает, сбрасывает в swing off
|
||||
#await ac_set_hlouver( 0b01000000 ) # не работает, сбрасывает в swing off
|
||||
#await ac_set_hlouver( 0b01100000 ) # не работает, сбрасывает в swing off
|
||||
#await ac_set_hlouver( 0b10000000 ) # не работает, сбрасывает в swing off
|
||||
#await ac_set_hlouver( 0b10100000 ) # не работает, сбрасывает в swing off
|
||||
#await ac_set_hlouver( 0b11000000 ) # не работает, сбрасывает в swing off
|
||||
#time.sleep(5)
|
||||
|
||||
async def test_byte(bt):
|
||||
await api.execute_service(
|
||||
service,
|
||||
data={
|
||||
#display on
|
||||
# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
||||
#"data_buf": [0xBB, 0x00, 0x06, 0x80, 0x00, 0x00, 0x0F, 0x00, 0x01, 0x01, 0x97, 0xE0, 0x00, 0x20, 0x00, 0xC0, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00],
|
||||
#display off
|
||||
# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
||||
"data_buf": [0xBB, 0x00, 0x06, 0x80, 0x00, 0x00, 0x0F, 0x00, 0x01, 0x01, 0x97, 0xE0, 0x00, 0x20, 0x00, 0xC0, 0x00, 0x00, 0x20, 0x00, 0x10, 0x00, 0x00],
|
||||
# swing on
|
||||
# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
||||
#"data_buf": [0xBB, 0x00, 0x06, 0x80, 0x00, 0x00, 0x0F, 0x00, 0x01, 0x01, 0x90, 0xE0, 0x00, 0x20, 0x00, 0xC0, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00],
|
||||
# swing off
|
||||
# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
||||
#"data_buf": [0xBB, 0x00, 0x06, 0x80, 0x00, 0x00, 0x0F, 0x00, 0x01, 0x01, 0x97, 0xE0, 0x00, 0x20, 0x00, 0xC0, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00],
|
||||
}
|
||||
)
|
||||
'''
|
||||
не проходит команда, если байт 1 или 7 не 0x00
|
||||
не проходит команда, если байт 3 не 0x80
|
||||
|
||||
проходит и не меняется, если меняю байт 4 или 5
|
||||
'''
|
||||
|
||||
#await test_byte(0b10000110)
|
||||
#await test_byte(0b01000110)
|
||||
#await test_byte(0b00100110)
|
||||
#await test_byte(0b00010110)
|
||||
time.sleep(2)
|
||||
|
||||
await api.execute_service(
|
||||
service,
|
||||
data={
|
||||
# display on
|
||||
"data_buf": [0xBB, 0x00, 0x06, 0x80, 0x00, 0x00, 0x0F, 0x00, 0x01, 0x01, 0x7F, 0xE0, 0x00, 0x20, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
|
||||
}
|
||||
)
|
||||
|
||||
parser = createParser()
|
||||
namespace = parser.parse_args()
|
||||
print(namespace.name[0], namespace.ip[0])
|
||||
print("IP: ", namespace.ip[0])
|
||||
|
||||
|
||||
loop = asyncio.get_event_loop()
|
||||
|
||||
@@ -3,9 +3,12 @@ external_components:
|
||||
components: [ aux_ac ]
|
||||
refresh: 0s
|
||||
|
||||
|
||||
substitutions:
|
||||
devicename: test_aux_ac_ext_esp32
|
||||
upper_devicename: Test AUX
|
||||
|
||||
esphome:
|
||||
name: test_aux_ac_ext_esp32
|
||||
name: $devicename
|
||||
platform: ESP32
|
||||
board: nodemcu-32s
|
||||
|
||||
@@ -51,21 +54,54 @@ sensor:
|
||||
|
||||
climate:
|
||||
- platform: aux_ac
|
||||
name: "AC Name"
|
||||
name: $upper_devicename
|
||||
id: aux_id
|
||||
uart_id: ac_uart_bus
|
||||
period: 7s # период опроса состояния сплита, по дефолту 7 сек
|
||||
show_action: true # надо ли показывать текущий режим работы: при HEAT_COOL mode сплит может греть (HEAT), охлаждать (COOL) или бездействовать (IDLE)
|
||||
indoor_temperature: # сенсор, показывающий температуру воздуха на внутреннем блоке кондиционера; имеет все те же параметры, как и любой сенсор ESPHome
|
||||
name: AC Indoor Temperature
|
||||
id: ac_indoor_temp
|
||||
internal: true # сенсор установлен как внутренний по дефолту (не попадёт в Home Assistant)
|
||||
period: 7s
|
||||
show_action: true
|
||||
display_inverted: true
|
||||
indoor_temperature:
|
||||
name: $upper_devicename Indoor Temperature
|
||||
id: ${devicename}_indoor_temp
|
||||
internal: false
|
||||
display_state:
|
||||
name: $upper_devicename Display State
|
||||
id: ${devicename}_display_state
|
||||
internal: false
|
||||
outdoor_temperature:
|
||||
name: $upper_devicename Outdoor Temperature
|
||||
id: ${devicename}_outdoor_temp
|
||||
internal: false
|
||||
outbound_temperature:
|
||||
name: $upper_devicename Colant Outbound Temperature
|
||||
id: ${devicename}_outbound_temp
|
||||
internal: false
|
||||
inbound_temperature:
|
||||
name: $upper_devicename Colant Inbound Temperature
|
||||
id: ${devicename}_inbound_temp
|
||||
internal: false
|
||||
compressor_temperature:
|
||||
name: $upper_devicename Compressor Temperature
|
||||
id: ${devicename}_strange_temp
|
||||
internal: false
|
||||
defrost_state:
|
||||
name: $upper_devicename Defrost State
|
||||
id: ${devicename}_defrost_state
|
||||
internal: false
|
||||
invertor_power:
|
||||
name: $upper_devicename Invertor Power
|
||||
id: ${devicename}_invertor_power
|
||||
internal: false
|
||||
preset_reporter:
|
||||
name: $upper_devicename Preset Reporter
|
||||
id: ${devicename}_preset_reporter
|
||||
internal: false
|
||||
visual:
|
||||
min_temperature: 16
|
||||
max_temperature: 32
|
||||
temperature_step: 0.5
|
||||
supported_modes:
|
||||
- HEAT_COOL # не AUTO, так как только нагревает и остужает. В доках на ESPHome говорится, что AUTO - это если у устройства есть календарь и какие-то установки по расписанию.
|
||||
- HEAT_COOL
|
||||
- COOL
|
||||
- HEAT
|
||||
- DRY
|
||||
@@ -77,10 +113,9 @@ climate:
|
||||
- SLEEP
|
||||
custom_presets:
|
||||
- CLEAN
|
||||
- FEEL
|
||||
- HEALTH
|
||||
- ANTIFUNGUS
|
||||
supported_swing_modes:
|
||||
- VERTICAL
|
||||
- HORIZONTAL
|
||||
- BOTH
|
||||
- BOTH
|
||||
|
||||
@@ -3,8 +3,12 @@ external_components:
|
||||
components: [ aux_ac ]
|
||||
refresh: 0s
|
||||
|
||||
substitutions:
|
||||
devicename: test_aux_ac_ext_engeneer
|
||||
upper_devicename: Test AUX
|
||||
|
||||
esphome:
|
||||
name: test_aux_ac_ext
|
||||
name: $devicename
|
||||
platform: ESP8266
|
||||
board: esp12e
|
||||
|
||||
@@ -69,26 +73,54 @@ sensor:
|
||||
|
||||
climate:
|
||||
- platform: aux_ac
|
||||
name: "AC Name"
|
||||
name: $upper_devicename
|
||||
id: aux_id
|
||||
uart_id: ac_uart_bus
|
||||
period: 7s # период опроса состояния сплита, по дефолту 7 сек
|
||||
show_action: true # надо ли показывать текущий режим работы: при HEAT_COOL mode сплит может греть (HEAT), охлаждать (COOL) или бездействовать (IDLE)
|
||||
display_inverted: true # как отрабатывать вкл/выкл дисплея: у Rovex "1" выключает дисплей, у многих других "1" дисплей включает
|
||||
indoor_temperature: # сенсор, показывающий температуру воздуха на внутреннем блоке кондиционера; имеет все те же параметры, как и любой сенсор ESPHome
|
||||
name: AC Indoor Temperature
|
||||
id: ac_indoor_temp
|
||||
internal: false # сенсор установлен как внутренний по дефолту (не попадёт в Home Assistant)
|
||||
period: 7s
|
||||
show_action: true
|
||||
display_inverted: true
|
||||
indoor_temperature:
|
||||
name: $upper_devicename Indoor Temperature
|
||||
id: ${devicename}_indoor_temp
|
||||
internal: false
|
||||
display_state:
|
||||
name: AC Display State
|
||||
id: ac_display_state
|
||||
internal: false # сенсор установлен как внутренний по дефолту (не попадёт в Home Assistant)
|
||||
name: $upper_devicename Display State
|
||||
id: ${devicename}_display_state
|
||||
internal: false
|
||||
outdoor_temperature:
|
||||
name: $upper_devicename Outdoor Temperature
|
||||
id: ${devicename}_outdoor_temp
|
||||
internal: false
|
||||
outbound_temperature:
|
||||
name: $upper_devicename Colant Outbound Temperature
|
||||
id: ${devicename}_outbound_temp
|
||||
internal: false
|
||||
inbound_temperature:
|
||||
name: $upper_devicename Colant Inbound Temperature
|
||||
id: ${devicename}_inbound_temp
|
||||
internal: false
|
||||
compressor_temperature:
|
||||
name: $upper_devicename Compressor Temperature
|
||||
id: ${devicename}_strange_temp
|
||||
internal: false
|
||||
defrost_state:
|
||||
name: $upper_devicename Defrost State
|
||||
id: ${devicename}_defrost_state
|
||||
internal: false
|
||||
invertor_power:
|
||||
name: $upper_devicename Invertor Power
|
||||
id: ${devicename}_invertor_power
|
||||
internal: false
|
||||
preset_reporter:
|
||||
name: $upper_devicename Preset Reporter
|
||||
id: ${devicename}_preset_reporter
|
||||
internal: false
|
||||
visual:
|
||||
min_temperature: 16
|
||||
max_temperature: 32
|
||||
temperature_step: 0.5
|
||||
supported_modes:
|
||||
- HEAT_COOL # не AUTO, так как только нагревает и остужает. В доках на ESPHome говорится, что AUTO - это если у устройства есть календарь и какие-то установки по расписанию.
|
||||
- HEAT_COOL
|
||||
- COOL
|
||||
- HEAT
|
||||
- DRY
|
||||
@@ -100,7 +132,6 @@ climate:
|
||||
- SLEEP
|
||||
custom_presets:
|
||||
- CLEAN
|
||||
- FEEL
|
||||
- HEALTH
|
||||
- ANTIFUNGUS
|
||||
supported_swing_modes:
|
||||
@@ -113,7 +144,7 @@ switch:
|
||||
- platform: template
|
||||
name: AC Display
|
||||
lambda: |-
|
||||
if (id(ac_display_state).state) {
|
||||
if (id(${devicename}_display_state).state) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
||||
125
tests/test-local-airflow-dir.yaml
Normal file
125
tests/test-local-airflow-dir.yaml
Normal file
@@ -0,0 +1,125 @@
|
||||
external_components:
|
||||
- source:
|
||||
type: local
|
||||
path: ..\components
|
||||
|
||||
substitutions:
|
||||
devicename: test_local_airflow_dir
|
||||
upper_devicename: Test AUX
|
||||
|
||||
esphome:
|
||||
name: $devicename
|
||||
platform: ESP8266
|
||||
board: esp12e
|
||||
|
||||
wifi:
|
||||
ssid: !secret wifi_ssid
|
||||
password: !secret wifi_pass
|
||||
manual_ip:
|
||||
static_ip: !secret wifi_ip
|
||||
gateway: !secret wifi_gateway
|
||||
subnet: !secret wifi_subnet
|
||||
dns1: 8.8.8.8
|
||||
dns2: 1.1.1.1
|
||||
reboot_timeout: 0s
|
||||
ap:
|
||||
ssid: $upper_devicename Fallback Hotspot
|
||||
password: !secret wifi_ap_pass
|
||||
|
||||
logger:
|
||||
level: DEBUG
|
||||
baud_rate: 0
|
||||
|
||||
api:
|
||||
password: !secret api_pass
|
||||
reboot_timeout: 0s
|
||||
|
||||
ota:
|
||||
password: !secret ota_pass
|
||||
|
||||
web_server:
|
||||
port: 80
|
||||
|
||||
uart:
|
||||
id: ac_uart_bus
|
||||
tx_pin: GPIO1
|
||||
rx_pin: GPIO3
|
||||
baud_rate: 4800
|
||||
data_bits: 8
|
||||
parity: EVEN
|
||||
stop_bits: 1
|
||||
|
||||
|
||||
sensor:
|
||||
- platform: uptime
|
||||
name: Uptime Sensor
|
||||
|
||||
|
||||
climate:
|
||||
- platform: aux_ac
|
||||
name: $upper_devicename
|
||||
id: aux_id
|
||||
uart_id: ac_uart_bus
|
||||
period: 7s
|
||||
show_action: true
|
||||
display_inverted: true
|
||||
|
||||
|
||||
button:
|
||||
- platform: template
|
||||
name: ${upper_devicename} VLouver Stop
|
||||
icon: "mdi:circle-small"
|
||||
on_press:
|
||||
- aux_ac.vlouver_stop: aux_id
|
||||
|
||||
- platform: template
|
||||
name: ${upper_devicename} VLouver Swing
|
||||
icon: "mdi:pan-vertical"
|
||||
on_press:
|
||||
- aux_ac.vlouver_swing: aux_id
|
||||
|
||||
- platform: template
|
||||
name: ${upper_devicename} VLouver Top
|
||||
icon: "mdi:pan-up"
|
||||
on_press:
|
||||
- aux_ac.vlouver_top: aux_id
|
||||
|
||||
- platform: template
|
||||
name: ${upper_devicename} VLouver Middle Above
|
||||
icon: "mdi:pan-top-left"
|
||||
on_press:
|
||||
- aux_ac.vlouver_middle_above: aux_id
|
||||
|
||||
- platform: template
|
||||
name: ${upper_devicename} VLouver Middle
|
||||
icon: "mdi:pan-left"
|
||||
on_press:
|
||||
- aux_ac.vlouver_middle: aux_id
|
||||
|
||||
- platform: template
|
||||
name: ${upper_devicename} VLouver Middle Below
|
||||
icon: "mdi:pan-bottom-left"
|
||||
on_press:
|
||||
- aux_ac.vlouver_middle_below: aux_id
|
||||
|
||||
- platform: template
|
||||
name: ${upper_devicename} VLouver Bottom
|
||||
icon: "mdi:pan-down"
|
||||
on_press:
|
||||
- aux_ac.vlouver_bottom: aux_id
|
||||
|
||||
|
||||
number:
|
||||
- platform: template
|
||||
name: ${upper_devicename} Vertical Louver
|
||||
id: ${devicename}_vlouver
|
||||
icon: "mdi:circle-small"
|
||||
mode: "slider"
|
||||
min_value: 0
|
||||
max_value: 6
|
||||
step: 1
|
||||
set_action:
|
||||
then:
|
||||
- lambda: !lambda |-
|
||||
if (x == 6) x = 7; // делаем так, чтобы выключение отрабатывать корректно
|
||||
id(aux_id).setVLouverSequence( static_cast<esphome::aux_ac::ac_louver_V>(x) );
|
||||
@@ -3,8 +3,12 @@ external_components:
|
||||
type: local
|
||||
path: ..\components
|
||||
|
||||
substitutions:
|
||||
devicename: test_local_airflow_dir
|
||||
upper_devicename: Test AUX
|
||||
|
||||
esphome:
|
||||
name: test_aux_ac_local
|
||||
name: $devicename
|
||||
platform: ESP8266
|
||||
board: esp12e
|
||||
|
||||
@@ -51,21 +55,54 @@ sensor:
|
||||
|
||||
climate:
|
||||
- platform: aux_ac
|
||||
name: "AC Name"
|
||||
name: $upper_devicename
|
||||
id: aux_id
|
||||
uart_id: ac_uart_bus
|
||||
period: 7s # период опроса состояния сплита, по дефолту 7 сек
|
||||
show_action: true # надо ли показывать текущий режим работы: при HEAT_COOL mode сплит может греть (HEAT), охлаждать (COOL) или бездействовать (IDLE)
|
||||
indoor_temperature: # сенсор, показывающий температуру воздуха на внутреннем блоке кондиционера; имеет все те же параметры, как и любой сенсор ESPHome
|
||||
name: AC Indoor Temperature
|
||||
id: ac_indoor_temp
|
||||
internal: true # сенсор установлен как внутренний по дефолту (не попадёт в Home Assistant)
|
||||
period: 7s
|
||||
show_action: true
|
||||
display_inverted: true
|
||||
indoor_temperature:
|
||||
name: $upper_devicename Indoor Temperature
|
||||
id: ${devicename}_indoor_temp
|
||||
internal: false
|
||||
display_state:
|
||||
name: $upper_devicename Display State
|
||||
id: ${devicename}_display_state
|
||||
internal: false
|
||||
outdoor_temperature:
|
||||
name: $upper_devicename Outdoor Temperature
|
||||
id: ${devicename}_outdoor_temp
|
||||
internal: false
|
||||
outbound_temperature:
|
||||
name: $upper_devicename Colant Outbound Temperature
|
||||
id: ${devicename}_outbound_temp
|
||||
internal: false
|
||||
inbound_temperature:
|
||||
name: $upper_devicename Colant Inbound Temperature
|
||||
id: ${devicename}_inbound_temp
|
||||
internal: false
|
||||
compressor_temperature:
|
||||
name: $upper_devicename Compressor Temperature
|
||||
id: ${devicename}_strange_temp
|
||||
internal: false
|
||||
defrost_state:
|
||||
name: $upper_devicename Defrost State
|
||||
id: ${devicename}_defrost_state
|
||||
internal: false
|
||||
invertor_power:
|
||||
name: $upper_devicename Invertor Power
|
||||
id: ${devicename}_invertor_power
|
||||
internal: false
|
||||
preset_reporter:
|
||||
name: $upper_devicename Preset Reporter
|
||||
id: ${devicename}_preset_reporter
|
||||
internal: false
|
||||
visual:
|
||||
min_temperature: 16
|
||||
max_temperature: 32
|
||||
temperature_step: 0.5
|
||||
supported_modes:
|
||||
- HEAT_COOL # не AUTO, так как только нагревает и остужает. В доках на ESPHome говорится, что AUTO - это если у устройства есть календарь и какие-то установки по расписанию.
|
||||
- HEAT_COOL
|
||||
- COOL
|
||||
- HEAT
|
||||
- DRY
|
||||
@@ -77,10 +114,9 @@ climate:
|
||||
- SLEEP
|
||||
custom_presets:
|
||||
- CLEAN
|
||||
- FEEL
|
||||
- HEALTH
|
||||
- ANTIFUNGUS
|
||||
supported_swing_modes:
|
||||
- VERTICAL
|
||||
- HORIZONTAL
|
||||
- BOTH
|
||||
- BOTH
|
||||
|
||||
@@ -6,8 +6,12 @@ external_components:
|
||||
#components: [ aux_ac ]
|
||||
#refresh: 0s
|
||||
|
||||
substitutions:
|
||||
devicename: test_local_minimal
|
||||
upper_devicename: Test AUX
|
||||
|
||||
esphome:
|
||||
name: test_aux_ac_minimal
|
||||
name: $devicename
|
||||
platform: ESP8266
|
||||
board: esp12e
|
||||
|
||||
@@ -41,4 +45,4 @@ uart:
|
||||
|
||||
climate:
|
||||
- platform: aux_ac
|
||||
name: "AC Name"
|
||||
name: $upper_devicename
|
||||
Reference in New Issue
Block a user