KinCony KC868-A2 V2 ESPHome starting Template

I bought a couple of these boards, but ESPHome doesn’t include the template for the V2 boards.

So by parsing yaml from here and there I finally got something that is made for my board.

esphome:
  name: kincony-kc868-a2v2-esp32-2ch
  friendly_name: KinCony KC868-A2v2 (ESP32 2CH Relay)

esp32:
  board: esp32
  framework:
    type: arduino

  variant: ESP32
logger:

api:
  encryption:
    key: api_key

ota:
  - platform: esphome
network:
  priority: 
    - ethernet
    - wifi
# Onboard LAN8720 Ethernet PHY for KC868-A2 v2
ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk:
    pin: GPIO17
    mode: CLK_OUT
  phy_addr: 0
  power_pin: GPIO1

wifi:
  networks:
    - ssid: !secret first_ssid
      password: !secret first_pw
      id: royeiror
    - ssid: !secret second_ssid
      password: !secret second_pw
      id: royero
  ap:
    ssid: KinCony KC868-A Fallback Hotspot
    password: !secret hotspot_pw


captive_portal:


# Onboard RS485 Interface for v2
uart:
  - id: uart_1
    baud_rate: 9600
    debug:
      after:
        timeout: 10ms
      direction: BOTH
      dummy_receiver: true
    rx_pin: GPIO35
    tx_pin: GPIO32

binary_sensor:
  - platform: gpio
    name: A2v2-input1
    id: binary_sensor_gpio_1
    pin:
      inverted: true
      number: GPIO36
  - platform: gpio
    name: A2v2-input2
    id: binary_sensor_gpio_2
    pin:
      inverted: true
      number: GPIO39

switch:
  - platform: gpio
    name: A2v2-Relay1
    id: switch_gpio_1
    pin: GPIO15
  - platform: gpio
    name: A2v2-Relay2
    id: switch_gpio_2
    pin: GPIO2
  - platform: uart
    name: RS485 Button
    id: switch_uart_1
    data: [17, 34, 51, 68, 85]
    uart_id: uart_1