actions for louvers vertical position + docs

This commit is contained in:
GrKoR
2022-06-02 22:06:10 +03:00
parent fc2fd99cec
commit 0500eae87b
4 changed files with 286 additions and 49 deletions

View File

@@ -85,19 +85,48 @@ climate:
uart_id: ac_uart_bus
period: 7s
show_action: true
display_inverted: false
display_inverted: true
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.

119
README.md
View File

@@ -87,19 +87,48 @@ climate:
uart_id: ac_uart_bus
period: 7s
show_action: true
display_inverted: false
display_inverted: true
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
@@ -113,7 +142,6 @@ climate:
- SLEEP
custom_presets:
- CLEAN
- FEEL
- HEALTH
- ANTIFUNGUS
supported_swing_modes:
@@ -138,15 +166,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.
@@ -171,6 +207,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`.

View File

@@ -147,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) );

View File

@@ -121,39 +121,5 @@ number:
set_action:
then:
- lambda: !lambda |-
auto icon = "";
if (x == 6) x = 7; // делаем так, чтобы выключение отрабатывать корректно
switch ( static_cast<uint8_t>(x) ) {
case 0: // vertical swing
icon = "mdi:pan-vertical";
break;
case 1: // top position
icon = "mdi:pan-up";
break;
case 2: // middle above position
icon = "mdi:pan-top-left";
break;
case 3: // middle position
icon = "mdi:pan-left";
break;
case 4: // middle below position
icon = "mdi:pan-bottom-left";
break;
case 5: // bottom position
icon = "mdi:pan-down";
break;
case 7: // stop vertical louver
default:
icon = "mdi:circle-small";
break;
}
id(${devicename}_vlouver).set_icon(icon);
id(aux_id).setVLouverSequence( static_cast<esphome::aux_ac::ac_louver_V>(x) );