Files
tclac/packages/core.yaml
2025-11-02 10:01:21 +01:00

323 lines
13 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # NICHT BEARBEITEN!! # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Компонент климата
external_components:
- source:
url: https://github.com/Kannix2005/tclac.git
type: git
ref: master
components: [ tclac ]
refresh: 30s
# Конфигурация ESPHome
esphome:
name: ${device_name}
min_version: 2023.3.0
friendly_name: ${humanly_name}
on_boot:
priority: -100
then:
lambda: !lambda |-
id(${device_name}climate).set_beeper_state(false);
id(${device_name}climate).set_force_mode_state(false);
if (id(display_mode).state){
id(${device_name}climate).set_display_state(true);
} else {
id(${device_name}climate).set_display_state(false);
}
if (id(ledflash_mode).state){
id(${device_name}climate).set_module_display_state(true);
} else {
id(${device_name}climate).set_module_display_state(false);
}
if (id(vswing).active_index() == 0){
id(${device_name}climate).set_vertical_swing_direction(esphome::tclac::VerticalSwingDirection::UP_DOWN);
} else if (id(vswing).active_index() == 1){
id(${device_name}climate).set_vertical_swing_direction(esphome::tclac::VerticalSwingDirection::UPSIDE);
} else if (id(vswing).active_index() == 2){
id(${device_name}climate).set_vertical_swing_direction(esphome::tclac::VerticalSwingDirection::DOWNSIDE);
} else if (id(vswing).active_index() == 3){
id(${device_name}climate).set_vertical_swing_direction(esphome::tclac::VerticalSwingDirection::OFF);
}
if (id(hswing).active_index() == 0){
id(${device_name}climate).set_horizontal_swing_direction(esphome::tclac::HorizontalSwingDirection::LEFT_RIGHT);
} else if (id(hswing).active_index() == 1){
id(${device_name}climate).set_horizontal_swing_direction(esphome::tclac::HorizontalSwingDirection::LEFTSIDE);
} else if (id(hswing).active_index() == 2){
id(${device_name}climate).set_horizontal_swing_direction(esphome::tclac::HorizontalSwingDirection::CENTER);
} else if (id(hswing).active_index() == 3){
id(${device_name}climate).set_horizontal_swing_direction(esphome::tclac::HorizontalSwingDirection::RIGHTSIDE);
} else if (id(hswing).active_index() == 4){
id(${device_name}climate).set_horizontal_swing_direction(esphome::tclac::HorizontalSwingDirection::OFF);
}
if (id(vfixing).active_index() == 0){
id(${device_name}climate).set_vertical_airflow(esphome::tclac::AirflowVerticalDirection::LAST);
} else if (id(vfixing).active_index() == 1){
id(${device_name}climate).set_vertical_airflow(esphome::tclac::AirflowVerticalDirection::MAX_UP);
} else if (id(vfixing).active_index() == 2){
id(${device_name}climate).set_vertical_airflow(esphome::tclac::AirflowVerticalDirection::UP);
} else if (id(vfixing).active_index() == 3){
id(${device_name}climate).set_vertical_airflow(esphome::tclac::AirflowVerticalDirection::CENTER);
} else if (id(vfixing).active_index() == 4){
id(${device_name}climate).set_vertical_airflow(esphome::tclac::AirflowVerticalDirection::DOWN);
} else if (id(vfixing).active_index() == 5){
id(${device_name}climate).set_vertical_airflow(esphome::tclac::AirflowVerticalDirection::MAX_DOWN);
}
if (id(hfixing).active_index() == 0){
id(${device_name}climate).set_horizontal_airflow(esphome::tclac::AirflowHorizontalDirection::LAST);
} else if (id(hfixing).active_index() == 1){
id(${device_name}climate).set_horizontal_airflow(esphome::tclac::AirflowHorizontalDirection::MAX_LEFT);
} else if (id(hfixing).active_index() == 2){
id(${device_name}climate).set_horizontal_airflow(esphome::tclac::AirflowHorizontalDirection::LEFT);
} else if (id(hfixing).active_index() == 3){
id(${device_name}climate).set_horizontal_airflow(esphome::tclac::AirflowHorizontalDirection::CENTER);
} else if (id(hfixing).active_index() == 4){
id(${device_name}climate).set_horizontal_airflow(esphome::tclac::AirflowHorizontalDirection::RIGHT);
} else if (id(hfixing).active_index() == 5){
id(${device_name}climate).set_horizontal_airflow(esphome::tclac::AirflowHorizontalDirection::MAX_RIGHT);
}
if (id(beep_mode).state){
id(${device_name}climate).set_beeper_state(true);
} else {
id(${device_name}climate).set_beeper_state(false);
}
if (id(force_mode).state){
id(${device_name}climate).set_force_mode_state(true);
} else {
id(${device_name}climate).set_force_mode_state(false);
}
uart:
baud_rate: 9600
data_bits: 8
parity: EVEN
stop_bits: 1
rx_pin: ${uart_rx}
tx_pin: ${uart_tx}
api:
encryption:
key: "${api_key}"
ota:
- platform: esphome
password: "${ota_pass}"
wifi:
id: "${device_name}_wifi"
ssid: ${wifi_ssid}
password: ${wifi_password}
ap:
ssid: "${device_name} Fallback Hotspot"
password: "${recovery_pass}"
captive_portal:
# # # # # # # # # # # # # # # # # # # # # # #
# # # # # НЕ РЕДАКТИРОВАТЬ! # # # # #
# # # # # # # # # # # # # # # # # # # # # # #
# ОБЯЗАТЕЛЬНО отключаем логгирование через UART
logger:
baud_rate: 0
# Раздел настроек устройства:
# - Переключатели
switch:
# Пищалка для подтверждения команд, по умолчанию выключена
- name: Beeper
platform: template
device_class: switch
id: beep_mode
entity_category: config
restore_mode: RESTORE_DEFAULT_ON
optimistic: true
on_turn_on:
then:
lambda: !lambda |-
id(${device_name}climate).set_beeper_state(true);
on_turn_off:
then:
lambda: !lambda |-
id(${device_name}climate).set_beeper_state(false);
# Индикатор уставки температуры на корпусе внутреннего блока, по умолчанию включен
- name: Display
platform: template
device_class: switch
id: display_mode
entity_category: config
restore_mode: RESTORE_DEFAULT_ON
optimistic: true
on_turn_on:
then:
lambda: !lambda |-
id(${device_name}climate).set_display_state(true);
on_turn_off:
then:
lambda: !lambda |-
id(${device_name}climate).set_display_state(false);
# Светодиодная индикация обмена данными с кондиционером, по умолчанию выключена
- name: Display on module
platform: template
device_class: switch
id: ledflash_mode
entity_category: config
restore_mode: RESTORE_DEFAULT_ON
optimistic: true
on_turn_on:
then:
lambda: !lambda |-
id(${device_name}climate).set_module_display_state(true);
on_turn_off:
then:
lambda: !lambda |-
id(${device_name}climate).set_module_display_state(false);
- name: Force config
platform: template
device_class: switch
id: force_mode
entity_category: config
restore_mode: RESTORE_DEFAULT_ON
optimistic: true
on_turn_on:
then:
lambda: !lambda |-
id(${device_name}climate).set_force_mode_state(true);
on_turn_off:
then:
lambda: !lambda |-
id(${device_name}climate).set_force_mode_state(false);
# - Выпадающие списки
select:
# Настройка вертикального качания
- platform: template
name: Vertical swing
id: vswing
entity_category: config
options:
- "Von oben nach unten"
- "In der oberen Hälfte"
- "In der unteren Hälfte"
- "Aus"
optimistic: true
restore_value: true
on_value:
then:
lambda: !lambda |-
if (id(vswing).active_index() == 0){
id(${device_name}climate).set_vertical_swing_direction(esphome::tclac::VerticalSwingDirection::UP_DOWN);
} else if (id(vswing).active_index() == 1){
id(${device_name}climate).set_vertical_swing_direction(esphome::tclac::VerticalSwingDirection::UPSIDE);
} else if (id(vswing).active_index() == 2){
id(${device_name}climate).set_vertical_swing_direction(esphome::tclac::VerticalSwingDirection::DOWNSIDE);
} else if (id(vswing).active_index() == 3){
id(${device_name}climate).set_vertical_swing_direction(esphome::tclac::VerticalSwingDirection::OFF);
}
# Настройка горизонтального качания
- platform: template
name: Horizontal swing
id: hswing
entity_category: config
options:
- "Von links nach rechts"
- "Im linken Bereich"
- "Im Zentrum"
- "Im rechten Bereich"
- "Aus"
optimistic: true
restore_value: true
on_value:
then:
lambda: !lambda |-
if (id(hswing).active_index() == 0){
id(${device_name}climate).set_horizontal_swing_direction(esphome::tclac::HorizontalSwingDirection::LEFT_RIGHT);
} else if (id(hswing).active_index() == 1){
id(${device_name}climate).set_horizontal_swing_direction(esphome::tclac::HorizontalSwingDirection::LEFTSIDE);
} else if (id(hswing).active_index() == 2){
id(${device_name}climate).set_horizontal_swing_direction(esphome::tclac::HorizontalSwingDirection::CENTER);
} else if (id(hswing).active_index() == 3){
id(${device_name}climate).set_horizontal_swing_direction(esphome::tclac::HorizontalSwingDirection::RIGHTSIDE);
} else if (id(hswing).active_index() == 4){
id(${device_name}climate).set_horizontal_swing_direction(esphome::tclac::HorizontalSwingDirection::OFF);
}
# Настройка фиксации вертикальной заслонки
- platform: template
name: Vertical fixing
id: vfixing
entity_category: config
options:
- "Letzte Position"
- "Ganz nach oben"
- "In der oberen Hälfte"
- "In der Mitte"
- "In der unteren Hälfte"
- "Ganz nach unten"
optimistic: true
restore_value: true
on_value:
then:
lambda: !lambda |-
if (id(vfixing).active_index() == 0){
id(${device_name}climate).set_vertical_airflow(esphome::tclac::AirflowVerticalDirection::LAST);
} else if (id(vfixing).active_index() == 1){
id(${device_name}climate).set_vertical_airflow(esphome::tclac::AirflowVerticalDirection::MAX_UP);
} else if (id(vfixing).active_index() == 2){
id(${device_name}climate).set_vertical_airflow(esphome::tclac::AirflowVerticalDirection::UP);
} else if (id(vfixing).active_index() == 3){
id(${device_name}climate).set_vertical_airflow(esphome::tclac::AirflowVerticalDirection::CENTER);
} else if (id(vfixing).active_index() == 4){
id(${device_name}climate).set_vertical_airflow(esphome::tclac::AirflowVerticalDirection::DOWN);
} else if (id(vfixing).active_index() == 5){
id(${device_name}climate).set_vertical_airflow(esphome::tclac::AirflowVerticalDirection::MAX_DOWN);
}
# Настройка фиксации горизонатальных заслонок
- platform: template
name: Horizontal fixing
id: hfixing
entity_category: config
options:
- "Letzte Position"
- "Ganz nach links"
- "In der linken Hälfte"
- "In der Mitte"
- "In der rechten Hälfte"
- "Ganz nach rechts"
optimistic: true
restore_value: true
on_value:
then:
lambda: !lambda |-
if (id(hfixing).active_index() == 0){
id(${device_name}climate).set_horizontal_airflow(esphome::tclac::AirflowHorizontalDirection::LAST);
} else if (id(hfixing).active_index() == 1){
id(${device_name}climate).set_horizontal_airflow(esphome::tclac::AirflowHorizontalDirection::MAX_LEFT);
} else if (id(hfixing).active_index() == 2){
id(${device_name}climate).set_horizontal_airflow(esphome::tclac::AirflowHorizontalDirection::LEFT);
} else if (id(hfixing).active_index() == 3){
id(${device_name}climate).set_horizontal_airflow(esphome::tclac::AirflowHorizontalDirection::CENTER);
} else if (id(hfixing).active_index() == 4){
id(${device_name}climate).set_horizontal_airflow(esphome::tclac::AirflowHorizontalDirection::RIGHT);
} else if (id(hfixing).active_index() == 5){
id(${device_name}climate).set_horizontal_airflow(esphome::tclac::AirflowHorizontalDirection::MAX_RIGHT);
}
climate:
- platform: tclac
name: "${device_name} Climate"
id: ${device_name}climate