#=============================================================================== # Контроллер кондиционера в гостиной # Wemos D1 mini #=============================================================================== substitutions: node_name: ac_bedroom # Use a unique name. node_id: ac_bedroom # Use a unique id. deviceid: ac_bedroom devicename: ac_bedroom friendly_node_name: "Кондиционер Спальня" #=============================================================================== # Общий конфиг #=============================================================================== esphome: name: ${node_name} friendly_name: ${friendly_node_name} includes: - ac_tcl_climate.h esp8266: board: d1_mini external_components: - source: type: git url: https://github.com/robertklep/esphome-custom-component components: [ custom, custom_component ] web_server: port: 80 auth: username: admin password: superLongP4ss # Enable Home Assistant API api: encryption: key: !secret api_encryption_key ota: - platform: esphome password: !secret api_encryption_key wifi: ssid: !secret wifi_24_name password: !secret wifi_24_pass # Enable fallback hotspot (captive portal) in case wifi connection fails ap: ssid: "${devicename} Fallback Hotspot" password: !secret esphome_captive_pass captive_portal: uart: id: uart_bus tx_pin: 1 rx_pin: 3 baud_rate: 9600 parity: EVEN logger: #level: VERBOSE baud_rate: 0 climate: - platform: custom lambda: |- auto my_custom_climate = new MyCustomClimate(id(uart_bus)); App.register_component(my_custom_climate); return {my_custom_climate}; climates: - name: "TCL a/c" id: my_custom_climate select: - platform: template name: Vertical swing id: vswing entity_category: config options: - "Last position" - "Fix top" - "Fix upper" - "Fix mid" - "Fix lower" - "Fix bottom" - "Move full" - "Move upper" - "Move lower" set_action: then: lambda: |- static_cast(id(my_custom_climate))->control_vertical_swing(x); - platform: template name: Horizontal swing id: hswing entity_category: config options: - "Last position" - "Fix left" - "Fix mid left" - "Fix mid" - "Fix mid right" - "Fix right" - "Move full" - "Move left" - "Move mid" - "Move right" set_action: then: lambda: |- static_cast(id(my_custom_climate))->control_horizontal_swing(x);