# ============================================================================ # KinCony F8 — Firmware de prueba: ESPHome + módulo Tuya integrado # Objetivo: ver los 8 relés en la app de Tuya y nada más. # # Basado directamente en: # - Ejemplo oficial del F8: https://devices.esphome.io/devices/kincony-f8/ # - Hoja de pines oficial del F8 (foro Kincony, hilo "KinCony F8 ESP32-S3 # IO pins define"): módulo Tuya en GPIO38/GPIO39, reset P28, led P16. # - Ejemplo real de Tuya en un F4 (misma interfaz Tuya que el F8), # publicado por el admin de Kincony en su foro: patrón de un switch GPIO # + un switch "platform: tuya_wifi_mcu" espejo por cada relé. # ============================================================================ esphome: name: kincony_f8 friendly_name: Kincony F8 platformio_options: board_build.extra_flags: - "-DWIFI_CONTROL_SELF_MODE=1" external_components: - source: type: git url: https://github.com/hzkincony/esphome-tuya-wifi-mcu ref: v1.3.1 esp32: variant: esp32s3 framework: type: arduino logger: api: encryption: key: !secret api_key reboot_timeout: 0s ota: - platform: esphome password: !secret ota_password ethernet: type: W5500 clk_pin: GPIO42 mosi_pin: GPIO43 miso_pin: GPIO44 cs_pin: GPIO41 interrupt_pin: GPIO2 reset_pin: GPIO1 i2c: - id: bus_a sda: 8 scl: 18 scan: true frequency: 400kHz pcf8574: - id: pcf8574_hub_in_1 i2c_id: bus_a address: 0x24 pcf8575: true # el F8 usa el expansor de 16 bits (8 entradas + 8 salidas) uart: - id: tuya_mcu_uart tx_pin: 39 rx_pin: 38 baud_rate: 9600 tuya_wifi_mcu: # product_id que te dio Kincony para el F8. Como es el genérico de ellos, # este test usa sus Data Points de fábrica (no hace falta definir nada # propio en la plataforma Tuya para esta prueba). product_id: gk6ok3aysk6lw1bb uart_id: tuya_mcu_uart wifi_reset_pin: 28 # botón de red del módulo Tuya (pin propio del módulo) wifi_led_pin: 16 # led de red del módulo Tuya (pin propio del módulo) switch: - platform: gpio name: "f8-output01" id: f8_output01 pin: { pcf8574: pcf8574_hub_in_1, number: 8, mode: OUTPUT, inverted: true } - platform: tuya_wifi_mcu name: "f8-output01-tuya" dp_id: 1 internal: true bind_switch_id: f8_output01 - platform: gpio name: "f8-output02" id: f8_output02 pin: { pcf8574: pcf8574_hub_in_1, number: 9, mode: OUTPUT, inverted: true } - platform: tuya_wifi_mcu name: "f8-output02-tuya" dp_id: 2 internal: true bind_switch_id: f8_output02 - platform: gpio name: "f8-output03" id: f8_output03 pin: { pcf8574: pcf8574_hub_in_1, number: 10, mode: OUTPUT, inverted: true } - platform: tuya_wifi_mcu name: "f8-output03-tuya" dp_id: 3 internal: true bind_switch_id: f8_output03 - platform: gpio name: "f8-output04" id: f8_output04 pin: { pcf8574: pcf8574_hub_in_1, number: 11, mode: OUTPUT, inverted: true } - platform: tuya_wifi_mcu name: "f8-output04-tuya" dp_id: 4 internal: true bind_switch_id: f8_output04 - platform: gpio name: "f8-output05" id: f8_output05 pin: { pcf8574: pcf8574_hub_in_1, number: 12, mode: OUTPUT, inverted: true } - platform: tuya_wifi_mcu name: "f8-output05-tuya" dp_id: 5 internal: true bind_switch_id: f8_output05 - platform: gpio name: "f8-output06" id: f8_output06 pin: { pcf8574: pcf8574_hub_in_1, number: 13, mode: OUTPUT, inverted: true } - platform: tuya_wifi_mcu name: "f8-output06-tuya" dp_id: 6 internal: true bind_switch_id: f8_output06 - platform: gpio name: "f8-output07" id: f8_output07 pin: { pcf8574: pcf8574_hub_in_1, number: 14, mode: OUTPUT, inverted: true } - platform: tuya_wifi_mcu name: "f8-output07-tuya" dp_id: 7 internal: true bind_switch_id: f8_output07 - platform: gpio name: "f8-output08" id: f8_output08 pin: { pcf8574: pcf8574_hub_in_1, number: 15, mode: OUTPUT, inverted: true } - platform: tuya_wifi_mcu name: "f8-output08-tuya" dp_id: 8 internal: true bind_switch_id: f8_output08