<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[Smart Home Automation Forum - F24]]></title>
		<link>https://www.kincony.com/forum/</link>
		<description><![CDATA[Smart Home Automation Forum - https://www.kincony.com/forum]]></description>
		<pubDate>Thu, 03 Dec 2026 20:05:12 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[F24 ESPHome yaml for home assistant by XL9555 chip]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=9939</link>
			<pubDate>Fri, 06 Nov 2026 15:25:31 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=9939</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>esphome:<br />
  name: f24<br />
  friendly_name: f24<br />
  platformio_options:<br />
    board_build.extra_flags:<br />
      # WIFI_CONTROL_SELF_MODE = 0<br />
      # WIFI_CONTROL_SELF_MODE = 1<br />
      - "-DWIFI_CONTROL_SELF_MODE=1"<br />
esp32:<br />
  board: esp32-s3-devkitc-1<br />
  framework:<br />
    type: esp-idf<br />
    <br />
<br />
external_components:<br />
  - source:<br />
      type: git<br />
      url: https://github.com/hzkincony/esphome-tuya-wifi-mcu<br />
      ref: v1.4.0<br />
<br />
# Enable logging<br />
<br />
  # hardware_uart: USB_SERIAL_JTAG<br />
# Enable Home Assistant API<br />
api:<br />
  encryption:<br />
    key: "WeVOuL5oNhjXcfzXtTirlOwvtWvCD5yqIxd3oV4es1k="<br />
<br />
ethernet:<br />
  type: W5500<br />
  clk_pin: GPIO42<br />
  mosi_pin: GPIO43<br />
  miso_pin: GPIO44<br />
  cs_pin: GPIO41<br />
  interrupt_pin: GPIO2<br />
  reset_pin: GPIO1<br />
<br />
i2c:<br />
 &nbsp;&nbsp;- id: bus_a<br />
   &nbsp;&nbsp;sda: 8<br />
   &nbsp;&nbsp;scl: 18<br />
   &nbsp;&nbsp;scan: true<br />
   &nbsp;&nbsp;frequency: 400kHz<br />
<br />
pca9554:<br />
  - id: 'xl9555_hub_out_1'  # for output channel 9-24<br />
    i2c_id: bus_a<br />
    address: 0x25<br />
    pin_count: 16<br />
<br />
  - id: 'xl9555_hub_in_1'  # for digital input channel 1-16<br />
    i2c_id: bus_a<br />
    address: 0x24<br />
    pin_count: 16<br />
<br />
  - id: 'xl9555_hub_out_in_2'  # for output channel 1-8  + (input 17-24)<br />
    i2c_id: bus_a<br />
    address: 0x26<br />
    pin_count: 16<br />
<br />
uart:<br />
  - id: uart_1    #RS485<br />
    baud_rate: 9600<br />
    debug:<br />
      direction: BOTH<br />
      dummy_receiver: true<br />
      after:<br />
        timeout: 10ms<br />
    tx_pin: 16<br />
    rx_pin: 17<br />
<br />
  - id: tuya_mcu_uart<br />
    tx_pin: GPIO39<br />
    rx_pin: GPIO38<br />
    baud_rate: 9600<br />
<br />
tuya_wifi_mcu:<br />
  # tuya mcu product id<br />
  product_id: cchos3g1j2ucfbyd<br />
  uart_id: tuya_mcu_uart<br />
  wifi_reset_pin: 28<br />
  wifi_led_pin: 16<br />
<br />
switch:<br />
  - platform: uart<br />
    uart_id: uart_1<br />
    name: "RS485 Button"<br />
    data: [0x11, 0x22, 0x33, 0x44, 0x55]<br />
<br />
  - platform: gpio<br />
    name: "f24-output01"<br />
    id: "f24_output01"<br />
    pin:<br />
      pca9554: xl9555_hub_out_in_2<br />
      number: 12<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output1-tuya<br />
    dp_id: 1<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output01"<br />
<br />
  - platform: gpio<br />
    name: "f24-output02"<br />
    id: "f24_output02"<br />
    pin:<br />
      pca9554: xl9555_hub_out_in_2<br />
      number: 13<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output2-tuya<br />
    dp_id: 2<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output02"<br />
<br />
  - platform: gpio<br />
    name: "f24-output03"<br />
    id: "f24_output03"<br />
    pin:<br />
      pca9554: xl9555_hub_out_in_2<br />
      number: 14<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output3-tuya<br />
    dp_id: 3<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output03"<br />
<br />
  - platform: gpio<br />
    name: "f24-output04"<br />
    id: "f24_output04"<br />
    pin:<br />
      pca9554: xl9555_hub_out_in_2<br />
      number: 15<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output4-tuya<br />
    dp_id: 4<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output04"<br />
<br />
  - platform: gpio<br />
    name: "f24-output05"<br />
    id: "f24_output05"<br />
    pin:<br />
      pca9554: xl9555_hub_out_in_2<br />
      number: 8<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output5-tuya<br />
    dp_id: 5<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output05"<br />
<br />
  - platform: gpio<br />
    name: "f24-output06"<br />
    id: "f24_output06"<br />
    pin:<br />
      pca9554: xl9555_hub_out_in_2<br />
      number: 9<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output6-tuya<br />
    dp_id: 6<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output06"<br />
<br />
  - platform: gpio<br />
    name: "f24-output07"<br />
    id: "f24_output07"<br />
    pin:<br />
      pca9554: xl9555_hub_out_in_2<br />
      number: 10<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output7-tuya<br />
    dp_id: 101<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output07"<br />
<br />
  - platform: gpio<br />
    name: "f24-output08"<br />
    id: "f24_output08"<br />
    pin:<br />
      pca9554: xl9555_hub_out_in_2<br />
      number: 11<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output8-tuya<br />
    dp_id: 102<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output08"<br />
<br />
  - platform: gpio<br />
    name: "f24-output09"<br />
    id: "f24_output09"<br />
    pin:<br />
      pca9554: xl9555_hub_out_1<br />
      number: 0<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output9-tuya<br />
    dp_id: 103<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output09"<br />
<br />
  - platform: gpio<br />
    name: "f24-output10"<br />
    id: "f24_output10"<br />
    pin:<br />
      pca9554: xl9555_hub_out_1<br />
      number: 1<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output10-tuya<br />
    dp_id: 104<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output10"<br />
<br />
  - platform: gpio<br />
    name: "f24-output11"<br />
    id: "f24_output11"<br />
    pin:<br />
      pca9554: xl9555_hub_out_1<br />
      number: 2<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output11-tuya<br />
    dp_id: 105<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output11"<br />
<br />
  - platform: gpio<br />
    name: "f24-output12"<br />
    id: "f24_output12"<br />
    pin:<br />
      pca9554: xl9555_hub_out_1<br />
      number: 3<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output12-tuya<br />
    dp_id: 106<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output12"<br />
<br />
  - platform: gpio<br />
    name: "f24-output13"<br />
    id: "f24_output13"<br />
    pin:<br />
      pca9554: xl9555_hub_out_1<br />
      number: 4<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output13-tuya<br />
    dp_id: 107<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output13"<br />
<br />
  - platform: gpio<br />
    name: "f24-output14"<br />
    id: "f24_output14"<br />
    pin:<br />
      pca9554: xl9555_hub_out_1<br />
      number: 5<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output14-tuya<br />
    dp_id: 108<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output14"<br />
<br />
  - platform: gpio<br />
    name: "f24-output15"<br />
    id: "f24_output15"<br />
    pin:<br />
      pca9554: xl9555_hub_out_1<br />
      number: 6<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output15-tuya<br />
    dp_id: 109<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output15"<br />
<br />
  - platform: gpio<br />
    name: "f24-output16"<br />
    id: "f24_output16"<br />
    pin:<br />
      pca9554: xl9555_hub_out_1<br />
      number: 7<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output16-tuya<br />
    dp_id: 110<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output16"<br />
<br />
  - platform: gpio<br />
    name: "f24-output17"<br />
    id: "f24_output17"<br />
    pin:<br />
      pca9554: xl9555_hub_out_1<br />
      number: 8<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output17-tuya<br />
    dp_id: 126<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output17"<br />
<br />
  - platform: gpio<br />
    name: "f24-output18"<br />
    id: "f24_output18"<br />
    pin:<br />
      pca9554: xl9555_hub_out_1<br />
      number: 9<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output18-tuya<br />
    dp_id: 129<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output18"<br />
<br />
  - platform: gpio<br />
    name: "f24-output19"<br />
    id: "f24_output19"<br />
    pin:<br />
      pca9554: xl9555_hub_out_1<br />
      number: 10<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output19-tuya<br />
    dp_id: 130<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output19"<br />
<br />
  - platform: gpio<br />
    name: "f24-output20"<br />
    id: "f24_output20"<br />
    pin:<br />
      pca9554: xl9555_hub_out_1<br />
      number: 11<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output20-tuya<br />
    dp_id: 131<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output20"<br />
<br />
  - platform: gpio<br />
    name: "f24-output21"<br />
    id: "f24_output21"<br />
    pin:<br />
      pca9554: xl9555_hub_out_1<br />
      number: 12<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output21-tuya<br />
    dp_id: 132<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output21"<br />
<br />
  - platform: gpio<br />
    name: "f24-output22"<br />
    id: "f24_output22"<br />
    pin:<br />
      pca9554: xl9555_hub_out_1<br />
      number: 13<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output22-tuya<br />
    dp_id: 133<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output22"<br />
<br />
  - platform: gpio<br />
    name: "f24-output23"<br />
    id: "f24_output23"<br />
    pin:<br />
      pca9554: xl9555_hub_out_1<br />
      number: 14<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output23-tuya<br />
    dp_id: 134<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output23"<br />
<br />
  - platform: gpio<br />
    name: "f24-output24"<br />
    id: "f24_output24"<br />
    pin:<br />
      pca9554: xl9555_hub_out_1<br />
      number: 15<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output24-tuya<br />
    dp_id: 135<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output24"<br />
<br />
<br />
binary_sensor:<br />
  - platform: gpio<br />
    name: "f24-input01"<br />
    id: "f24_input01"<br />
    pin:<br />
      pca9554: xl9555_hub_in_1<br />
      number: 0<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input1-tuya<br />
    dp_id: 111<br />
    bind_binary_sensor_id: f24_input01<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input02"<br />
    id: "f24_input02"<br />
    pin:<br />
      pca9554: xl9555_hub_in_1<br />
      number: 1<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input2-tuya<br />
    dp_id: 112<br />
    bind_binary_sensor_id: f24_input02<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input03"<br />
    id: "f24_input03"<br />
    pin:<br />
      pca9554: xl9555_hub_in_1<br />
      number: 2<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input3-tuya<br />
    dp_id: 113<br />
    bind_binary_sensor_id: f24_input03<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input04"<br />
    id: "f24_input04"<br />
    pin:<br />
      pca9554: xl9555_hub_in_1<br />
      number: 3<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input4-tuya<br />
    dp_id: 114<br />
    bind_binary_sensor_id: f24_input04<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input05"<br />
    id: "f24_input05"<br />
    pin:<br />
      pca9554: xl9555_hub_in_1<br />
      number: 4<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input5-tuya<br />
    dp_id: 115<br />
    bind_binary_sensor_id: f24_input05<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input06"<br />
    id: "f24_input06"<br />
    pin:<br />
      pca9554: xl9555_hub_in_1<br />
      number: 5<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input6-tuya<br />
    dp_id: 116<br />
    bind_binary_sensor_id: f24_input06<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input07"<br />
    id: "f24_input07"<br />
    pin:<br />
      pca9554: xl9555_hub_in_1<br />
      number: 6<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input7-tuya<br />
    dp_id: 117<br />
    bind_binary_sensor_id: f24_input07<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input08"<br />
    id: "f24_input08"<br />
    pin:<br />
      pca9554: xl9555_hub_in_1<br />
      number: 7<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input8-tuya<br />
    dp_id: 118<br />
    bind_binary_sensor_id: f24_input08<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input09"<br />
    id: "f24_input09"<br />
    pin:<br />
      pca9554: xl9555_hub_in_1<br />
      number: 8<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input9-tuya<br />
    dp_id: 119<br />
    bind_binary_sensor_id: f24_input09<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input10"<br />
    id: "f24_input10"<br />
    pin:<br />
      pca9554: xl9555_hub_in_1<br />
      number: 9<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input10-tuya<br />
    dp_id: 120<br />
    bind_binary_sensor_id: f24_input10<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input11"<br />
    id: "f24_input11"<br />
    pin:<br />
      pca9554: xl9555_hub_in_1<br />
      number: 10<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input11-tuya<br />
    dp_id: 121<br />
    bind_binary_sensor_id: f24_input11<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input12"<br />
    id: "f24_input12"<br />
    pin:<br />
      pca9554: xl9555_hub_in_1<br />
      number: 11<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input12-tuya<br />
    dp_id: 122<br />
    bind_binary_sensor_id: f24_input12<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input13"<br />
    id: "f24_input13"<br />
    pin:<br />
      pca9554: xl9555_hub_in_1<br />
      number: 12<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input13-tuya<br />
    dp_id: 123<br />
    bind_binary_sensor_id: f24_input13<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input14"<br />
    id: "f24_input14"<br />
    pin:<br />
      pca9554: xl9555_hub_in_1<br />
      number: 13<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input14-tuya<br />
    dp_id: 124<br />
    bind_binary_sensor_id: f24_input14<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input15"<br />
    id: "f24_input15"<br />
    pin:<br />
      pca9554: xl9555_hub_in_1<br />
      number: 14<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input15-tuya<br />
    dp_id: 125<br />
    bind_binary_sensor_id: f24_input15<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input16"<br />
    id: "f24_input16"<br />
    pin:<br />
      pca9554: xl9555_hub_in_1<br />
      number: 15<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input17"<br />
    id: "f24_input17"<br />
    pin:<br />
      pca9554: xl9555_hub_out_in_2<br />
      number: 0<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input18"<br />
    id: "f24_input18"<br />
    pin:<br />
      pca9554: xl9555_hub_out_in_2<br />
      number: 1<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input19"<br />
    id: "f24_input19"<br />
    pin:<br />
      pca9554: xl9555_hub_out_in_2<br />
      number: 2<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input20"<br />
    id: "f24_input20"<br />
    pin:<br />
      pca9554: xl9555_hub_out_in_2<br />
      number: 3<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input21"<br />
    id: "f24_input21"<br />
    pin:<br />
      pca9554: xl9555_hub_out_in_2<br />
      number: 4<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input22"<br />
    id: "f24_input22"<br />
    pin:<br />
      pca9554: xl9555_hub_out_in_2<br />
      number: 5<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input23"<br />
    id: "f24_input23"<br />
    pin:<br />
      pca9554: xl9555_hub_out_in_2<br />
      number: 6<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input24"<br />
    id: "f24_input24"<br />
    pin:<br />
      pca9554: xl9555_hub_out_in_2<br />
      number: 7<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
##pull-up resistance on PCB<br />
  - platform: gpio<br />
    name: "f24-W1-io48"<br />
    pin: <br />
      number: 48<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f24-W1-io47"<br />
    pin: <br />
      number: 47<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f24-W1-io21"<br />
    pin: <br />
      number: 21<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f24-W1-io15"<br />
    pin: <br />
      number: 15<br />
      inverted: true<br />
## without resistance on PCB<br />
  - platform: gpio<br />
    name: "f24-W1-io13"<br />
    pin: <br />
      number: 13<br />
      inverted: false<br />
<br />
  - platform: gpio<br />
    name: "f24-W1-io14"<br />
    pin: <br />
      number: 14<br />
      inverted:  false<br />
<br />
  - platform: gpio<br />
    name: "f24-433M"<br />
    pin: <br />
      number: 40<br />
      inverted:  false<br />
<br />
sensor:<br />
  - platform: adc<br />
    pin: 5<br />
    name: "f24 A1 Voltage"<br />
    update_interval: 5s<br />
    attenuation: 11db<br />
    filters:<br />
      - lambda:<br />
          if (x &gt;= 3.11) {<br />
            return x * 1.60256;<br />
          } else if (x &lt;= 0.15) {<br />
            return 0;<br />
          } else {<br />
            return x * 1.51;<br />
          }<br />
  - platform: adc<br />
    pin: 7<br />
    name: "f24 A2 Voltage"<br />
    update_interval: 5s<br />
    attenuation: 11db<br />
    filters:<br />
      # - multiply: 1.51515<br />
      - lambda:<br />
          if (x &gt;= 3.11) {<br />
            return x * 1.60256;<br />
          } else if (x &lt;= 0.15) {<br />
            return 0;<br />
          } else {<br />
            return x * 1.51;<br />
          }<br />
  - platform: adc<br />
    pin: 6<br />
    name: "f24 A3 Current"<br />
    update_interval: 5s<br />
    unit_of_measurement: mA<br />
    attenuation: 11db<br />
    filters:<br />
      - multiply: 6.66666666<br />
  - platform: adc<br />
    pin: 4<br />
    name: "f24 A4 Current"<br />
    update_interval: 5s<br />
    unit_of_measurement: mA<br />
    attenuation: 11db<br />
    filters:<br />
      - multiply: 6.66666666<br />
<br />
web_server:<br />
  port: 80<br />
<br />
font:<br />
  - file: "gfonts://Roboto"<br />
    id: roboto<br />
    size: 20<br />
<br />
display:<br />
  - platform: ssd1306_i2c<br />
    i2c_id: bus_a<br />
    model: "SSD1306 128x64"<br />
    address: 0x3C<br />
    lambda: |-<br />
      it.printf(0, 0, id(roboto), "KinCony F24");</code></div></div> download yaml file: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/txt.png" title="Text Document" border="0" alt=".txt" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=10750" target="_blank" title="">F24-HA-with-Tyua-XL9555.txt</a> (Size: 18.5 KB / Downloads: 82)
<!-- end: postbit_attachments_attachment --><br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=10751" target="_blank" title="">F24-HA-web.png</a> (Size: 180.43 KB / Downloads: 105)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>esphome:<br />
  name: f24<br />
  friendly_name: f24<br />
  platformio_options:<br />
    board_build.extra_flags:<br />
      # WIFI_CONTROL_SELF_MODE = 0<br />
      # WIFI_CONTROL_SELF_MODE = 1<br />
      - "-DWIFI_CONTROL_SELF_MODE=1"<br />
esp32:<br />
  board: esp32-s3-devkitc-1<br />
  framework:<br />
    type: esp-idf<br />
    <br />
<br />
external_components:<br />
  - source:<br />
      type: git<br />
      url: https://github.com/hzkincony/esphome-tuya-wifi-mcu<br />
      ref: v1.4.0<br />
<br />
# Enable logging<br />
<br />
  # hardware_uart: USB_SERIAL_JTAG<br />
# Enable Home Assistant API<br />
api:<br />
  encryption:<br />
    key: "WeVOuL5oNhjXcfzXtTirlOwvtWvCD5yqIxd3oV4es1k="<br />
<br />
ethernet:<br />
  type: W5500<br />
  clk_pin: GPIO42<br />
  mosi_pin: GPIO43<br />
  miso_pin: GPIO44<br />
  cs_pin: GPIO41<br />
  interrupt_pin: GPIO2<br />
  reset_pin: GPIO1<br />
<br />
i2c:<br />
 &nbsp;&nbsp;- id: bus_a<br />
   &nbsp;&nbsp;sda: 8<br />
   &nbsp;&nbsp;scl: 18<br />
   &nbsp;&nbsp;scan: true<br />
   &nbsp;&nbsp;frequency: 400kHz<br />
<br />
pca9554:<br />
  - id: 'xl9555_hub_out_1'  # for output channel 9-24<br />
    i2c_id: bus_a<br />
    address: 0x25<br />
    pin_count: 16<br />
<br />
  - id: 'xl9555_hub_in_1'  # for digital input channel 1-16<br />
    i2c_id: bus_a<br />
    address: 0x24<br />
    pin_count: 16<br />
<br />
  - id: 'xl9555_hub_out_in_2'  # for output channel 1-8  + (input 17-24)<br />
    i2c_id: bus_a<br />
    address: 0x26<br />
    pin_count: 16<br />
<br />
uart:<br />
  - id: uart_1    #RS485<br />
    baud_rate: 9600<br />
    debug:<br />
      direction: BOTH<br />
      dummy_receiver: true<br />
      after:<br />
        timeout: 10ms<br />
    tx_pin: 16<br />
    rx_pin: 17<br />
<br />
  - id: tuya_mcu_uart<br />
    tx_pin: GPIO39<br />
    rx_pin: GPIO38<br />
    baud_rate: 9600<br />
<br />
tuya_wifi_mcu:<br />
  # tuya mcu product id<br />
  product_id: cchos3g1j2ucfbyd<br />
  uart_id: tuya_mcu_uart<br />
  wifi_reset_pin: 28<br />
  wifi_led_pin: 16<br />
<br />
switch:<br />
  - platform: uart<br />
    uart_id: uart_1<br />
    name: "RS485 Button"<br />
    data: [0x11, 0x22, 0x33, 0x44, 0x55]<br />
<br />
  - platform: gpio<br />
    name: "f24-output01"<br />
    id: "f24_output01"<br />
    pin:<br />
      pca9554: xl9555_hub_out_in_2<br />
      number: 12<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output1-tuya<br />
    dp_id: 1<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output01"<br />
<br />
  - platform: gpio<br />
    name: "f24-output02"<br />
    id: "f24_output02"<br />
    pin:<br />
      pca9554: xl9555_hub_out_in_2<br />
      number: 13<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output2-tuya<br />
    dp_id: 2<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output02"<br />
<br />
  - platform: gpio<br />
    name: "f24-output03"<br />
    id: "f24_output03"<br />
    pin:<br />
      pca9554: xl9555_hub_out_in_2<br />
      number: 14<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output3-tuya<br />
    dp_id: 3<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output03"<br />
<br />
  - platform: gpio<br />
    name: "f24-output04"<br />
    id: "f24_output04"<br />
    pin:<br />
      pca9554: xl9555_hub_out_in_2<br />
      number: 15<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output4-tuya<br />
    dp_id: 4<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output04"<br />
<br />
  - platform: gpio<br />
    name: "f24-output05"<br />
    id: "f24_output05"<br />
    pin:<br />
      pca9554: xl9555_hub_out_in_2<br />
      number: 8<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output5-tuya<br />
    dp_id: 5<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output05"<br />
<br />
  - platform: gpio<br />
    name: "f24-output06"<br />
    id: "f24_output06"<br />
    pin:<br />
      pca9554: xl9555_hub_out_in_2<br />
      number: 9<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output6-tuya<br />
    dp_id: 6<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output06"<br />
<br />
  - platform: gpio<br />
    name: "f24-output07"<br />
    id: "f24_output07"<br />
    pin:<br />
      pca9554: xl9555_hub_out_in_2<br />
      number: 10<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output7-tuya<br />
    dp_id: 101<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output07"<br />
<br />
  - platform: gpio<br />
    name: "f24-output08"<br />
    id: "f24_output08"<br />
    pin:<br />
      pca9554: xl9555_hub_out_in_2<br />
      number: 11<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output8-tuya<br />
    dp_id: 102<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output08"<br />
<br />
  - platform: gpio<br />
    name: "f24-output09"<br />
    id: "f24_output09"<br />
    pin:<br />
      pca9554: xl9555_hub_out_1<br />
      number: 0<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output9-tuya<br />
    dp_id: 103<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output09"<br />
<br />
  - platform: gpio<br />
    name: "f24-output10"<br />
    id: "f24_output10"<br />
    pin:<br />
      pca9554: xl9555_hub_out_1<br />
      number: 1<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output10-tuya<br />
    dp_id: 104<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output10"<br />
<br />
  - platform: gpio<br />
    name: "f24-output11"<br />
    id: "f24_output11"<br />
    pin:<br />
      pca9554: xl9555_hub_out_1<br />
      number: 2<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output11-tuya<br />
    dp_id: 105<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output11"<br />
<br />
  - platform: gpio<br />
    name: "f24-output12"<br />
    id: "f24_output12"<br />
    pin:<br />
      pca9554: xl9555_hub_out_1<br />
      number: 3<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output12-tuya<br />
    dp_id: 106<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output12"<br />
<br />
  - platform: gpio<br />
    name: "f24-output13"<br />
    id: "f24_output13"<br />
    pin:<br />
      pca9554: xl9555_hub_out_1<br />
      number: 4<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output13-tuya<br />
    dp_id: 107<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output13"<br />
<br />
  - platform: gpio<br />
    name: "f24-output14"<br />
    id: "f24_output14"<br />
    pin:<br />
      pca9554: xl9555_hub_out_1<br />
      number: 5<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output14-tuya<br />
    dp_id: 108<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output14"<br />
<br />
  - platform: gpio<br />
    name: "f24-output15"<br />
    id: "f24_output15"<br />
    pin:<br />
      pca9554: xl9555_hub_out_1<br />
      number: 6<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output15-tuya<br />
    dp_id: 109<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output15"<br />
<br />
  - platform: gpio<br />
    name: "f24-output16"<br />
    id: "f24_output16"<br />
    pin:<br />
      pca9554: xl9555_hub_out_1<br />
      number: 7<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output16-tuya<br />
    dp_id: 110<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output16"<br />
<br />
  - platform: gpio<br />
    name: "f24-output17"<br />
    id: "f24_output17"<br />
    pin:<br />
      pca9554: xl9555_hub_out_1<br />
      number: 8<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output17-tuya<br />
    dp_id: 126<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output17"<br />
<br />
  - platform: gpio<br />
    name: "f24-output18"<br />
    id: "f24_output18"<br />
    pin:<br />
      pca9554: xl9555_hub_out_1<br />
      number: 9<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output18-tuya<br />
    dp_id: 129<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output18"<br />
<br />
  - platform: gpio<br />
    name: "f24-output19"<br />
    id: "f24_output19"<br />
    pin:<br />
      pca9554: xl9555_hub_out_1<br />
      number: 10<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output19-tuya<br />
    dp_id: 130<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output19"<br />
<br />
  - platform: gpio<br />
    name: "f24-output20"<br />
    id: "f24_output20"<br />
    pin:<br />
      pca9554: xl9555_hub_out_1<br />
      number: 11<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output20-tuya<br />
    dp_id: 131<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output20"<br />
<br />
  - platform: gpio<br />
    name: "f24-output21"<br />
    id: "f24_output21"<br />
    pin:<br />
      pca9554: xl9555_hub_out_1<br />
      number: 12<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output21-tuya<br />
    dp_id: 132<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output21"<br />
<br />
  - platform: gpio<br />
    name: "f24-output22"<br />
    id: "f24_output22"<br />
    pin:<br />
      pca9554: xl9555_hub_out_1<br />
      number: 13<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output22-tuya<br />
    dp_id: 133<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output22"<br />
<br />
  - platform: gpio<br />
    name: "f24-output23"<br />
    id: "f24_output23"<br />
    pin:<br />
      pca9554: xl9555_hub_out_1<br />
      number: 14<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output23-tuya<br />
    dp_id: 134<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output23"<br />
<br />
  - platform: gpio<br />
    name: "f24-output24"<br />
    id: "f24_output24"<br />
    pin:<br />
      pca9554: xl9555_hub_out_1<br />
      number: 15<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output24-tuya<br />
    dp_id: 135<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output24"<br />
<br />
<br />
binary_sensor:<br />
  - platform: gpio<br />
    name: "f24-input01"<br />
    id: "f24_input01"<br />
    pin:<br />
      pca9554: xl9555_hub_in_1<br />
      number: 0<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input1-tuya<br />
    dp_id: 111<br />
    bind_binary_sensor_id: f24_input01<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input02"<br />
    id: "f24_input02"<br />
    pin:<br />
      pca9554: xl9555_hub_in_1<br />
      number: 1<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input2-tuya<br />
    dp_id: 112<br />
    bind_binary_sensor_id: f24_input02<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input03"<br />
    id: "f24_input03"<br />
    pin:<br />
      pca9554: xl9555_hub_in_1<br />
      number: 2<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input3-tuya<br />
    dp_id: 113<br />
    bind_binary_sensor_id: f24_input03<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input04"<br />
    id: "f24_input04"<br />
    pin:<br />
      pca9554: xl9555_hub_in_1<br />
      number: 3<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input4-tuya<br />
    dp_id: 114<br />
    bind_binary_sensor_id: f24_input04<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input05"<br />
    id: "f24_input05"<br />
    pin:<br />
      pca9554: xl9555_hub_in_1<br />
      number: 4<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input5-tuya<br />
    dp_id: 115<br />
    bind_binary_sensor_id: f24_input05<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input06"<br />
    id: "f24_input06"<br />
    pin:<br />
      pca9554: xl9555_hub_in_1<br />
      number: 5<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input6-tuya<br />
    dp_id: 116<br />
    bind_binary_sensor_id: f24_input06<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input07"<br />
    id: "f24_input07"<br />
    pin:<br />
      pca9554: xl9555_hub_in_1<br />
      number: 6<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input7-tuya<br />
    dp_id: 117<br />
    bind_binary_sensor_id: f24_input07<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input08"<br />
    id: "f24_input08"<br />
    pin:<br />
      pca9554: xl9555_hub_in_1<br />
      number: 7<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input8-tuya<br />
    dp_id: 118<br />
    bind_binary_sensor_id: f24_input08<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input09"<br />
    id: "f24_input09"<br />
    pin:<br />
      pca9554: xl9555_hub_in_1<br />
      number: 8<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input9-tuya<br />
    dp_id: 119<br />
    bind_binary_sensor_id: f24_input09<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input10"<br />
    id: "f24_input10"<br />
    pin:<br />
      pca9554: xl9555_hub_in_1<br />
      number: 9<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input10-tuya<br />
    dp_id: 120<br />
    bind_binary_sensor_id: f24_input10<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input11"<br />
    id: "f24_input11"<br />
    pin:<br />
      pca9554: xl9555_hub_in_1<br />
      number: 10<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input11-tuya<br />
    dp_id: 121<br />
    bind_binary_sensor_id: f24_input11<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input12"<br />
    id: "f24_input12"<br />
    pin:<br />
      pca9554: xl9555_hub_in_1<br />
      number: 11<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input12-tuya<br />
    dp_id: 122<br />
    bind_binary_sensor_id: f24_input12<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input13"<br />
    id: "f24_input13"<br />
    pin:<br />
      pca9554: xl9555_hub_in_1<br />
      number: 12<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input13-tuya<br />
    dp_id: 123<br />
    bind_binary_sensor_id: f24_input13<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input14"<br />
    id: "f24_input14"<br />
    pin:<br />
      pca9554: xl9555_hub_in_1<br />
      number: 13<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input14-tuya<br />
    dp_id: 124<br />
    bind_binary_sensor_id: f24_input14<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input15"<br />
    id: "f24_input15"<br />
    pin:<br />
      pca9554: xl9555_hub_in_1<br />
      number: 14<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input15-tuya<br />
    dp_id: 125<br />
    bind_binary_sensor_id: f24_input15<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input16"<br />
    id: "f24_input16"<br />
    pin:<br />
      pca9554: xl9555_hub_in_1<br />
      number: 15<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input17"<br />
    id: "f24_input17"<br />
    pin:<br />
      pca9554: xl9555_hub_out_in_2<br />
      number: 0<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input18"<br />
    id: "f24_input18"<br />
    pin:<br />
      pca9554: xl9555_hub_out_in_2<br />
      number: 1<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input19"<br />
    id: "f24_input19"<br />
    pin:<br />
      pca9554: xl9555_hub_out_in_2<br />
      number: 2<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input20"<br />
    id: "f24_input20"<br />
    pin:<br />
      pca9554: xl9555_hub_out_in_2<br />
      number: 3<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input21"<br />
    id: "f24_input21"<br />
    pin:<br />
      pca9554: xl9555_hub_out_in_2<br />
      number: 4<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input22"<br />
    id: "f24_input22"<br />
    pin:<br />
      pca9554: xl9555_hub_out_in_2<br />
      number: 5<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input23"<br />
    id: "f24_input23"<br />
    pin:<br />
      pca9554: xl9555_hub_out_in_2<br />
      number: 6<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input24"<br />
    id: "f24_input24"<br />
    pin:<br />
      pca9554: xl9555_hub_out_in_2<br />
      number: 7<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
##pull-up resistance on PCB<br />
  - platform: gpio<br />
    name: "f24-W1-io48"<br />
    pin: <br />
      number: 48<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f24-W1-io47"<br />
    pin: <br />
      number: 47<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f24-W1-io21"<br />
    pin: <br />
      number: 21<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f24-W1-io15"<br />
    pin: <br />
      number: 15<br />
      inverted: true<br />
## without resistance on PCB<br />
  - platform: gpio<br />
    name: "f24-W1-io13"<br />
    pin: <br />
      number: 13<br />
      inverted: false<br />
<br />
  - platform: gpio<br />
    name: "f24-W1-io14"<br />
    pin: <br />
      number: 14<br />
      inverted:  false<br />
<br />
  - platform: gpio<br />
    name: "f24-433M"<br />
    pin: <br />
      number: 40<br />
      inverted:  false<br />
<br />
sensor:<br />
  - platform: adc<br />
    pin: 5<br />
    name: "f24 A1 Voltage"<br />
    update_interval: 5s<br />
    attenuation: 11db<br />
    filters:<br />
      - lambda:<br />
          if (x &gt;= 3.11) {<br />
            return x * 1.60256;<br />
          } else if (x &lt;= 0.15) {<br />
            return 0;<br />
          } else {<br />
            return x * 1.51;<br />
          }<br />
  - platform: adc<br />
    pin: 7<br />
    name: "f24 A2 Voltage"<br />
    update_interval: 5s<br />
    attenuation: 11db<br />
    filters:<br />
      # - multiply: 1.51515<br />
      - lambda:<br />
          if (x &gt;= 3.11) {<br />
            return x * 1.60256;<br />
          } else if (x &lt;= 0.15) {<br />
            return 0;<br />
          } else {<br />
            return x * 1.51;<br />
          }<br />
  - platform: adc<br />
    pin: 6<br />
    name: "f24 A3 Current"<br />
    update_interval: 5s<br />
    unit_of_measurement: mA<br />
    attenuation: 11db<br />
    filters:<br />
      - multiply: 6.66666666<br />
  - platform: adc<br />
    pin: 4<br />
    name: "f24 A4 Current"<br />
    update_interval: 5s<br />
    unit_of_measurement: mA<br />
    attenuation: 11db<br />
    filters:<br />
      - multiply: 6.66666666<br />
<br />
web_server:<br />
  port: 80<br />
<br />
font:<br />
  - file: "gfonts://Roboto"<br />
    id: roboto<br />
    size: 20<br />
<br />
display:<br />
  - platform: ssd1306_i2c<br />
    i2c_id: bus_a<br />
    model: "SSD1306 128x64"<br />
    address: 0x3C<br />
    lambda: |-<br />
      it.printf(0, 0, id(roboto), "KinCony F24");</code></div></div> download yaml file: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/txt.png" title="Text Document" border="0" alt=".txt" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=10750" target="_blank" title="">F24-HA-with-Tyua-XL9555.txt</a> (Size: 18.5 KB / Downloads: 82)
<!-- end: postbit_attachments_attachment --><br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=10751" target="_blank" title="">F24-HA-web.png</a> (Size: 180.43 KB / Downloads: 105)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[arduino code examples for F24]-02 Read digital input ports state by XL9555 chip]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=9937</link>
			<pubDate>Fri, 06 Nov 2026 13:35:39 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=9937</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 *<br />
 * Description:<br />
 * This Arduino program reads the state of two 16-channel XL9555SS I/O expanders<br />
 * and prints the state of all input pins (1-24) to the Serial Monitor. The state of <br />
 * each pin is represented as a bit in a 24-bit value, where each bit corresponds <br />
 * to an input pin. The program prints the input state in binary format.<br />
 *<br />
 * Pin Definitions:<br />
 * - SDA: GPIO 8<br />
 * - SCL: GPIO 18<br />
 * - XL9555SS I2C Address: 0x24 for inputs 1-16, 0x26 for inputs 17-24<br />
 */<br />
<br />
#include "Arduino.h"<br />
#include &lt;Wire.h&gt;<br />
#include &lt;PCA95x5.h&gt;<br />
<br />
// Define I2C pins<br />
#define I2C_SDA 8  // Define SDA pin<br />
#define I2C_SCL 18  // Define SCL pin<br />
<br />
constexpr uint8_t INPUT_ADDR_1 = 0x24;<br />
constexpr uint8_t INPUT_ADDR_2 = 0x26;<br />
PCA9555 inputIO1;<br />
PCA9555 inputIO2;<br />
<br />
void setup() {<br />
    Serial.begin(115200);<br />
<br />
    // Initialize I2C communication<br />
    Wire.begin(I2C_SDA, I2C_SCL); // Initialize I2C with defined SDA and SCL pins<br />
<br />
    // Configure both expanders for the input-only test.<br />
    inputIO1.attach(Wire, INPUT_ADDR_1);<br />
    inputIO1.polarity(PCA95x5::Polarity::ORIGINAL_ALL);<br />
    inputIO1.direction(PCA95x5::Direction::IN_ALL);<br />
<br />
    // Read only ports 0-7 on 0x26. Leave the relay ports undriven.<br />
    inputIO2.attach(Wire, INPUT_ADDR_2);<br />
    inputIO2.polarity(PCA95x5::Polarity::ORIGINAL_ALL);<br />
    inputIO2.direction(PCA95x5::Direction::IN_ALL);<br />
<br />
    Serial.println("KinCony F24 24 channel input state 0:ON  1:OFF");<br />
}<br />
<br />
void loop() {<br />
    // DI1-16 occupy bits 0-15; DI17-24 occupy bits 16-23.<br />
    const uint32_t first = inputIO1.read();<br />
    const uint32_t second = inputIO2.read() &amp; 0x00FFU;<br />
    const uint32_t state = first | (second &lt;&lt; 16);<br />
<br />
    // Print the state of all 24 inputs in binary format<br />
    Serial.print("Input state: ");<br />
    Serial.println(state, BIN); // Print the state of inputs in binary<br />
<br />
    delay(500); // Delay 500ms<br />
}</code></div></div> arduino ino file download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=10748" target="_blank" title="">2-digital-input-9555.zip</a> (Size: 1 KB / Downloads: 95)
<!-- end: postbit_attachments_attachment --><br />
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=10749" target="_blank" title="">2-digital-input-9555.ino.merged.zip</a> (Size: 194.2 KB / Downloads: 100)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 *<br />
 * Description:<br />
 * This Arduino program reads the state of two 16-channel XL9555SS I/O expanders<br />
 * and prints the state of all input pins (1-24) to the Serial Monitor. The state of <br />
 * each pin is represented as a bit in a 24-bit value, where each bit corresponds <br />
 * to an input pin. The program prints the input state in binary format.<br />
 *<br />
 * Pin Definitions:<br />
 * - SDA: GPIO 8<br />
 * - SCL: GPIO 18<br />
 * - XL9555SS I2C Address: 0x24 for inputs 1-16, 0x26 for inputs 17-24<br />
 */<br />
<br />
#include "Arduino.h"<br />
#include &lt;Wire.h&gt;<br />
#include &lt;PCA95x5.h&gt;<br />
<br />
// Define I2C pins<br />
#define I2C_SDA 8  // Define SDA pin<br />
#define I2C_SCL 18  // Define SCL pin<br />
<br />
constexpr uint8_t INPUT_ADDR_1 = 0x24;<br />
constexpr uint8_t INPUT_ADDR_2 = 0x26;<br />
PCA9555 inputIO1;<br />
PCA9555 inputIO2;<br />
<br />
void setup() {<br />
    Serial.begin(115200);<br />
<br />
    // Initialize I2C communication<br />
    Wire.begin(I2C_SDA, I2C_SCL); // Initialize I2C with defined SDA and SCL pins<br />
<br />
    // Configure both expanders for the input-only test.<br />
    inputIO1.attach(Wire, INPUT_ADDR_1);<br />
    inputIO1.polarity(PCA95x5::Polarity::ORIGINAL_ALL);<br />
    inputIO1.direction(PCA95x5::Direction::IN_ALL);<br />
<br />
    // Read only ports 0-7 on 0x26. Leave the relay ports undriven.<br />
    inputIO2.attach(Wire, INPUT_ADDR_2);<br />
    inputIO2.polarity(PCA95x5::Polarity::ORIGINAL_ALL);<br />
    inputIO2.direction(PCA95x5::Direction::IN_ALL);<br />
<br />
    Serial.println("KinCony F24 24 channel input state 0:ON  1:OFF");<br />
}<br />
<br />
void loop() {<br />
    // DI1-16 occupy bits 0-15; DI17-24 occupy bits 16-23.<br />
    const uint32_t first = inputIO1.read();<br />
    const uint32_t second = inputIO2.read() &amp; 0x00FFU;<br />
    const uint32_t state = first | (second &lt;&lt; 16);<br />
<br />
    // Print the state of all 24 inputs in binary format<br />
    Serial.print("Input state: ");<br />
    Serial.println(state, BIN); // Print the state of inputs in binary<br />
<br />
    delay(500); // Delay 500ms<br />
}</code></div></div> arduino ino file download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=10748" target="_blank" title="">2-digital-input-9555.zip</a> (Size: 1 KB / Downloads: 95)
<!-- end: postbit_attachments_attachment --><br />
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=10749" target="_blank" title="">2-digital-input-9555.ino.merged.zip</a> (Size: 194.2 KB / Downloads: 100)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[arduino code examples for F24]-01 Turn ON/OFF relay by XL9555 chip]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=9936</link>
			<pubDate>Fri, 06 Nov 2026 13:33:53 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=9936</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 *<br />
 * This program controls a 24-channel relay board via two XL9555SS I/O expanders.<br />
 * It sequentially turns on each relay and then turns them off in a loop.<br />
 * <br />
 * Pin Definitions:<br />
 * - SDA: GPIO 8<br />
 * - SCL: GPIO 18<br />
 * <br />
 * Delay Time:<br />
 * - 200 milliseconds between switching relays<br />
 */<br />
<br />
#include &lt;Wire.h&gt;        // Include the Wire library for I2C communication<br />
#include &lt;PCA95x5.h&gt;   &nbsp;&nbsp;// XL9555SS I/O expander driver<br />
<br />
#define SDA 8            // Define the SDA pin<br />
#define SCL 18         &nbsp;&nbsp;// Define the SCL pin<br />
#define DELAY_TIME 200 &nbsp;&nbsp;// Define the delay time in milliseconds<br />
<br />
// Set I2C addresses of the XL9555SS modules<br />
#define I2C_ADDRESS_R1 0x25 // I2C address of the first XL9555SS module<br />
#define I2C_ADDRESS_R2 0x26 // I2C address of the second XL9555SS module<br />
<br />
PCA9555 relayIO1; // Relays 9-24<br />
PCA9555 relayIO2; // Relays 1-8<br />
<br />
// XL9555SS port indices in physical relay order (1-8).<br />
constexpr uint8_t RELAY_PORTS_1_TO_8[] = {12, 13, 14, 15, 8, 9, 10, 11};<br />
<br />
void setup() {<br />
  // Initialize I2C communication<br />
  Wire.begin(SDA, SCL); // SDA on GPIO 8, SCL on GPIO 18 (according to your board's configuration)<br />
  <br />
  // Initialize serial communication for debugging (optional)<br />
  Serial.begin(115200);<br />
  Serial.println("XL9555SS Relay Control: Starting...");<br />
<br />
  // Preload HIGH before enabling the active-low relay outputs.<br />
  relayIO1.attach(Wire, I2C_ADDRESS_R1);<br />
  relayIO1.write(PCA95x5::Level::H_ALL);<br />
  relayIO1.polarity(PCA95x5::Polarity::ORIGINAL_ALL);<br />
  relayIO1.direction(PCA95x5::Direction::OUT_ALL);<br />
<br />
  relayIO2.attach(Wire, I2C_ADDRESS_R2);<br />
  relayIO2.write(PCA95x5::Level::H_ALL);<br />
  relayIO2.polarity(PCA95x5::Polarity::ORIGINAL_ALL);<br />
  // Ports 0-7 remain inputs, and ports 8-15 drive relays 1-8.<br />
  relayIO2.direction(0x00FF);<br />
}<br />
<br />
void loop() {<br />
  // Sequentially turn on each relay (1-24)<br />
  <br />
  // Control relays 1-8 in physical channel order.<br />
  for (uint8_t port : RELAY_PORTS_1_TO_8) {<br />
    relayIO2.write(static_cast&lt;PCA95x5::Port::Port&gt;(port), PCA95x5::Level::L);<br />
    delay(DELAY_TIME);          // Wait for DELAY_TIME milliseconds<br />
  }<br />
<br />
  // Then control the relays on the first XL9555SS (relays 9-24)<br />
  for (int i = 0; i &lt; 16; i++) {<br />
    relayIO1.write(static_cast&lt;PCA95x5::Port::Port&gt;(i), PCA95x5::Level::L); &nbsp;&nbsp;// Turn on the relay at pin i (LOW means ON for the relay)<br />
    delay(DELAY_TIME);          // Wait for DELAY_TIME milliseconds<br />
  }<br />
<br />
  // Sequentially turn off each relay (1-24)<br />
  <br />
  // Control relays 1-8 in physical channel order.<br />
  for (uint8_t port : RELAY_PORTS_1_TO_8) {<br />
    relayIO2.write(static_cast&lt;PCA95x5::Port::Port&gt;(port), PCA95x5::Level::H);<br />
    delay(DELAY_TIME);          // Wait for DELAY_TIME milliseconds<br />
  }<br />
<br />
  // Then control the relays on the first XL9555SS (relays 9-24)<br />
  for (int i = 0; i &lt; 16; i++) {<br />
    relayIO1.write(static_cast&lt;PCA95x5::Port::Port&gt;(i), PCA95x5::Level::H);  // Turn off the relay at pin i (HIGH means OFF for the relay)<br />
    delay(DELAY_TIME);          // Wait for DELAY_TIME milliseconds<br />
  }<br />
}</code></div></div> arduino ino file download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=10746" target="_blank" title="">1-relay-9555.zip</a> (Size: 1.19 KB / Downloads: 98)
<!-- end: postbit_attachments_attachment --><br />
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=10747" target="_blank" title="">1-relay-9555.ino.merged.zip</a> (Size: 194.02 KB / Downloads: 86)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 *<br />
 * This program controls a 24-channel relay board via two XL9555SS I/O expanders.<br />
 * It sequentially turns on each relay and then turns them off in a loop.<br />
 * <br />
 * Pin Definitions:<br />
 * - SDA: GPIO 8<br />
 * - SCL: GPIO 18<br />
 * <br />
 * Delay Time:<br />
 * - 200 milliseconds between switching relays<br />
 */<br />
<br />
#include &lt;Wire.h&gt;        // Include the Wire library for I2C communication<br />
#include &lt;PCA95x5.h&gt;   &nbsp;&nbsp;// XL9555SS I/O expander driver<br />
<br />
#define SDA 8            // Define the SDA pin<br />
#define SCL 18         &nbsp;&nbsp;// Define the SCL pin<br />
#define DELAY_TIME 200 &nbsp;&nbsp;// Define the delay time in milliseconds<br />
<br />
// Set I2C addresses of the XL9555SS modules<br />
#define I2C_ADDRESS_R1 0x25 // I2C address of the first XL9555SS module<br />
#define I2C_ADDRESS_R2 0x26 // I2C address of the second XL9555SS module<br />
<br />
PCA9555 relayIO1; // Relays 9-24<br />
PCA9555 relayIO2; // Relays 1-8<br />
<br />
// XL9555SS port indices in physical relay order (1-8).<br />
constexpr uint8_t RELAY_PORTS_1_TO_8[] = {12, 13, 14, 15, 8, 9, 10, 11};<br />
<br />
void setup() {<br />
  // Initialize I2C communication<br />
  Wire.begin(SDA, SCL); // SDA on GPIO 8, SCL on GPIO 18 (according to your board's configuration)<br />
  <br />
  // Initialize serial communication for debugging (optional)<br />
  Serial.begin(115200);<br />
  Serial.println("XL9555SS Relay Control: Starting...");<br />
<br />
  // Preload HIGH before enabling the active-low relay outputs.<br />
  relayIO1.attach(Wire, I2C_ADDRESS_R1);<br />
  relayIO1.write(PCA95x5::Level::H_ALL);<br />
  relayIO1.polarity(PCA95x5::Polarity::ORIGINAL_ALL);<br />
  relayIO1.direction(PCA95x5::Direction::OUT_ALL);<br />
<br />
  relayIO2.attach(Wire, I2C_ADDRESS_R2);<br />
  relayIO2.write(PCA95x5::Level::H_ALL);<br />
  relayIO2.polarity(PCA95x5::Polarity::ORIGINAL_ALL);<br />
  // Ports 0-7 remain inputs, and ports 8-15 drive relays 1-8.<br />
  relayIO2.direction(0x00FF);<br />
}<br />
<br />
void loop() {<br />
  // Sequentially turn on each relay (1-24)<br />
  <br />
  // Control relays 1-8 in physical channel order.<br />
  for (uint8_t port : RELAY_PORTS_1_TO_8) {<br />
    relayIO2.write(static_cast&lt;PCA95x5::Port::Port&gt;(port), PCA95x5::Level::L);<br />
    delay(DELAY_TIME);          // Wait for DELAY_TIME milliseconds<br />
  }<br />
<br />
  // Then control the relays on the first XL9555SS (relays 9-24)<br />
  for (int i = 0; i &lt; 16; i++) {<br />
    relayIO1.write(static_cast&lt;PCA95x5::Port::Port&gt;(i), PCA95x5::Level::L); &nbsp;&nbsp;// Turn on the relay at pin i (LOW means ON for the relay)<br />
    delay(DELAY_TIME);          // Wait for DELAY_TIME milliseconds<br />
  }<br />
<br />
  // Sequentially turn off each relay (1-24)<br />
  <br />
  // Control relays 1-8 in physical channel order.<br />
  for (uint8_t port : RELAY_PORTS_1_TO_8) {<br />
    relayIO2.write(static_cast&lt;PCA95x5::Port::Port&gt;(port), PCA95x5::Level::H);<br />
    delay(DELAY_TIME);          // Wait for DELAY_TIME milliseconds<br />
  }<br />
<br />
  // Then control the relays on the first XL9555SS (relays 9-24)<br />
  for (int i = 0; i &lt; 16; i++) {<br />
    relayIO1.write(static_cast&lt;PCA95x5::Port::Port&gt;(i), PCA95x5::Level::H);  // Turn off the relay at pin i (HIGH means OFF for the relay)<br />
    delay(DELAY_TIME);          // Wait for DELAY_TIME milliseconds<br />
  }<br />
}</code></div></div> arduino ino file download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=10746" target="_blank" title="">1-relay-9555.zip</a> (Size: 1.19 KB / Downloads: 98)
<!-- end: postbit_attachments_attachment --><br />
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=10747" target="_blank" title="">1-relay-9555.ino.merged.zip</a> (Size: 194.02 KB / Downloads: 86)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[F24 work with TS RS485 sensor]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=9370</link>
			<pubDate>Fri, 29 May 2026 12:15:08 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=9370</guid>
			<description><![CDATA[Here is sample, KinCony F24 connect with one TS RS485 sensor, you can connect with multi TS sensors.<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="JPG Image" border="0" alt=".jpg" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=9931" target="_blank" title="">F24-TS.jpg</a> (Size: 351.89 KB / Downloads: 340)
<!-- end: postbit_attachments_attachment --><br />
<br />
for example:<br />
<br />
set F24 RS485 protocol = "Modbus-RTU", baud rate= 9600bps. the RS485 address should be different with TS' RS485 address.<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=9932" target="_blank" title="">RS485-setting.png</a> (Size: 55.63 KB / Downloads: 339)
<!-- end: postbit_attachments_attachment --><br />
<br />
TS sensor default address is 1, so set in "SENSOR" webpage:<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=9933" target="_blank" title="">sensor-TS-1.png</a> (Size: 68.45 KB / Downloads: 299)
<!-- end: postbit_attachments_attachment --><br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=9934" target="_blank" title="">sensor-TS-2.png</a> (Size: 28.4 KB / Downloads: 281)
<!-- end: postbit_attachments_attachment --><br />
<br />
Then it will work in monitor webpage:<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=9935" target="_blank" title="">monitor-TS.png</a> (Size: 20.98 KB / Downloads: 281)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[Here is sample, KinCony F24 connect with one TS RS485 sensor, you can connect with multi TS sensors.<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="JPG Image" border="0" alt=".jpg" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=9931" target="_blank" title="">F24-TS.jpg</a> (Size: 351.89 KB / Downloads: 340)
<!-- end: postbit_attachments_attachment --><br />
<br />
for example:<br />
<br />
set F24 RS485 protocol = "Modbus-RTU", baud rate= 9600bps. the RS485 address should be different with TS' RS485 address.<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=9932" target="_blank" title="">RS485-setting.png</a> (Size: 55.63 KB / Downloads: 339)
<!-- end: postbit_attachments_attachment --><br />
<br />
TS sensor default address is 1, so set in "SENSOR" webpage:<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=9933" target="_blank" title="">sensor-TS-1.png</a> (Size: 68.45 KB / Downloads: 299)
<!-- end: postbit_attachments_attachment --><br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=9934" target="_blank" title="">sensor-TS-2.png</a> (Size: 28.4 KB / Downloads: 281)
<!-- end: postbit_attachments_attachment --><br />
<br />
Then it will work in monitor webpage:<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=9935" target="_blank" title="">monitor-TS.png</a> (Size: 20.98 KB / Downloads: 281)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[F24 Smart Controller Wiring Examples]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=9269</link>
			<pubDate>Sun, 19 Apr 2026 15:50:44 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=9269</guid>
			<description><![CDATA[<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="JPG Image" border="0" alt=".jpg" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=9651" target="_blank" title="">F24_wiring.jpg</a> (Size: 216.7 KB / Downloads: 335)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="JPG Image" border="0" alt=".jpg" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=9651" target="_blank" title="">F24_wiring.jpg</a> (Size: 216.7 KB / Downloads: 335)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[F24 Smart Controller ESP32 system block diagram]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=9268</link>
			<pubDate>Sun, 19 Apr 2026 15:50:12 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=9268</guid>
			<description><![CDATA[<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=9650" target="_blank" title="">KinCony-F24-smart-controller-diagram.png</a> (Size: 1.01 MB / Downloads: 380)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=9650" target="_blank" title="">KinCony-F24-smart-controller-diagram.png</a> (Size: 1.01 MB / Downloads: 380)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Can the usb-c port be used to power another device?]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=8792</link>
			<pubDate>Sat, 06 Dec 2025 17:28:42 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=9945">bernieke</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=8792</guid>
			<description><![CDATA[I was thinking of powering a small switch which draws 0.6A at 5V from the usb-c port on a F24, is this possible?]]></description>
			<content:encoded><![CDATA[I was thinking of powering a small switch which draws 0.6A at 5V from the usb-c port on a F24, is this possible?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Recommended way to integrate into home assistant]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=8772</link>
			<pubDate>Wed, 26 Nov 2025 16:25:30 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=9945">bernieke</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=8772</guid>
			<description><![CDATA[Hi,<br />
<br />
Can you tell which is the recommended way to integrate with home assistant OS running on a raspberry pi 5? I'm looking for the most reliable method with a latency of less than 200ms to activate a relay.<br />
* kcs firmware with mqtt over wifi<br />
* esphome firmware with esphome over wifi<br />
* usb (is this supported on home assistant OS?)<br />
* bluetooth (is this supported as a client, and is it supported on home assistant OS?)<br />
* ...?<br />
<br />
Thank you,<br />
Bernard]]></description>
			<content:encoded><![CDATA[Hi,<br />
<br />
Can you tell which is the recommended way to integrate with home assistant OS running on a raspberry pi 5? I'm looking for the most reliable method with a latency of less than 200ms to activate a relay.<br />
* kcs firmware with mqtt over wifi<br />
* esphome firmware with esphome over wifi<br />
* usb (is this supported on home assistant OS?)<br />
* bluetooth (is this supported as a client, and is it supported on home assistant OS?)<br />
* ...?<br />
<br />
Thank you,<br />
Bernard]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[adding HAv2 into Discoverable MQTT for homeassistant]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=8729</link>
			<pubDate>Fri, 07 Nov 2025 18:12:17 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=9459">swisstmack25</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=8729</guid>
			<description><![CDATA[I would like to use the discoverable entity for homeassistant , is it possible that the 485 interface HAv2 can also be adopted this way into home assistant?]]></description>
			<content:encoded><![CDATA[I would like to use the discoverable entity for homeassistant , is it possible that the 485 interface HAv2 can also be adopted this way into home assistant?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[F24 work with HAv2 with tuya app ESPHome yaml by PCF8575 chip]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=8651</link>
			<pubDate>Tue, 14 Oct 2025 08:19:37 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=8651</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>esphome:<br />
  name: f24<br />
  friendly_name: f24<br />
  platformio_options:<br />
    board_build.extra_flags:<br />
      # WIFI_CONTROL_SELF_MODE = 0<br />
      # WIFI_CONTROL_SELF_MODE = 1<br />
      - "-DWIFI_CONTROL_SELF_MODE=1"<br />
esp32:<br />
  board: esp32-s3-devkitc-1<br />
  framework:<br />
    type: arduino<br />
    <br />
<br />
external_components:<br />
  - source:<br />
      type: git<br />
      url: https://github.com/hzkincony/esphome-tuya-wifi-mcu<br />
      ref: v1.3.0<br />
<br />
  - source:<br />
      type: git<br />
      url: https://github.com/hzkincony/esphome-kc868-ha<br />
      ref: v3.0.2<br />
<br />
# Enable logging<br />
<br />
  # hardware_uart: USB_SERIAL_JTAG<br />
# Enable Home Assistant API<br />
api:<br />
  encryption:<br />
    key: "WeVOuL5oNhjXcfzXtTirlOwvtWvCD5yqIxd3oV4es1k="<br />
<br />
ethernet:<br />
  type: W5500<br />
  clk_pin: GPIO42<br />
  mosi_pin: GPIO43<br />
  miso_pin: GPIO44<br />
  cs_pin: GPIO41<br />
  interrupt_pin: GPIO2<br />
  reset_pin: GPIO1<br />
<br />
i2c:<br />
   - id: bus_a<br />
     sda: 8<br />
     scl: 18<br />
     scan: true<br />
     frequency: 400kHz<br />
<br />
pcf8574:<br />
  - id: 'pcf8574_hub_out_1'  # for output channel 9-24<br />
    i2c_id: bus_a<br />
    address: 0x25<br />
    pcf8575: true<br />
<br />
  - id: 'pcf8574_hub_in_1'  # for digital input channel 1-16<br />
    i2c_id: bus_a<br />
    address: 0x24<br />
    pcf8575: true<br />
<br />
  - id: 'pcf8574_hub_out_in_2'  # for output channel 1-8  + (input 17-24)<br />
    i2c_id: bus_a<br />
    address: 0x26<br />
    pcf8575: true<br />
<br />
uart:<br />
  - id: myuart1<br />
    tx_pin: 16<br />
    rx_pin: 17<br />
    baud_rate: 9600<br />
    debug:<br />
      direction: BOTH<br />
      dummy_receiver: false<br />
<br />
  - id: tuya_mcu_uart<br />
    tx_pin: GPIO39<br />
    rx_pin: GPIO38<br />
    baud_rate: 9600<br />
<br />
tuya_wifi_mcu:<br />
  # tuya mcu product id<br />
  product_id: cchos3g1j2ucfbyd<br />
  uart_id: tuya_mcu_uart<br />
  wifi_reset_pin: 28<br />
  wifi_led_pin: 16<br />
<br />
kc868_ha:<br />
  uart_id: myuart1<br />
<br />
switch:<br />
<br />
  - platform: gpio<br />
    name: "f24-output01"<br />
    id: "f24_output01"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 12<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output1-tuya<br />
    dp_id: 1<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output01"<br />
<br />
  - platform: gpio<br />
    name: "f24-output02"<br />
    id: "f24_output02"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 13<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output2-tuya<br />
    dp_id: 2<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output02"<br />
<br />
  - platform: gpio<br />
    name: "f24-output03"<br />
    id: "f24_output03"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 14<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output3-tuya<br />
    dp_id: 3<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output03"<br />
<br />
  - platform: gpio<br />
    name: "f24-output04"<br />
    id: "f24_output04"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 15<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output4-tuya<br />
    dp_id: 4<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output04"<br />
<br />
  - platform: gpio<br />
    name: "f24-output05"<br />
    id: "f24_output05"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 8<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output5-tuya<br />
    dp_id: 5<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output05"<br />
<br />
  - platform: gpio<br />
    name: "f24-output06"<br />
    id: "f24_output06"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 9<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output6-tuya<br />
    dp_id: 6<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output06"<br />
<br />
  - platform: gpio<br />
    name: "f24-output07"<br />
    id: "f24_output07"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 10<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output7-tuya<br />
    dp_id: 101<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output07"<br />
<br />
  - platform: gpio<br />
    name: "f24-output08"<br />
    id: "f24_output08"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 11<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output8-tuya<br />
    dp_id: 102<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output08"<br />
<br />
  - platform: gpio<br />
    name: "f24-output09"<br />
    id: "f24_output09"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 0<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output9-tuya<br />
    dp_id: 103<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output09"<br />
<br />
  - platform: gpio<br />
    name: "f24-output10"<br />
    id: "f24_output10"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 1<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output10-tuya<br />
    dp_id: 104<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output10"<br />
<br />
  - platform: gpio<br />
    name: "f24-output11"<br />
    id: "f24_output11"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 2<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output11-tuya<br />
    dp_id: 105<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output11"<br />
<br />
  - platform: gpio<br />
    name: "f24-output12"<br />
    id: "f24_output12"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 3<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output12-tuya<br />
    dp_id: 106<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output12"<br />
<br />
  - platform: gpio<br />
    name: "f24-output13"<br />
    id: "f24_output13"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 4<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output13-tuya<br />
    dp_id: 107<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output13"<br />
<br />
  - platform: gpio<br />
    name: "f24-output14"<br />
    id: "f24_output14"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 5<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output14-tuya<br />
    dp_id: 108<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output14"<br />
<br />
  - platform: gpio<br />
    name: "f24-output15"<br />
    id: "f24_output15"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 6<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output15-tuya<br />
    dp_id: 109<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output15"<br />
<br />
  - platform: gpio<br />
    name: "f24-output16"<br />
    id: "f24_output16"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 7<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output16-tuya<br />
    dp_id: 110<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output16"<br />
<br />
  - platform: gpio<br />
    name: "f24-output17"<br />
    id: "f24_output17"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 8<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output17-tuya<br />
    dp_id: 126<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output17"<br />
<br />
  - platform: gpio<br />
    name: "f24-output18"<br />
    id: "f24_output18"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 9<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output18-tuya<br />
    dp_id: 129<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output18"<br />
<br />
  - platform: gpio<br />
    name: "f24-output19"<br />
    id: "f24_output19"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 10<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output19-tuya<br />
    dp_id: 130<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output19"<br />
<br />
  - platform: gpio<br />
    name: "f24-output20"<br />
    id: "f24_output20"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 11<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output20-tuya<br />
    dp_id: 131<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output20"<br />
<br />
  - platform: gpio<br />
    name: "f24-output21"<br />
    id: "f24_output21"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 12<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output21-tuya<br />
    dp_id: 132<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output21"<br />
<br />
  - platform: gpio<br />
    name: "f24-output22"<br />
    id: "f24_output22"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 13<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output22-tuya<br />
    dp_id: 133<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output22"<br />
<br />
  - platform: gpio<br />
    name: "f24-output23"<br />
    id: "f24_output23"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 14<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output23-tuya<br />
    dp_id: 134<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output23"<br />
<br />
  - platform: gpio<br />
    name: "f24-output24"<br />
    id: "f24_output24"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 15<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output24-tuya<br />
    dp_id: 135<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output24"<br />
<br />
  # The switch is used to control the D1~D6 level output on the KC868 HA board<br />
  # bind_output is required. Corresponds to the BindOutput parameter in HA485_Ctrl software<br />
  # Other parameters refer to: https://esphome.io/components/switch/index.html<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 1<br />
    name: "switch 1"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 2<br />
    name: "switch 2"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 3<br />
    name: "switch 3"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 4<br />
    name: "switch 4"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 5<br />
    name: "switch 5"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 6<br />
    name: "switch 6"<br />
<br />
<br />
<br />
binary_sensor:<br />
  - platform: gpio<br />
    name: "f24-input01"<br />
    id: "f24_input01"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 0<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input1-tuya<br />
    dp_id: 111<br />
    bind_binary_sensor_id: f24_input01<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input02"<br />
    id: "f24_input02"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 1<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input2-tuya<br />
    dp_id: 112<br />
    bind_binary_sensor_id: f24_input02<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input03"<br />
    id: "f24_input03"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 2<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input3-tuya<br />
    dp_id: 113<br />
    bind_binary_sensor_id: f24_input03<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input04"<br />
    id: "f24_input04"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 3<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input4-tuya<br />
    dp_id: 114<br />
    bind_binary_sensor_id: f24_input04<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input05"<br />
    id: "f24_input05"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 4<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input5-tuya<br />
    dp_id: 115<br />
    bind_binary_sensor_id: f24_input05<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input06"<br />
    id: "f24_input06"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 5<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input6-tuya<br />
    dp_id: 116<br />
    bind_binary_sensor_id: f24_input06<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input07"<br />
    id: "f24_input07"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 6<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input7-tuya<br />
    dp_id: 117<br />
    bind_binary_sensor_id: f24_input07<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input08"<br />
    id: "f24_input08"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 7<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input8-tuya<br />
    dp_id: 118<br />
    bind_binary_sensor_id: f24_input08<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input09"<br />
    id: "f24_input09"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 8<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input9-tuya<br />
    dp_id: 119<br />
    bind_binary_sensor_id: f24_input09<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input10"<br />
    id: "f24_input10"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 9<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input10-tuya<br />
    dp_id: 120<br />
    bind_binary_sensor_id: f24_input10<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input11"<br />
    id: "f24_input11"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 10<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input11-tuya<br />
    dp_id: 121<br />
    bind_binary_sensor_id: f24_input11<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input12"<br />
    id: "f24_input12"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 11<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input12-tuya<br />
    dp_id: 122<br />
    bind_binary_sensor_id: f24_input12<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input13"<br />
    id: "f24_input13"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 12<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input13-tuya<br />
    dp_id: 123<br />
    bind_binary_sensor_id: f24_input13<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input14"<br />
    id: "f24_input14"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 13<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input14-tuya<br />
    dp_id: 124<br />
    bind_binary_sensor_id: f24_input14<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input15"<br />
    id: "f24_input15"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 14<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input15-tuya<br />
    dp_id: 125<br />
    bind_binary_sensor_id: f24_input15<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input16"<br />
    id: "f24_input16"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 15<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input17"<br />
    id: "f24_input17"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 0<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input18"<br />
    id: "f24_input18"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 1<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input19"<br />
    id: "f24_input19"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 2<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input20"<br />
    id: "f24_input20"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 3<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input21"<br />
    id: "f24_input21"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 4<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input22"<br />
    id: "f24_input22"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 5<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input23"<br />
    id: "f24_input23"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 6<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input24"<br />
    id: "f24_input24"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 7<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
##pull-up resistance on PCB<br />
  - platform: gpio<br />
    name: "f24-W1-io48"<br />
    pin: <br />
      number: 48<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f24-W1-io47"<br />
    pin: <br />
      number: 47<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f24-W1-io21"<br />
    pin: <br />
      number: 21<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f24-W1-io15"<br />
    pin: <br />
      number: 15<br />
      inverted: true<br />
## without resistance on PCB<br />
  - platform: gpio<br />
    name: "f24-W1-io13"<br />
    pin: <br />
      number: 13<br />
      inverted: false<br />
<br />
  - platform: gpio<br />
    name: "f24-W1-io14"<br />
    pin: <br />
      number: 14<br />
      inverted:  false<br />
<br />
  - platform: gpio<br />
    name: "f24-433M"<br />
    pin: <br />
      number: 40<br />
      inverted:  false<br />
<br />
  # The binary_sensor corresponds to the state changes generated by K1~K6 on the KC868 HA board<br />
  # bind_output is required. Corresponds to the BindOutput parameter in HA485_Ctrl software<br />
  # Other parameters refer to: https://esphome.io/components/binary_sensor/index.html<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1 # Default value is 1, corresponds to the Target Relay Controller Addr parameter in HA485_Ctrl software<br />
    switch_adapter_addr: 10 # Default value is 10, corresponds to the Switch Adapter Addr parameter in HA485_Ctrl software<br />
    bind_output: 1 # Corresponds to the BindOutput parameter in HA485_Ctrl software<br />
    name: "binary_sensor 1"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 2<br />
    name: "binary_sensor 2"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 3<br />
    name: "binary_sensor 3"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 4<br />
    name: "binary_sensor 4"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 5<br />
    name: "binary_sensor 5"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 6<br />
    name: "binary_sensor 6"<br />
<br />
sensor:<br />
  - platform: adc<br />
    pin: 5<br />
    name: "f24 A1 Voltage"<br />
    update_interval: 5s<br />
    attenuation: 11db<br />
    filters:<br />
      - lambda:<br />
          if (x &gt;= 3.11) {<br />
            return x * 1.60256;<br />
          } else if (x &lt;= 0.15) {<br />
            return 0;<br />
          } else {<br />
            return x * 1.51;<br />
          }<br />
  - platform: adc<br />
    pin: 7<br />
    name: "f24 A2 Voltage"<br />
    update_interval: 5s<br />
    attenuation: 11db<br />
    filters:<br />
      # - multiply: 1.51515<br />
      - lambda:<br />
          if (x &gt;= 3.11) {<br />
            return x * 1.60256;<br />
          } else if (x &lt;= 0.15) {<br />
            return 0;<br />
          } else {<br />
            return x * 1.51;<br />
          }<br />
  - platform: adc<br />
    pin: 6<br />
    name: "f24 A3 Current"<br />
    update_interval: 5s<br />
    unit_of_measurement: mA<br />
    attenuation: 11db<br />
    filters:<br />
      - multiply: 6.66666666<br />
  - platform: adc<br />
    pin: 4<br />
    name: "f24 A4 Current"<br />
    update_interval: 5s<br />
    unit_of_measurement: mA<br />
    attenuation: 11db<br />
    filters:<br />
      - multiply: 6.66666666<br />
<br />
web_server:<br />
  port: 80<br />
<br />
font:<br />
  - file: "gfonts://Roboto"<br />
    id: roboto<br />
    size: 20<br />
<br />
display:<br />
  - platform: ssd1306_i2c<br />
    i2c_id: bus_a<br />
    model: "SSD1306 128x64"<br />
    address: 0x3C<br />
    lambda: |-<br />
      it.printf(0, 0, id(roboto), "KinCony F24");</code></div></div>esphome yaml download:<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/txt.png" title="Text Document" border="0" alt=".txt" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8479" target="_blank" title="">HAv2-F24-Tuya.txt</a> (Size: 20.91 KB / Downloads: 398)
<!-- end: postbit_attachments_attachment --><br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="JPG Image" border="0" alt=".jpg" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8480" target="_blank" title="">F24-HAv2-PCB.jpg</a> (Size: 265.61 KB / Downloads: 644)
<!-- end: postbit_attachments_attachment --><br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8481" target="_blank" title="">HAv2-PC-setting.png</a> (Size: 99.73 KB / Downloads: 519)
<!-- end: postbit_attachments_attachment --><br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8482" target="_blank" title="">home-assistant.png</a> (Size: 165.75 KB / Downloads: 617)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>esphome:<br />
  name: f24<br />
  friendly_name: f24<br />
  platformio_options:<br />
    board_build.extra_flags:<br />
      # WIFI_CONTROL_SELF_MODE = 0<br />
      # WIFI_CONTROL_SELF_MODE = 1<br />
      - "-DWIFI_CONTROL_SELF_MODE=1"<br />
esp32:<br />
  board: esp32-s3-devkitc-1<br />
  framework:<br />
    type: arduino<br />
    <br />
<br />
external_components:<br />
  - source:<br />
      type: git<br />
      url: https://github.com/hzkincony/esphome-tuya-wifi-mcu<br />
      ref: v1.3.0<br />
<br />
  - source:<br />
      type: git<br />
      url: https://github.com/hzkincony/esphome-kc868-ha<br />
      ref: v3.0.2<br />
<br />
# Enable logging<br />
<br />
  # hardware_uart: USB_SERIAL_JTAG<br />
# Enable Home Assistant API<br />
api:<br />
  encryption:<br />
    key: "WeVOuL5oNhjXcfzXtTirlOwvtWvCD5yqIxd3oV4es1k="<br />
<br />
ethernet:<br />
  type: W5500<br />
  clk_pin: GPIO42<br />
  mosi_pin: GPIO43<br />
  miso_pin: GPIO44<br />
  cs_pin: GPIO41<br />
  interrupt_pin: GPIO2<br />
  reset_pin: GPIO1<br />
<br />
i2c:<br />
   - id: bus_a<br />
     sda: 8<br />
     scl: 18<br />
     scan: true<br />
     frequency: 400kHz<br />
<br />
pcf8574:<br />
  - id: 'pcf8574_hub_out_1'  # for output channel 9-24<br />
    i2c_id: bus_a<br />
    address: 0x25<br />
    pcf8575: true<br />
<br />
  - id: 'pcf8574_hub_in_1'  # for digital input channel 1-16<br />
    i2c_id: bus_a<br />
    address: 0x24<br />
    pcf8575: true<br />
<br />
  - id: 'pcf8574_hub_out_in_2'  # for output channel 1-8  + (input 17-24)<br />
    i2c_id: bus_a<br />
    address: 0x26<br />
    pcf8575: true<br />
<br />
uart:<br />
  - id: myuart1<br />
    tx_pin: 16<br />
    rx_pin: 17<br />
    baud_rate: 9600<br />
    debug:<br />
      direction: BOTH<br />
      dummy_receiver: false<br />
<br />
  - id: tuya_mcu_uart<br />
    tx_pin: GPIO39<br />
    rx_pin: GPIO38<br />
    baud_rate: 9600<br />
<br />
tuya_wifi_mcu:<br />
  # tuya mcu product id<br />
  product_id: cchos3g1j2ucfbyd<br />
  uart_id: tuya_mcu_uart<br />
  wifi_reset_pin: 28<br />
  wifi_led_pin: 16<br />
<br />
kc868_ha:<br />
  uart_id: myuart1<br />
<br />
switch:<br />
<br />
  - platform: gpio<br />
    name: "f24-output01"<br />
    id: "f24_output01"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 12<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output1-tuya<br />
    dp_id: 1<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output01"<br />
<br />
  - platform: gpio<br />
    name: "f24-output02"<br />
    id: "f24_output02"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 13<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output2-tuya<br />
    dp_id: 2<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output02"<br />
<br />
  - platform: gpio<br />
    name: "f24-output03"<br />
    id: "f24_output03"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 14<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output3-tuya<br />
    dp_id: 3<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output03"<br />
<br />
  - platform: gpio<br />
    name: "f24-output04"<br />
    id: "f24_output04"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 15<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output4-tuya<br />
    dp_id: 4<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output04"<br />
<br />
  - platform: gpio<br />
    name: "f24-output05"<br />
    id: "f24_output05"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 8<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output5-tuya<br />
    dp_id: 5<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output05"<br />
<br />
  - platform: gpio<br />
    name: "f24-output06"<br />
    id: "f24_output06"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 9<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output6-tuya<br />
    dp_id: 6<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output06"<br />
<br />
  - platform: gpio<br />
    name: "f24-output07"<br />
    id: "f24_output07"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 10<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output7-tuya<br />
    dp_id: 101<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output07"<br />
<br />
  - platform: gpio<br />
    name: "f24-output08"<br />
    id: "f24_output08"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 11<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output8-tuya<br />
    dp_id: 102<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output08"<br />
<br />
  - platform: gpio<br />
    name: "f24-output09"<br />
    id: "f24_output09"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 0<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output9-tuya<br />
    dp_id: 103<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output09"<br />
<br />
  - platform: gpio<br />
    name: "f24-output10"<br />
    id: "f24_output10"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 1<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output10-tuya<br />
    dp_id: 104<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output10"<br />
<br />
  - platform: gpio<br />
    name: "f24-output11"<br />
    id: "f24_output11"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 2<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output11-tuya<br />
    dp_id: 105<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output11"<br />
<br />
  - platform: gpio<br />
    name: "f24-output12"<br />
    id: "f24_output12"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 3<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output12-tuya<br />
    dp_id: 106<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output12"<br />
<br />
  - platform: gpio<br />
    name: "f24-output13"<br />
    id: "f24_output13"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 4<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output13-tuya<br />
    dp_id: 107<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output13"<br />
<br />
  - platform: gpio<br />
    name: "f24-output14"<br />
    id: "f24_output14"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 5<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output14-tuya<br />
    dp_id: 108<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output14"<br />
<br />
  - platform: gpio<br />
    name: "f24-output15"<br />
    id: "f24_output15"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 6<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output15-tuya<br />
    dp_id: 109<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output15"<br />
<br />
  - platform: gpio<br />
    name: "f24-output16"<br />
    id: "f24_output16"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 7<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output16-tuya<br />
    dp_id: 110<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output16"<br />
<br />
  - platform: gpio<br />
    name: "f24-output17"<br />
    id: "f24_output17"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 8<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output17-tuya<br />
    dp_id: 126<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output17"<br />
<br />
  - platform: gpio<br />
    name: "f24-output18"<br />
    id: "f24_output18"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 9<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output18-tuya<br />
    dp_id: 129<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output18"<br />
<br />
  - platform: gpio<br />
    name: "f24-output19"<br />
    id: "f24_output19"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 10<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output19-tuya<br />
    dp_id: 130<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output19"<br />
<br />
  - platform: gpio<br />
    name: "f24-output20"<br />
    id: "f24_output20"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 11<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output20-tuya<br />
    dp_id: 131<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output20"<br />
<br />
  - platform: gpio<br />
    name: "f24-output21"<br />
    id: "f24_output21"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 12<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output21-tuya<br />
    dp_id: 132<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output21"<br />
<br />
  - platform: gpio<br />
    name: "f24-output22"<br />
    id: "f24_output22"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 13<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output22-tuya<br />
    dp_id: 133<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output22"<br />
<br />
  - platform: gpio<br />
    name: "f24-output23"<br />
    id: "f24_output23"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 14<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output23-tuya<br />
    dp_id: 134<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output23"<br />
<br />
  - platform: gpio<br />
    name: "f24-output24"<br />
    id: "f24_output24"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 15<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output24-tuya<br />
    dp_id: 135<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output24"<br />
<br />
  # The switch is used to control the D1~D6 level output on the KC868 HA board<br />
  # bind_output is required. Corresponds to the BindOutput parameter in HA485_Ctrl software<br />
  # Other parameters refer to: https://esphome.io/components/switch/index.html<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 1<br />
    name: "switch 1"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 2<br />
    name: "switch 2"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 3<br />
    name: "switch 3"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 4<br />
    name: "switch 4"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 5<br />
    name: "switch 5"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 6<br />
    name: "switch 6"<br />
<br />
<br />
<br />
binary_sensor:<br />
  - platform: gpio<br />
    name: "f24-input01"<br />
    id: "f24_input01"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 0<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input1-tuya<br />
    dp_id: 111<br />
    bind_binary_sensor_id: f24_input01<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input02"<br />
    id: "f24_input02"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 1<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input2-tuya<br />
    dp_id: 112<br />
    bind_binary_sensor_id: f24_input02<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input03"<br />
    id: "f24_input03"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 2<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input3-tuya<br />
    dp_id: 113<br />
    bind_binary_sensor_id: f24_input03<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input04"<br />
    id: "f24_input04"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 3<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input4-tuya<br />
    dp_id: 114<br />
    bind_binary_sensor_id: f24_input04<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input05"<br />
    id: "f24_input05"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 4<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input5-tuya<br />
    dp_id: 115<br />
    bind_binary_sensor_id: f24_input05<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input06"<br />
    id: "f24_input06"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 5<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input6-tuya<br />
    dp_id: 116<br />
    bind_binary_sensor_id: f24_input06<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input07"<br />
    id: "f24_input07"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 6<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input7-tuya<br />
    dp_id: 117<br />
    bind_binary_sensor_id: f24_input07<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input08"<br />
    id: "f24_input08"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 7<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input8-tuya<br />
    dp_id: 118<br />
    bind_binary_sensor_id: f24_input08<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input09"<br />
    id: "f24_input09"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 8<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input9-tuya<br />
    dp_id: 119<br />
    bind_binary_sensor_id: f24_input09<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input10"<br />
    id: "f24_input10"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 9<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input10-tuya<br />
    dp_id: 120<br />
    bind_binary_sensor_id: f24_input10<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input11"<br />
    id: "f24_input11"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 10<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input11-tuya<br />
    dp_id: 121<br />
    bind_binary_sensor_id: f24_input11<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input12"<br />
    id: "f24_input12"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 11<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input12-tuya<br />
    dp_id: 122<br />
    bind_binary_sensor_id: f24_input12<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input13"<br />
    id: "f24_input13"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 12<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input13-tuya<br />
    dp_id: 123<br />
    bind_binary_sensor_id: f24_input13<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input14"<br />
    id: "f24_input14"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 13<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input14-tuya<br />
    dp_id: 124<br />
    bind_binary_sensor_id: f24_input14<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input15"<br />
    id: "f24_input15"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 14<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input15-tuya<br />
    dp_id: 125<br />
    bind_binary_sensor_id: f24_input15<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input16"<br />
    id: "f24_input16"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 15<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input17"<br />
    id: "f24_input17"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 0<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input18"<br />
    id: "f24_input18"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 1<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input19"<br />
    id: "f24_input19"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 2<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input20"<br />
    id: "f24_input20"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 3<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input21"<br />
    id: "f24_input21"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 4<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input22"<br />
    id: "f24_input22"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 5<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input23"<br />
    id: "f24_input23"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 6<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input24"<br />
    id: "f24_input24"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 7<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
##pull-up resistance on PCB<br />
  - platform: gpio<br />
    name: "f24-W1-io48"<br />
    pin: <br />
      number: 48<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f24-W1-io47"<br />
    pin: <br />
      number: 47<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f24-W1-io21"<br />
    pin: <br />
      number: 21<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f24-W1-io15"<br />
    pin: <br />
      number: 15<br />
      inverted: true<br />
## without resistance on PCB<br />
  - platform: gpio<br />
    name: "f24-W1-io13"<br />
    pin: <br />
      number: 13<br />
      inverted: false<br />
<br />
  - platform: gpio<br />
    name: "f24-W1-io14"<br />
    pin: <br />
      number: 14<br />
      inverted:  false<br />
<br />
  - platform: gpio<br />
    name: "f24-433M"<br />
    pin: <br />
      number: 40<br />
      inverted:  false<br />
<br />
  # The binary_sensor corresponds to the state changes generated by K1~K6 on the KC868 HA board<br />
  # bind_output is required. Corresponds to the BindOutput parameter in HA485_Ctrl software<br />
  # Other parameters refer to: https://esphome.io/components/binary_sensor/index.html<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1 # Default value is 1, corresponds to the Target Relay Controller Addr parameter in HA485_Ctrl software<br />
    switch_adapter_addr: 10 # Default value is 10, corresponds to the Switch Adapter Addr parameter in HA485_Ctrl software<br />
    bind_output: 1 # Corresponds to the BindOutput parameter in HA485_Ctrl software<br />
    name: "binary_sensor 1"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 2<br />
    name: "binary_sensor 2"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 3<br />
    name: "binary_sensor 3"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 4<br />
    name: "binary_sensor 4"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 5<br />
    name: "binary_sensor 5"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 6<br />
    name: "binary_sensor 6"<br />
<br />
sensor:<br />
  - platform: adc<br />
    pin: 5<br />
    name: "f24 A1 Voltage"<br />
    update_interval: 5s<br />
    attenuation: 11db<br />
    filters:<br />
      - lambda:<br />
          if (x &gt;= 3.11) {<br />
            return x * 1.60256;<br />
          } else if (x &lt;= 0.15) {<br />
            return 0;<br />
          } else {<br />
            return x * 1.51;<br />
          }<br />
  - platform: adc<br />
    pin: 7<br />
    name: "f24 A2 Voltage"<br />
    update_interval: 5s<br />
    attenuation: 11db<br />
    filters:<br />
      # - multiply: 1.51515<br />
      - lambda:<br />
          if (x &gt;= 3.11) {<br />
            return x * 1.60256;<br />
          } else if (x &lt;= 0.15) {<br />
            return 0;<br />
          } else {<br />
            return x * 1.51;<br />
          }<br />
  - platform: adc<br />
    pin: 6<br />
    name: "f24 A3 Current"<br />
    update_interval: 5s<br />
    unit_of_measurement: mA<br />
    attenuation: 11db<br />
    filters:<br />
      - multiply: 6.66666666<br />
  - platform: adc<br />
    pin: 4<br />
    name: "f24 A4 Current"<br />
    update_interval: 5s<br />
    unit_of_measurement: mA<br />
    attenuation: 11db<br />
    filters:<br />
      - multiply: 6.66666666<br />
<br />
web_server:<br />
  port: 80<br />
<br />
font:<br />
  - file: "gfonts://Roboto"<br />
    id: roboto<br />
    size: 20<br />
<br />
display:<br />
  - platform: ssd1306_i2c<br />
    i2c_id: bus_a<br />
    model: "SSD1306 128x64"<br />
    address: 0x3C<br />
    lambda: |-<br />
      it.printf(0, 0, id(roboto), "KinCony F24");</code></div></div>esphome yaml download:<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/txt.png" title="Text Document" border="0" alt=".txt" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8479" target="_blank" title="">HAv2-F24-Tuya.txt</a> (Size: 20.91 KB / Downloads: 398)
<!-- end: postbit_attachments_attachment --><br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="JPG Image" border="0" alt=".jpg" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8480" target="_blank" title="">F24-HAv2-PCB.jpg</a> (Size: 265.61 KB / Downloads: 644)
<!-- end: postbit_attachments_attachment --><br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8481" target="_blank" title="">HAv2-PC-setting.png</a> (Size: 99.73 KB / Downloads: 519)
<!-- end: postbit_attachments_attachment --><br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8482" target="_blank" title="">home-assistant.png</a> (Size: 165.75 KB / Downloads: 617)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[F24 work with HAv2 without tuya app ESPHome yaml by PCF8575 chip]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=8650</link>
			<pubDate>Tue, 14 Oct 2025 08:18:12 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=8650</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>esphome:<br />
  name: hav2<br />
  friendly_name: HAv2<br />
<br />
esp32:<br />
  board: esp32-s3-devkitc-1<br />
  framework:<br />
    type: esp-idf<br />
<br />
# Enable logging<br />
logger:<br />
  baud_rate: 0<br />
<br />
# Enable Home Assistant API<br />
api:<br />
<br />
<br />
ethernet:<br />
  type: W5500<br />
  clk_pin: GPIO42<br />
  mosi_pin: GPIO43<br />
  miso_pin: GPIO44<br />
  cs_pin: GPIO41<br />
  interrupt_pin: GPIO2<br />
  reset_pin: GPIO1<br />
<br />
external_components:<br />
  - source:<br />
      type: git<br />
      url: https://github.com/hzkincony/esphome-kc868-ha<br />
      ref: v3.0.1<br />
<br />
uart:<br />
  - id: myuart1<br />
    tx_pin: 16<br />
    rx_pin: 17<br />
    baud_rate: 9600<br />
    debug:<br />
      direction: BOTH<br />
      dummy_receiver: false<br />
<br />
kc868_ha:<br />
<br />
binary_sensor:<br />
<br />
  # The binary_sensor corresponds to the state changes generated by K1~K6 on the KC868 HA board<br />
  # bind_output is required. Corresponds to the BindOutput parameter in HA485_Ctrl software<br />
  # Other parameters refer to: https://esphome.io/components/binary_sensor/index.html<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1 # Default value is 1, corresponds to the Target Relay Controller Addr parameter in HA485_Ctrl software<br />
    switch_adapter_addr: 10 # Default value is 10, corresponds to the Switch Adapter Addr parameter in HA485_Ctrl software<br />
    bind_output: 1 # Corresponds to the BindOutput parameter in HA485_Ctrl software<br />
    name: "binary_sensor 1"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 2<br />
    name: "binary_sensor 2"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 3<br />
    name: "binary_sensor 3"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 4<br />
    name: "binary_sensor 4"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 5<br />
    name: "binary_sensor 5"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 6<br />
    name: "binary_sensor 6"<br />
<br />
switch:<br />
  # The switch is used to control the D1~D6 level output on the KC868 HA board<br />
  # bind_output is required. Corresponds to the BindOutput parameter in HA485_Ctrl software<br />
  # Other parameters refer to: https://esphome.io/components/switch/index.html<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 1<br />
    name: "switch 1"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 2<br />
    name: "switch 2"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 3<br />
    name: "switch 3"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 4<br />
    name: "switch 4"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 5<br />
    name: "switch 5"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 6<br />
    name: "switch 6"<br />
<br />
web_server:<br />
  port: 80</code></div></div>esphome yaml file download:<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/txt.png" title="Text Document" border="0" alt=".txt" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8475" target="_blank" title="">HAv2-F24-yaml.txt</a> (Size: 3.04 KB / Downloads: 351)
<!-- end: postbit_attachments_attachment --><br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="JPG Image" border="0" alt=".jpg" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8476" target="_blank" title="">F24-HAv2-PCB.jpg</a> (Size: 265.61 KB / Downloads: 656)
<!-- end: postbit_attachments_attachment --><br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8477" target="_blank" title="">HAv2-PC-setting.png</a> (Size: 99.73 KB / Downloads: 732)
<!-- end: postbit_attachments_attachment --><br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8478" target="_blank" title="">home-assistant.png</a> (Size: 165.75 KB / Downloads: 650)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>esphome:<br />
  name: hav2<br />
  friendly_name: HAv2<br />
<br />
esp32:<br />
  board: esp32-s3-devkitc-1<br />
  framework:<br />
    type: esp-idf<br />
<br />
# Enable logging<br />
logger:<br />
  baud_rate: 0<br />
<br />
# Enable Home Assistant API<br />
api:<br />
<br />
<br />
ethernet:<br />
  type: W5500<br />
  clk_pin: GPIO42<br />
  mosi_pin: GPIO43<br />
  miso_pin: GPIO44<br />
  cs_pin: GPIO41<br />
  interrupt_pin: GPIO2<br />
  reset_pin: GPIO1<br />
<br />
external_components:<br />
  - source:<br />
      type: git<br />
      url: https://github.com/hzkincony/esphome-kc868-ha<br />
      ref: v3.0.1<br />
<br />
uart:<br />
  - id: myuart1<br />
    tx_pin: 16<br />
    rx_pin: 17<br />
    baud_rate: 9600<br />
    debug:<br />
      direction: BOTH<br />
      dummy_receiver: false<br />
<br />
kc868_ha:<br />
<br />
binary_sensor:<br />
<br />
  # The binary_sensor corresponds to the state changes generated by K1~K6 on the KC868 HA board<br />
  # bind_output is required. Corresponds to the BindOutput parameter in HA485_Ctrl software<br />
  # Other parameters refer to: https://esphome.io/components/binary_sensor/index.html<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1 # Default value is 1, corresponds to the Target Relay Controller Addr parameter in HA485_Ctrl software<br />
    switch_adapter_addr: 10 # Default value is 10, corresponds to the Switch Adapter Addr parameter in HA485_Ctrl software<br />
    bind_output: 1 # Corresponds to the BindOutput parameter in HA485_Ctrl software<br />
    name: "binary_sensor 1"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 2<br />
    name: "binary_sensor 2"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 3<br />
    name: "binary_sensor 3"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 4<br />
    name: "binary_sensor 4"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 5<br />
    name: "binary_sensor 5"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 6<br />
    name: "binary_sensor 6"<br />
<br />
switch:<br />
  # The switch is used to control the D1~D6 level output on the KC868 HA board<br />
  # bind_output is required. Corresponds to the BindOutput parameter in HA485_Ctrl software<br />
  # Other parameters refer to: https://esphome.io/components/switch/index.html<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 1<br />
    name: "switch 1"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 2<br />
    name: "switch 2"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 3<br />
    name: "switch 3"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 4<br />
    name: "switch 4"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 5<br />
    name: "switch 5"<br />
  - platform: kc868_ha<br />
    target_relay_controller_addr: 1<br />
    switch_adapter_addr: 10<br />
    bind_output: 6<br />
    name: "switch 6"<br />
<br />
web_server:<br />
  port: 80</code></div></div>esphome yaml file download:<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/txt.png" title="Text Document" border="0" alt=".txt" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8475" target="_blank" title="">HAv2-F24-yaml.txt</a> (Size: 3.04 KB / Downloads: 351)
<!-- end: postbit_attachments_attachment --><br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="JPG Image" border="0" alt=".jpg" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8476" target="_blank" title="">F24-HAv2-PCB.jpg</a> (Size: 265.61 KB / Downloads: 656)
<!-- end: postbit_attachments_attachment --><br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8477" target="_blank" title="">HAv2-PC-setting.png</a> (Size: 99.73 KB / Downloads: 732)
<!-- end: postbit_attachments_attachment --><br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8478" target="_blank" title="">home-assistant.png</a> (Size: 165.75 KB / Downloads: 650)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[F24 PCB button define]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=8477</link>
			<pubDate>Sun, 31 Aug 2025 08:37:17 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=8477</guid>
			<description><![CDATA[F24 buttons on PCB:<br />
  RST: RESET of ESP32<br />
  DL: ESP32 download button<br />
  CFG: tuya config]]></description>
			<content:encoded><![CDATA[F24 buttons on PCB:<br />
  RST: RESET of ESP32<br />
  DL: ESP32 download button<br />
  CFG: tuya config]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[F24 and KC868-AP dimmer sharing same wall switch panel]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=8454</link>
			<pubDate>Mon, 18 Aug 2025 15:13:37 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=3298">stansvec</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=8454</guid>
			<description><![CDATA[Hello,<br />
<br />
Can I use one multi-gang Kincony momentary wall switch with different devices, one device per gang? I want a 2-gangs switch:<br />
<br />
 - Gang 1 to an F24 (to control a light bulb by software)<br />
 - Gang 2 to a KC868-AP (ESP32) dimmer (to control an LED strip).<br />
<br />
Is this wiring possible?<br />
<br />
Many thanks]]></description>
			<content:encoded><![CDATA[Hello,<br />
<br />
Can I use one multi-gang Kincony momentary wall switch with different devices, one device per gang? I want a 2-gangs switch:<br />
<br />
 - Gang 1 to an F24 (to control a light bulb by software)<br />
 - Gang 2 to a KC868-AP (ESP32) dimmer (to control an LED strip).<br />
<br />
Is this wiring possible?<br />
<br />
Many thanks]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[F-24: Problem using built-in 433MHz receiver with ESPHome (GPIO40 issue)]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=8174</link>
			<pubDate>Wed, 11 Jun 2025 01:23:00 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=8813">mwsieminski</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=8174</guid>
			<description><![CDATA[Hello,<br />
I'm using the Kincony F-24 controller and trying to get the built-in 433MHz receiver working under ESPHome.<br />
I get the following error:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>[15:27:57][C][remote_receiver.esp32:161]: Remote Receiver:<br />
[15:27:57][C][remote_receiver.esp32:162]:   Pin: GPIO40<br />
[15:27:57][C][remote_receiver.esp32:173]:   Channel: 0<br />
[15:27:57][C][remote_receiver.esp32:174]:   RMT memory blocks: 3<br />
[15:27:57][C][remote_receiver.esp32:175]:   Clock divider: 80<br />
[15:27:57][C][remote_receiver.esp32:178]:   Tolerance: 25%<br />
[15:27:57][C][remote_receiver.esp32:179]:   Filter out pulses shorter than: 50 us<br />
[15:27:57][C][remote_receiver.esp32:180]:   Signal is done after 10000 us of no changes<br />
[15:27:57][E][remote_receiver.esp32:183]: Configuring RMT driver failed: ESP_ERR_INVALID_ARG (in rmt_config)<br />
[15:27:57][E][component:085]:   Component remote_receiver is marked FAILED</code></div></div><br />
<br />
Below is part of my ESPHome YAML configuration:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>esphome:<br />
  name: f24<br />
  friendly_name: "Kincony F24 Controller"<br />
  project:<br />
    name: kincony.f24-smart-home<br />
    version: "1.0"<br />
  <br />
esp32:<br />
  board: esp32-s3-devkitc-1<br />
  framework:<br />
    type: arduino<br />
<br />
# Enable logging<br />
logger:<br />
<br />
# Enable Home Assistant API<br />
api:<br />
  id: ha_api<br />
  encryption:<br />
    key: !secret<br />
<br />
ota:<br />
  platform: esphome<br />
  password: !secret<br />
<br />
ethernet:<br />
  type: W5500<br />
  clk_pin: GPIO42<br />
  mosi_pin: GPIO43<br />
  miso_pin: GPIO44<br />
  cs_pin: GPIO41<br />
  interrupt_pin: GPIO2<br />
  reset_pin: GPIO1<br />
  domain: .local<br />
  id: ethernet_interface<br />
<br />
<br />
web_server:<br />
  port: 80<br />
<br />
i2c:<br />
  - id: bus_a<br />
    sda: GPIO8<br />
    scl: GPIO18<br />
    scan: true<br />
    frequency: 400kHz<br />
<br />
pcf8574:<br />
  - id: 'pcf8574_outputs_9_24'<br />
    i2c_id: bus_a<br />
    address: 0x25<br />
  - id: 'pcf8574_inputs_1_16'<br />
    i2c_id: bus_a<br />
    address: 0x24<br />
  - id: 'pcf8574_outputs_1_8_inputs_17_24'<br />
    i2c_id: bus_a<br />
    address: 0x26<br />
<br />
globals:<br />
  - id: current_ip_address<br />
    type: std::string<br />
    restore_value: no<br />
    initial_value: '"Booting..."'<br />
  - id: ha_status_text<br />
    type: std::string<br />
    restore_value: no<br />
    initial_value: '"Offline"'<br />
  - id: rf_code_display<br />
    type: std::string<br />
    restore_value: no<br />
    initial_value: '""'<br />
  - id: click_counts<br />
    type: int<br />
    initial_value: '0'<br />
<br />
<br />
# Sekcja definiująca fizyczne wyjścia (przekaźniki)<br />
output:<br />
  - platform: gpio<br />
    id: output_wiatrolap<br />
    pin: { pcf8574: pcf8574_outputs_1_8_inputs_17_24, number: 12, mode: OUTPUT, inverted: true }<br />
  - platform: gpio<br />
    id: output_salon<br />
    pin: { pcf8574: pcf8574_outputs_1_8_inputs_17_24, number: 13, mode: OUTPUT, inverted: true }<br />
<br />
<br />
binary_sensor:<br />
  - platform: status<br />
    name: "Kincony F24 Status"<br />
    id: f24_status_ha<br />
  - platform: template<br />
    name: "Kincony F24 Ethernet Status"<br />
    id: ethernet_connected_status<br />
    lambda: |-<br />
      return id(ethernet_interface).is_connected();<br />
    on_press:<br />
      then:<br />
        - lambda: |-<br />
            id(current_ip_address) = id(ethernet_interface).get_ip_addresses()[0].str();<br />
            id(ha_status_text) = "ETH OK";<br />
            ESP_LOGI("ethernet", "Ethernet connected. IP: %s", id(current_ip_address).c_str());<br />
    on_release:<br />
      then:<br />
        - lambda: |-<br />
            id(current_ip_address) = "AP Mode";<br />
            id(ha_status_text) = "AP Mode";<br />
            ESP_LOGW("ethernet", "Ethernet disconnected. Activating AP mode.");<br />
  - platform: template<br />
    id: wifi_ap_active<br />
    name: "Kincony F24 WiFi AP Active"<br />
    internal: true<br />
    lambda: |-<br />
      return !id(ethernet_interface).is_connected();<br />
<br />
<br />
  - platform: gpio<br />
    name: "Włącznik Wiatrołap"<br />
    pin:<br />
      pcf8574: pcf8574_inputs_1_16<br />
      number: 0<br />
      inverted: true<br />
    filters:<br />
      - delayed_on: 10ms<br />
    on_press:<br />
      then:<br />
        - lambda: 'id(click_counts) = 0;'<br />
    on_multi_click:<br />
      - timing:<br />
          - ON for at most 600ms<br />
          - OFF for at most 600ms<br />
          - ON for at most 600ms<br />
          - OFF for at least 200ms<br />
        then:<br />
          - homeassistant.event:<br />
              event: esphome.wiatrolap_double_click<br />
              data:<br />
                input: "1"<br />
          - logger.log: "Włącznik Wiatrołap: Dwuklik"<br />
      - timing:<br />
          - ON for at most 600ms<br />
          - OFF for at least 351ms<br />
        then:<br />
          - light.toggle: light_wiatrolap<br />
          - logger.log: "Wlacznik Wiatrołap: Pojedynczy klik"<br />
<br />
  - platform: gpio<br />
    name: "Włącznik Salon"<br />
    pin:<br />
      pcf8574: pcf8574_inputs_1_16<br />
      number: 1<br />
      inverted: true<br />
    filters:<br />
      - delayed_on: 10ms<br />
    on_press:<br />
      then:<br />
        - lambda: 'id(click_counts) = 0;'<br />
    on_multi_click:<br />
      - timing:<br />
          - ON for at most 600ms<br />
          - OFF for at most 600ms<br />
          - ON for at most 600ms<br />
          - OFF for at least 200ms<br />
        then:<br />
          - homeassistant.event:<br />
              event: esphome.salon_double_click<br />
          - logger.log: "Włącznik Salon: Dwuklik"<br />
      - timing:<br />
          - ON for at most 600ms<br />
          - OFF for at least 351ms<br />
        then:<br />
          - light.toggle: light_salon<br />
          - logger.log: "Wlacznik Salon: Pojedynczy klik"<br />
<br />
 <br />
<br />
# Sekcja definiująca logiczne encje świateł<br />
light:<br />
  - platform: binary<br />
    name: "Wiatrołap"<br />
    id: light_wiatrolap<br />
    output: output_wiatrolap<br />
  - platform: binary<br />
    name: "Salon"<br />
    id: light_salon<br />
    output: output_salon<br />
<br />
#normal version for RF receiver - not working<br />
#remote_receiver:<br />
#  pin:<br />
#    number: GPIO40<br />
#    inverted: true<br />
#  dump:<br />
#    - rc_switch<br />
#  tolerance: 50%<br />
#  filter: 250us<br />
#  idle: 4ms<br />
#  buffer_size: 2kb<br />
<br />
#  on_rc_switch:<br />
#    then:<br />
 #     - logger.log:<br />
 #         format: "RC Switch received. Code: %u"<br />
 #         args: [ 'x.code' ]<br />
 #    - lambda: |-<br />
 #        id(rf_code_display) = "RC: " + to_string(x.code);<br />
 #    - homeassistant.event:<br />
 #         event: esphome.f24_rf_received<br />
 #         data:<br />
 #          code: !lambda 'return x.code;'<br />
<br />
# Minimal version for testing - not working<br />
remote_receiver:<br />
  pin:<br />
    number: GPIO40<br />
    inverted: true <br />
  dump: rc_switch <br />
  <br />
button:<br />
  - platform: restart<br />
    name: "Kincony F24 Restart"<br />
<br />
font:<br />
  - file: "gfonts://Roboto"<br />
    id: roboto_12<br />
    size: 12<br />
  - file: "gfonts://Roboto"<br />
    id: roboto_10<br />
    size: 10<br />
<br />
display:<br />
  - platform: ssd1306_i2c<br />
    id: oled_display<br />
    model: "SSD1306 128x64"<br />
    address: 0x3C<br />
    i2c_id: bus_a<br />
    update_interval: 2s<br />
    pages:<br />
      - id: page1<br />
        lambda: |-<br />
          it.strftime(0, 0, id(roboto_10), "%H:%M:%S", id(homeassistant_time).now());<br />
          it.print(0, 12, id(roboto_12), id(current_ip_address).c_str());<br />
          it.print(0, 28, id(roboto_12), id(ha_status_text).c_str());<br />
          if (!id(rf_code_display).empty()) {<br />
            it.print(0, 44, id(roboto_12), id(rf_code_display).c_str());<br />
          }<br />
          it.horizontal_line(0, 57, 128);<br />
          it.printf(0, 58, id(roboto_10), "F24 Controller");;<br />
          <br />
time:<br />
  - platform: homeassistant<br />
    id: homeassistant_time<br />
    on_time:<br />
      - seconds: 0<br />
        minutes: 0<br />
        then:<br />
          - logger.log: "Synchronizing time with Home Assistant."<br />
<br />
interval:<br />
  - interval: 5s<br />
    then:<br />
      - lambda: |-<br />
          if (id(ethernet_interface).is_connected()) {<br />
            id(current_ip_address) = id(ethernet_interface).get_ip_addresses()[0].str();<br />
            if (id(f24_status_ha).state) {<br />
               id(ha_status_text) = "ETH HA OK";<br />
            } else {<br />
               id(ha_status_text) = "ETH OK";<br />
            }<br />
          } else if (id(wifi_ap_active).state) {<br />
            id(current_ip_address) = "AP: 192.168.4.1";<br />
            id(ha_status_text) = "AP Mode";<br />
          } else {<br />
            id(current_ip_address) = "No Network";<br />
            id(ha_status_text) = "Offline";<br />
          }<br />
  <br />
<br />
sensor:<br />
  - platform: adc<br />
    pin: GPIO5<br />
    name: "F24 A1 Voltage"<br />
    update_interval: 60s<br />
    attenuation: 12db<br />
  - platform: adc<br />
    pin: GPIO7<br />
    name: "F24 A2 Voltage"<br />
    update_interval: 60s<br />
    attenuation: 12db<br />
  - platform: adc<br />
    pin: GPIO6<br />
    name: "F24 A3 Current"<br />
    update_interval: 60s<br />
    unit_of_measurement: mA<br />
    attenuation: 12db<br />
    filters:<br />
      - multiply: 6.66666666<br />
  - platform: adc<br />
    pin: GPIO4<br />
    name: "F24 A4 Current"<br />
    update_interval: 60s<br />
    unit_of_measurement: mA<br />
    attenuation: 12db<br />
    filters:<br />
      - multiply: 6.66666666</code></div></div><br />
My questions:<br />
<ol type="1" class="mycode_list"><li>Is the 433MHz receiver really connected to native GPIO40 of the ESP32?<br />
</li>
<li>Is this GPIO compatible with the RMT hardware required by remote_receiver in ESPHome?<br />
</li>
<li>Could the RF receiver be connected via an I²C expander (like PCF8574), or is it mapped internally in another way?<br />
<br />
</li>
</ol>
Thanks for your support!]]></description>
			<content:encoded><![CDATA[Hello,<br />
I'm using the Kincony F-24 controller and trying to get the built-in 433MHz receiver working under ESPHome.<br />
I get the following error:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>[15:27:57][C][remote_receiver.esp32:161]: Remote Receiver:<br />
[15:27:57][C][remote_receiver.esp32:162]:   Pin: GPIO40<br />
[15:27:57][C][remote_receiver.esp32:173]:   Channel: 0<br />
[15:27:57][C][remote_receiver.esp32:174]:   RMT memory blocks: 3<br />
[15:27:57][C][remote_receiver.esp32:175]:   Clock divider: 80<br />
[15:27:57][C][remote_receiver.esp32:178]:   Tolerance: 25%<br />
[15:27:57][C][remote_receiver.esp32:179]:   Filter out pulses shorter than: 50 us<br />
[15:27:57][C][remote_receiver.esp32:180]:   Signal is done after 10000 us of no changes<br />
[15:27:57][E][remote_receiver.esp32:183]: Configuring RMT driver failed: ESP_ERR_INVALID_ARG (in rmt_config)<br />
[15:27:57][E][component:085]:   Component remote_receiver is marked FAILED</code></div></div><br />
<br />
Below is part of my ESPHome YAML configuration:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>esphome:<br />
  name: f24<br />
  friendly_name: "Kincony F24 Controller"<br />
  project:<br />
    name: kincony.f24-smart-home<br />
    version: "1.0"<br />
  <br />
esp32:<br />
  board: esp32-s3-devkitc-1<br />
  framework:<br />
    type: arduino<br />
<br />
# Enable logging<br />
logger:<br />
<br />
# Enable Home Assistant API<br />
api:<br />
  id: ha_api<br />
  encryption:<br />
    key: !secret<br />
<br />
ota:<br />
  platform: esphome<br />
  password: !secret<br />
<br />
ethernet:<br />
  type: W5500<br />
  clk_pin: GPIO42<br />
  mosi_pin: GPIO43<br />
  miso_pin: GPIO44<br />
  cs_pin: GPIO41<br />
  interrupt_pin: GPIO2<br />
  reset_pin: GPIO1<br />
  domain: .local<br />
  id: ethernet_interface<br />
<br />
<br />
web_server:<br />
  port: 80<br />
<br />
i2c:<br />
  - id: bus_a<br />
    sda: GPIO8<br />
    scl: GPIO18<br />
    scan: true<br />
    frequency: 400kHz<br />
<br />
pcf8574:<br />
  - id: 'pcf8574_outputs_9_24'<br />
    i2c_id: bus_a<br />
    address: 0x25<br />
  - id: 'pcf8574_inputs_1_16'<br />
    i2c_id: bus_a<br />
    address: 0x24<br />
  - id: 'pcf8574_outputs_1_8_inputs_17_24'<br />
    i2c_id: bus_a<br />
    address: 0x26<br />
<br />
globals:<br />
  - id: current_ip_address<br />
    type: std::string<br />
    restore_value: no<br />
    initial_value: '"Booting..."'<br />
  - id: ha_status_text<br />
    type: std::string<br />
    restore_value: no<br />
    initial_value: '"Offline"'<br />
  - id: rf_code_display<br />
    type: std::string<br />
    restore_value: no<br />
    initial_value: '""'<br />
  - id: click_counts<br />
    type: int<br />
    initial_value: '0'<br />
<br />
<br />
# Sekcja definiująca fizyczne wyjścia (przekaźniki)<br />
output:<br />
  - platform: gpio<br />
    id: output_wiatrolap<br />
    pin: { pcf8574: pcf8574_outputs_1_8_inputs_17_24, number: 12, mode: OUTPUT, inverted: true }<br />
  - platform: gpio<br />
    id: output_salon<br />
    pin: { pcf8574: pcf8574_outputs_1_8_inputs_17_24, number: 13, mode: OUTPUT, inverted: true }<br />
<br />
<br />
binary_sensor:<br />
  - platform: status<br />
    name: "Kincony F24 Status"<br />
    id: f24_status_ha<br />
  - platform: template<br />
    name: "Kincony F24 Ethernet Status"<br />
    id: ethernet_connected_status<br />
    lambda: |-<br />
      return id(ethernet_interface).is_connected();<br />
    on_press:<br />
      then:<br />
        - lambda: |-<br />
            id(current_ip_address) = id(ethernet_interface).get_ip_addresses()[0].str();<br />
            id(ha_status_text) = "ETH OK";<br />
            ESP_LOGI("ethernet", "Ethernet connected. IP: %s", id(current_ip_address).c_str());<br />
    on_release:<br />
      then:<br />
        - lambda: |-<br />
            id(current_ip_address) = "AP Mode";<br />
            id(ha_status_text) = "AP Mode";<br />
            ESP_LOGW("ethernet", "Ethernet disconnected. Activating AP mode.");<br />
  - platform: template<br />
    id: wifi_ap_active<br />
    name: "Kincony F24 WiFi AP Active"<br />
    internal: true<br />
    lambda: |-<br />
      return !id(ethernet_interface).is_connected();<br />
<br />
<br />
  - platform: gpio<br />
    name: "Włącznik Wiatrołap"<br />
    pin:<br />
      pcf8574: pcf8574_inputs_1_16<br />
      number: 0<br />
      inverted: true<br />
    filters:<br />
      - delayed_on: 10ms<br />
    on_press:<br />
      then:<br />
        - lambda: 'id(click_counts) = 0;'<br />
    on_multi_click:<br />
      - timing:<br />
          - ON for at most 600ms<br />
          - OFF for at most 600ms<br />
          - ON for at most 600ms<br />
          - OFF for at least 200ms<br />
        then:<br />
          - homeassistant.event:<br />
              event: esphome.wiatrolap_double_click<br />
              data:<br />
                input: "1"<br />
          - logger.log: "Włącznik Wiatrołap: Dwuklik"<br />
      - timing:<br />
          - ON for at most 600ms<br />
          - OFF for at least 351ms<br />
        then:<br />
          - light.toggle: light_wiatrolap<br />
          - logger.log: "Wlacznik Wiatrołap: Pojedynczy klik"<br />
<br />
  - platform: gpio<br />
    name: "Włącznik Salon"<br />
    pin:<br />
      pcf8574: pcf8574_inputs_1_16<br />
      number: 1<br />
      inverted: true<br />
    filters:<br />
      - delayed_on: 10ms<br />
    on_press:<br />
      then:<br />
        - lambda: 'id(click_counts) = 0;'<br />
    on_multi_click:<br />
      - timing:<br />
          - ON for at most 600ms<br />
          - OFF for at most 600ms<br />
          - ON for at most 600ms<br />
          - OFF for at least 200ms<br />
        then:<br />
          - homeassistant.event:<br />
              event: esphome.salon_double_click<br />
          - logger.log: "Włącznik Salon: Dwuklik"<br />
      - timing:<br />
          - ON for at most 600ms<br />
          - OFF for at least 351ms<br />
        then:<br />
          - light.toggle: light_salon<br />
          - logger.log: "Wlacznik Salon: Pojedynczy klik"<br />
<br />
 <br />
<br />
# Sekcja definiująca logiczne encje świateł<br />
light:<br />
  - platform: binary<br />
    name: "Wiatrołap"<br />
    id: light_wiatrolap<br />
    output: output_wiatrolap<br />
  - platform: binary<br />
    name: "Salon"<br />
    id: light_salon<br />
    output: output_salon<br />
<br />
#normal version for RF receiver - not working<br />
#remote_receiver:<br />
#  pin:<br />
#    number: GPIO40<br />
#    inverted: true<br />
#  dump:<br />
#    - rc_switch<br />
#  tolerance: 50%<br />
#  filter: 250us<br />
#  idle: 4ms<br />
#  buffer_size: 2kb<br />
<br />
#  on_rc_switch:<br />
#    then:<br />
 #     - logger.log:<br />
 #         format: "RC Switch received. Code: %u"<br />
 #         args: [ 'x.code' ]<br />
 #    - lambda: |-<br />
 #        id(rf_code_display) = "RC: " + to_string(x.code);<br />
 #    - homeassistant.event:<br />
 #         event: esphome.f24_rf_received<br />
 #         data:<br />
 #          code: !lambda 'return x.code;'<br />
<br />
# Minimal version for testing - not working<br />
remote_receiver:<br />
  pin:<br />
    number: GPIO40<br />
    inverted: true <br />
  dump: rc_switch <br />
  <br />
button:<br />
  - platform: restart<br />
    name: "Kincony F24 Restart"<br />
<br />
font:<br />
  - file: "gfonts://Roboto"<br />
    id: roboto_12<br />
    size: 12<br />
  - file: "gfonts://Roboto"<br />
    id: roboto_10<br />
    size: 10<br />
<br />
display:<br />
  - platform: ssd1306_i2c<br />
    id: oled_display<br />
    model: "SSD1306 128x64"<br />
    address: 0x3C<br />
    i2c_id: bus_a<br />
    update_interval: 2s<br />
    pages:<br />
      - id: page1<br />
        lambda: |-<br />
          it.strftime(0, 0, id(roboto_10), "%H:%M:%S", id(homeassistant_time).now());<br />
          it.print(0, 12, id(roboto_12), id(current_ip_address).c_str());<br />
          it.print(0, 28, id(roboto_12), id(ha_status_text).c_str());<br />
          if (!id(rf_code_display).empty()) {<br />
            it.print(0, 44, id(roboto_12), id(rf_code_display).c_str());<br />
          }<br />
          it.horizontal_line(0, 57, 128);<br />
          it.printf(0, 58, id(roboto_10), "F24 Controller");;<br />
          <br />
time:<br />
  - platform: homeassistant<br />
    id: homeassistant_time<br />
    on_time:<br />
      - seconds: 0<br />
        minutes: 0<br />
        then:<br />
          - logger.log: "Synchronizing time with Home Assistant."<br />
<br />
interval:<br />
  - interval: 5s<br />
    then:<br />
      - lambda: |-<br />
          if (id(ethernet_interface).is_connected()) {<br />
            id(current_ip_address) = id(ethernet_interface).get_ip_addresses()[0].str();<br />
            if (id(f24_status_ha).state) {<br />
               id(ha_status_text) = "ETH HA OK";<br />
            } else {<br />
               id(ha_status_text) = "ETH OK";<br />
            }<br />
          } else if (id(wifi_ap_active).state) {<br />
            id(current_ip_address) = "AP: 192.168.4.1";<br />
            id(ha_status_text) = "AP Mode";<br />
          } else {<br />
            id(current_ip_address) = "No Network";<br />
            id(ha_status_text) = "Offline";<br />
          }<br />
  <br />
<br />
sensor:<br />
  - platform: adc<br />
    pin: GPIO5<br />
    name: "F24 A1 Voltage"<br />
    update_interval: 60s<br />
    attenuation: 12db<br />
  - platform: adc<br />
    pin: GPIO7<br />
    name: "F24 A2 Voltage"<br />
    update_interval: 60s<br />
    attenuation: 12db<br />
  - platform: adc<br />
    pin: GPIO6<br />
    name: "F24 A3 Current"<br />
    update_interval: 60s<br />
    unit_of_measurement: mA<br />
    attenuation: 12db<br />
    filters:<br />
      - multiply: 6.66666666<br />
  - platform: adc<br />
    pin: GPIO4<br />
    name: "F24 A4 Current"<br />
    update_interval: 60s<br />
    unit_of_measurement: mA<br />
    attenuation: 12db<br />
    filters:<br />
      - multiply: 6.66666666</code></div></div><br />
My questions:<br />
<ol type="1" class="mycode_list"><li>Is the 433MHz receiver really connected to native GPIO40 of the ESP32?<br />
</li>
<li>Is this GPIO compatible with the RMT hardware required by remote_receiver in ESPHome?<br />
</li>
<li>Could the RF receiver be connected via an I²C expander (like PCF8574), or is it mapped internally in another way?<br />
<br />
</li>
</ol>
Thanks for your support!]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[F24 ESPHome yaml for home assistant by PCF8575 chip]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=7145</link>
			<pubDate>Thu, 28 Nov 2024 19:54:03 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=7145</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>esphome:<br />
  name: f24<br />
  friendly_name: f24<br />
  platformio_options:<br />
    board_build.extra_flags:<br />
      # WIFI_CONTROL_SELF_MODE = 0<br />
      # WIFI_CONTROL_SELF_MODE = 1<br />
      - "-DWIFI_CONTROL_SELF_MODE=1"<br />
esp32:<br />
  board: esp32-s3-devkitc-1<br />
  framework:<br />
    type: arduino<br />
    <br />
<br />
external_components:<br />
  - source:<br />
      type: git<br />
      url: https://github.com/hzkincony/esphome-tuya-wifi-mcu<br />
      ref: v1.3.0<br />
<br />
# Enable logging<br />
<br />
  # hardware_uart: USB_SERIAL_JTAG<br />
# Enable Home Assistant API<br />
api:<br />
  encryption:<br />
    key: "WeVOuL5oNhjXcfzXtTirlOwvtWvCD5yqIxd3oV4es1k="<br />
<br />
ethernet:<br />
  type: W5500<br />
  clk_pin: GPIO42<br />
  mosi_pin: GPIO43<br />
  miso_pin: GPIO44<br />
  cs_pin: GPIO41<br />
  interrupt_pin: GPIO2<br />
  reset_pin: GPIO1<br />
<br />
i2c:<br />
   - id: bus_a<br />
     sda: 8<br />
     scl: 18<br />
     scan: true<br />
     frequency: 400kHz<br />
<br />
pcf8574:<br />
  - id: 'pcf8574_hub_out_1'  # for output channel 9-24<br />
    i2c_id: bus_a<br />
    address: 0x25<br />
    pcf8575: true<br />
<br />
  - id: 'pcf8574_hub_in_1'  # for digital input channel 1-16<br />
    i2c_id: bus_a<br />
    address: 0x24<br />
    pcf8575: true<br />
<br />
  - id: 'pcf8574_hub_out_in_2'  # for output channel 1-8  + (input 17-24)<br />
    i2c_id: bus_a<br />
    address: 0x26<br />
    pcf8575: true<br />
<br />
uart:<br />
  - id: uart_1    #RS485<br />
    baud_rate: 9600<br />
    debug:<br />
      direction: BOTH<br />
      dummy_receiver: true<br />
      after:<br />
        timeout: 10ms<br />
    tx_pin: 16<br />
    rx_pin: 17<br />
<br />
  - id: tuya_mcu_uart<br />
    tx_pin: GPIO39<br />
    rx_pin: GPIO38<br />
    baud_rate: 9600<br />
<br />
tuya_wifi_mcu:<br />
  # tuya mcu product id<br />
  product_id: cchos3g1j2ucfbyd<br />
  uart_id: tuya_mcu_uart<br />
  wifi_reset_pin: 28<br />
  wifi_led_pin: 16<br />
<br />
switch:<br />
  - platform: uart<br />
    uart_id: uart_1<br />
    name: "RS485 Button"<br />
    data: [0x11, 0x22, 0x33, 0x44, 0x55]<br />
<br />
  - platform: gpio<br />
    name: "f24-output01"<br />
    id: "f24_output01"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 12<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output1-tuya<br />
    dp_id: 1<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output01"<br />
<br />
  - platform: gpio<br />
    name: "f24-output02"<br />
    id: "f24_output02"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 13<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output2-tuya<br />
    dp_id: 2<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output02"<br />
<br />
  - platform: gpio<br />
    name: "f24-output03"<br />
    id: "f24_output03"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 14<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output3-tuya<br />
    dp_id: 3<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output03"<br />
<br />
  - platform: gpio<br />
    name: "f24-output04"<br />
    id: "f24_output04"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 15<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output4-tuya<br />
    dp_id: 4<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output04"<br />
<br />
  - platform: gpio<br />
    name: "f24-output05"<br />
    id: "f24_output05"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 8<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output5-tuya<br />
    dp_id: 5<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output05"<br />
<br />
  - platform: gpio<br />
    name: "f24-output06"<br />
    id: "f24_output06"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 9<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output6-tuya<br />
    dp_id: 6<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output06"<br />
<br />
  - platform: gpio<br />
    name: "f24-output07"<br />
    id: "f24_output07"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 10<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output7-tuya<br />
    dp_id: 101<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output07"<br />
<br />
  - platform: gpio<br />
    name: "f24-output08"<br />
    id: "f24_output08"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 11<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output8-tuya<br />
    dp_id: 102<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output08"<br />
<br />
  - platform: gpio<br />
    name: "f24-output09"<br />
    id: "f24_output09"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 0<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output9-tuya<br />
    dp_id: 103<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output09"<br />
<br />
  - platform: gpio<br />
    name: "f24-output10"<br />
    id: "f24_output10"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 1<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output10-tuya<br />
    dp_id: 104<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output10"<br />
<br />
  - platform: gpio<br />
    name: "f24-output11"<br />
    id: "f24_output11"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 2<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output11-tuya<br />
    dp_id: 105<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output11"<br />
<br />
  - platform: gpio<br />
    name: "f24-output12"<br />
    id: "f24_output12"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 3<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output12-tuya<br />
    dp_id: 106<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output12"<br />
<br />
  - platform: gpio<br />
    name: "f24-output13"<br />
    id: "f24_output13"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 4<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output13-tuya<br />
    dp_id: 107<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output13"<br />
<br />
  - platform: gpio<br />
    name: "f24-output14"<br />
    id: "f24_output14"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 5<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output14-tuya<br />
    dp_id: 108<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output14"<br />
<br />
  - platform: gpio<br />
    name: "f24-output15"<br />
    id: "f24_output15"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 6<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output15-tuya<br />
    dp_id: 109<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output15"<br />
<br />
  - platform: gpio<br />
    name: "f24-output16"<br />
    id: "f24_output16"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 7<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output16-tuya<br />
    dp_id: 110<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output16"<br />
<br />
  - platform: gpio<br />
    name: "f24-output17"<br />
    id: "f24_output17"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 8<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output17-tuya<br />
    dp_id: 126<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output17"<br />
<br />
  - platform: gpio<br />
    name: "f24-output18"<br />
    id: "f24_output18"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 9<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output18-tuya<br />
    dp_id: 129<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output18"<br />
<br />
  - platform: gpio<br />
    name: "f24-output19"<br />
    id: "f24_output19"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 10<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output19-tuya<br />
    dp_id: 130<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output19"<br />
<br />
  - platform: gpio<br />
    name: "f24-output20"<br />
    id: "f24_output20"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 11<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output20-tuya<br />
    dp_id: 131<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output20"<br />
<br />
  - platform: gpio<br />
    name: "f24-output21"<br />
    id: "f24_output21"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 12<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output21-tuya<br />
    dp_id: 132<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output21"<br />
<br />
  - platform: gpio<br />
    name: "f24-output22"<br />
    id: "f24_output22"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 13<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output22-tuya<br />
    dp_id: 133<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output22"<br />
<br />
  - platform: gpio<br />
    name: "f24-output23"<br />
    id: "f24_output23"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 14<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output23-tuya<br />
    dp_id: 134<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output23"<br />
<br />
  - platform: gpio<br />
    name: "f24-output24"<br />
    id: "f24_output24"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 15<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output24-tuya<br />
    dp_id: 135<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output24"<br />
<br />
<br />
binary_sensor:<br />
  - platform: gpio<br />
    name: "f24-input01"<br />
    id: "f24_input01"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 0<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input1-tuya<br />
    dp_id: 111<br />
    bind_binary_sensor_id: f24_input01<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input02"<br />
    id: "f24_input02"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 1<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input2-tuya<br />
    dp_id: 112<br />
    bind_binary_sensor_id: f24_input02<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input03"<br />
    id: "f24_input03"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 2<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input3-tuya<br />
    dp_id: 113<br />
    bind_binary_sensor_id: f24_input03<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input04"<br />
    id: "f24_input04"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 3<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input4-tuya<br />
    dp_id: 114<br />
    bind_binary_sensor_id: f24_input04<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input05"<br />
    id: "f24_input05"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 4<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input5-tuya<br />
    dp_id: 115<br />
    bind_binary_sensor_id: f24_input05<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input06"<br />
    id: "f24_input06"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 5<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input6-tuya<br />
    dp_id: 116<br />
    bind_binary_sensor_id: f24_input06<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input07"<br />
    id: "f24_input07"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 6<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input7-tuya<br />
    dp_id: 117<br />
    bind_binary_sensor_id: f24_input07<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input08"<br />
    id: "f24_input08"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 7<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input8-tuya<br />
    dp_id: 118<br />
    bind_binary_sensor_id: f24_input08<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input09"<br />
    id: "f24_input09"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 8<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input9-tuya<br />
    dp_id: 119<br />
    bind_binary_sensor_id: f24_input09<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input10"<br />
    id: "f24_input10"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 9<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input10-tuya<br />
    dp_id: 120<br />
    bind_binary_sensor_id: f24_input10<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input11"<br />
    id: "f24_input11"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 10<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input11-tuya<br />
    dp_id: 121<br />
    bind_binary_sensor_id: f24_input11<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input12"<br />
    id: "f24_input12"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 11<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input12-tuya<br />
    dp_id: 122<br />
    bind_binary_sensor_id: f24_input12<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input13"<br />
    id: "f24_input13"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 12<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input13-tuya<br />
    dp_id: 123<br />
    bind_binary_sensor_id: f24_input13<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input14"<br />
    id: "f24_input14"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 13<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input14-tuya<br />
    dp_id: 124<br />
    bind_binary_sensor_id: f24_input14<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input15"<br />
    id: "f24_input15"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 14<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input15-tuya<br />
    dp_id: 125<br />
    bind_binary_sensor_id: f24_input15<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input16"<br />
    id: "f24_input16"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 15<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input17"<br />
    id: "f24_input17"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 0<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input18"<br />
    id: "f24_input18"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 1<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input19"<br />
    id: "f24_input19"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 2<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input20"<br />
    id: "f24_input20"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 3<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input21"<br />
    id: "f24_input21"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 4<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input22"<br />
    id: "f24_input22"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 5<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input23"<br />
    id: "f24_input23"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 6<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input24"<br />
    id: "f24_input24"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 7<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
##pull-up resistance on PCB<br />
  - platform: gpio<br />
    name: "f24-W1-io48"<br />
    pin: <br />
      number: 48<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f24-W1-io47"<br />
    pin: <br />
      number: 47<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f24-W1-io21"<br />
    pin: <br />
      number: 21<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f24-W1-io15"<br />
    pin: <br />
      number: 15<br />
      inverted: true<br />
## without resistance on PCB<br />
  - platform: gpio<br />
    name: "f24-W1-io13"<br />
    pin: <br />
      number: 13<br />
      inverted: false<br />
<br />
  - platform: gpio<br />
    name: "f24-W1-io14"<br />
    pin: <br />
      number: 14<br />
      inverted:  false<br />
<br />
  - platform: gpio<br />
    name: "f24-433M"<br />
    pin: <br />
      number: 40<br />
      inverted:  false<br />
<br />
sensor:<br />
  - platform: adc<br />
    pin: 5<br />
    name: "f24 A1 Voltage"<br />
    update_interval: 5s<br />
    attenuation: 11db<br />
    filters:<br />
      - lambda:<br />
          if (x &gt;= 3.11) {<br />
            return x * 1.60256;<br />
          } else if (x &lt;= 0.15) {<br />
            return 0;<br />
          } else {<br />
            return x * 1.51;<br />
          }<br />
  - platform: adc<br />
    pin: 7<br />
    name: "f24 A2 Voltage"<br />
    update_interval: 5s<br />
    attenuation: 11db<br />
    filters:<br />
      # - multiply: 1.51515<br />
      - lambda:<br />
          if (x &gt;= 3.11) {<br />
            return x * 1.60256;<br />
          } else if (x &lt;= 0.15) {<br />
            return 0;<br />
          } else {<br />
            return x * 1.51;<br />
          }<br />
  - platform: adc<br />
    pin: 6<br />
    name: "f24 A3 Current"<br />
    update_interval: 5s<br />
    unit_of_measurement: mA<br />
    attenuation: 11db<br />
    filters:<br />
      - multiply: 6.66666666<br />
  - platform: adc<br />
    pin: 4<br />
    name: "f24 A4 Current"<br />
    update_interval: 5s<br />
    unit_of_measurement: mA<br />
    attenuation: 11db<br />
    filters:<br />
      - multiply: 6.66666666<br />
<br />
web_server:<br />
  port: 80<br />
<br />
font:<br />
  - file: "gfonts://Roboto"<br />
    id: roboto<br />
    size: 20<br />
<br />
display:<br />
  - platform: ssd1306_i2c<br />
    i2c_id: bus_a<br />
    model: "SSD1306 128x64"<br />
    address: 0x3C<br />
    lambda: |-<br />
      it.printf(0, 0, id(roboto), "KinCony F24");</code></div></div> download yaml file: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/txt.png" title="Text Document" border="0" alt=".txt" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=6538" target="_blank" title="">F24-HA.txt</a> (Size: 18.55 KB / Downloads: 790)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>esphome:<br />
  name: f24<br />
  friendly_name: f24<br />
  platformio_options:<br />
    board_build.extra_flags:<br />
      # WIFI_CONTROL_SELF_MODE = 0<br />
      # WIFI_CONTROL_SELF_MODE = 1<br />
      - "-DWIFI_CONTROL_SELF_MODE=1"<br />
esp32:<br />
  board: esp32-s3-devkitc-1<br />
  framework:<br />
    type: arduino<br />
    <br />
<br />
external_components:<br />
  - source:<br />
      type: git<br />
      url: https://github.com/hzkincony/esphome-tuya-wifi-mcu<br />
      ref: v1.3.0<br />
<br />
# Enable logging<br />
<br />
  # hardware_uart: USB_SERIAL_JTAG<br />
# Enable Home Assistant API<br />
api:<br />
  encryption:<br />
    key: "WeVOuL5oNhjXcfzXtTirlOwvtWvCD5yqIxd3oV4es1k="<br />
<br />
ethernet:<br />
  type: W5500<br />
  clk_pin: GPIO42<br />
  mosi_pin: GPIO43<br />
  miso_pin: GPIO44<br />
  cs_pin: GPIO41<br />
  interrupt_pin: GPIO2<br />
  reset_pin: GPIO1<br />
<br />
i2c:<br />
   - id: bus_a<br />
     sda: 8<br />
     scl: 18<br />
     scan: true<br />
     frequency: 400kHz<br />
<br />
pcf8574:<br />
  - id: 'pcf8574_hub_out_1'  # for output channel 9-24<br />
    i2c_id: bus_a<br />
    address: 0x25<br />
    pcf8575: true<br />
<br />
  - id: 'pcf8574_hub_in_1'  # for digital input channel 1-16<br />
    i2c_id: bus_a<br />
    address: 0x24<br />
    pcf8575: true<br />
<br />
  - id: 'pcf8574_hub_out_in_2'  # for output channel 1-8  + (input 17-24)<br />
    i2c_id: bus_a<br />
    address: 0x26<br />
    pcf8575: true<br />
<br />
uart:<br />
  - id: uart_1    #RS485<br />
    baud_rate: 9600<br />
    debug:<br />
      direction: BOTH<br />
      dummy_receiver: true<br />
      after:<br />
        timeout: 10ms<br />
    tx_pin: 16<br />
    rx_pin: 17<br />
<br />
  - id: tuya_mcu_uart<br />
    tx_pin: GPIO39<br />
    rx_pin: GPIO38<br />
    baud_rate: 9600<br />
<br />
tuya_wifi_mcu:<br />
  # tuya mcu product id<br />
  product_id: cchos3g1j2ucfbyd<br />
  uart_id: tuya_mcu_uart<br />
  wifi_reset_pin: 28<br />
  wifi_led_pin: 16<br />
<br />
switch:<br />
  - platform: uart<br />
    uart_id: uart_1<br />
    name: "RS485 Button"<br />
    data: [0x11, 0x22, 0x33, 0x44, 0x55]<br />
<br />
  - platform: gpio<br />
    name: "f24-output01"<br />
    id: "f24_output01"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 12<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output1-tuya<br />
    dp_id: 1<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output01"<br />
<br />
  - platform: gpio<br />
    name: "f24-output02"<br />
    id: "f24_output02"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 13<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output2-tuya<br />
    dp_id: 2<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output02"<br />
<br />
  - platform: gpio<br />
    name: "f24-output03"<br />
    id: "f24_output03"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 14<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output3-tuya<br />
    dp_id: 3<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output03"<br />
<br />
  - platform: gpio<br />
    name: "f24-output04"<br />
    id: "f24_output04"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 15<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output4-tuya<br />
    dp_id: 4<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output04"<br />
<br />
  - platform: gpio<br />
    name: "f24-output05"<br />
    id: "f24_output05"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 8<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output5-tuya<br />
    dp_id: 5<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output05"<br />
<br />
  - platform: gpio<br />
    name: "f24-output06"<br />
    id: "f24_output06"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 9<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output6-tuya<br />
    dp_id: 6<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output06"<br />
<br />
  - platform: gpio<br />
    name: "f24-output07"<br />
    id: "f24_output07"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 10<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output7-tuya<br />
    dp_id: 101<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output07"<br />
<br />
  - platform: gpio<br />
    name: "f24-output08"<br />
    id: "f24_output08"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 11<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output8-tuya<br />
    dp_id: 102<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output08"<br />
<br />
  - platform: gpio<br />
    name: "f24-output09"<br />
    id: "f24_output09"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 0<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output9-tuya<br />
    dp_id: 103<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output09"<br />
<br />
  - platform: gpio<br />
    name: "f24-output10"<br />
    id: "f24_output10"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 1<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output10-tuya<br />
    dp_id: 104<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output10"<br />
<br />
  - platform: gpio<br />
    name: "f24-output11"<br />
    id: "f24_output11"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 2<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output11-tuya<br />
    dp_id: 105<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output11"<br />
<br />
  - platform: gpio<br />
    name: "f24-output12"<br />
    id: "f24_output12"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 3<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output12-tuya<br />
    dp_id: 106<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output12"<br />
<br />
  - platform: gpio<br />
    name: "f24-output13"<br />
    id: "f24_output13"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 4<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output13-tuya<br />
    dp_id: 107<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output13"<br />
<br />
  - platform: gpio<br />
    name: "f24-output14"<br />
    id: "f24_output14"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 5<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output14-tuya<br />
    dp_id: 108<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output14"<br />
<br />
  - platform: gpio<br />
    name: "f24-output15"<br />
    id: "f24_output15"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 6<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output15-tuya<br />
    dp_id: 109<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output15"<br />
<br />
  - platform: gpio<br />
    name: "f24-output16"<br />
    id: "f24_output16"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 7<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output16-tuya<br />
    dp_id: 110<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output16"<br />
<br />
  - platform: gpio<br />
    name: "f24-output17"<br />
    id: "f24_output17"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 8<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output17-tuya<br />
    dp_id: 126<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output17"<br />
<br />
  - platform: gpio<br />
    name: "f24-output18"<br />
    id: "f24_output18"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 9<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output18-tuya<br />
    dp_id: 129<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output18"<br />
<br />
  - platform: gpio<br />
    name: "f24-output19"<br />
    id: "f24_output19"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 10<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output19-tuya<br />
    dp_id: 130<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output19"<br />
<br />
  - platform: gpio<br />
    name: "f24-output20"<br />
    id: "f24_output20"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 11<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output20-tuya<br />
    dp_id: 131<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output20"<br />
<br />
  - platform: gpio<br />
    name: "f24-output21"<br />
    id: "f24_output21"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 12<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output21-tuya<br />
    dp_id: 132<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output21"<br />
<br />
  - platform: gpio<br />
    name: "f24-output22"<br />
    id: "f24_output22"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 13<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output22-tuya<br />
    dp_id: 133<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output22"<br />
<br />
  - platform: gpio<br />
    name: "f24-output23"<br />
    id: "f24_output23"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 14<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output23-tuya<br />
    dp_id: 134<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output23"<br />
<br />
  - platform: gpio<br />
    name: "f24-output24"<br />
    id: "f24_output24"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 15<br />
      mode: OUTPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-output24-tuya<br />
    dp_id: 135<br />
    # hide from homeassistant ui<br />
    internal: true<br />
    # bind other switch, sync state<br />
    bind_switch_id: "f24_output24"<br />
<br />
<br />
binary_sensor:<br />
  - platform: gpio<br />
    name: "f24-input01"<br />
    id: "f24_input01"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 0<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input1-tuya<br />
    dp_id: 111<br />
    bind_binary_sensor_id: f24_input01<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input02"<br />
    id: "f24_input02"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 1<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input2-tuya<br />
    dp_id: 112<br />
    bind_binary_sensor_id: f24_input02<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input03"<br />
    id: "f24_input03"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 2<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input3-tuya<br />
    dp_id: 113<br />
    bind_binary_sensor_id: f24_input03<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input04"<br />
    id: "f24_input04"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 3<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input4-tuya<br />
    dp_id: 114<br />
    bind_binary_sensor_id: f24_input04<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input05"<br />
    id: "f24_input05"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 4<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input5-tuya<br />
    dp_id: 115<br />
    bind_binary_sensor_id: f24_input05<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input06"<br />
    id: "f24_input06"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 5<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input6-tuya<br />
    dp_id: 116<br />
    bind_binary_sensor_id: f24_input06<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input07"<br />
    id: "f24_input07"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 6<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input7-tuya<br />
    dp_id: 117<br />
    bind_binary_sensor_id: f24_input07<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input08"<br />
    id: "f24_input08"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 7<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input8-tuya<br />
    dp_id: 118<br />
    bind_binary_sensor_id: f24_input08<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input09"<br />
    id: "f24_input09"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 8<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input9-tuya<br />
    dp_id: 119<br />
    bind_binary_sensor_id: f24_input09<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input10"<br />
    id: "f24_input10"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 9<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input10-tuya<br />
    dp_id: 120<br />
    bind_binary_sensor_id: f24_input10<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input11"<br />
    id: "f24_input11"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 10<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input11-tuya<br />
    dp_id: 121<br />
    bind_binary_sensor_id: f24_input11<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input12"<br />
    id: "f24_input12"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 11<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input12-tuya<br />
    dp_id: 122<br />
    bind_binary_sensor_id: f24_input12<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input13"<br />
    id: "f24_input13"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 12<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input13-tuya<br />
    dp_id: 123<br />
    bind_binary_sensor_id: f24_input13<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input14"<br />
    id: "f24_input14"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 13<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input14-tuya<br />
    dp_id: 124<br />
    bind_binary_sensor_id: f24_input14<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input15"<br />
    id: "f24_input15"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 14<br />
      mode: INPUT<br />
      inverted: true<br />
  - platform: tuya_wifi_mcu<br />
    name: f24-input15-tuya<br />
    dp_id: 125<br />
    bind_binary_sensor_id: f24_input15<br />
    internal: true<br />
<br />
  - platform: gpio<br />
    name: "f24-input16"<br />
    id: "f24_input16"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 15<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input17"<br />
    id: "f24_input17"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 0<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input18"<br />
    id: "f24_input18"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 1<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input19"<br />
    id: "f24_input19"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 2<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input20"<br />
    id: "f24_input20"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 3<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input21"<br />
    id: "f24_input21"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 4<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input22"<br />
    id: "f24_input22"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 5<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input23"<br />
    id: "f24_input23"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 6<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f24-input24"<br />
    id: "f24_input24"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 7<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
##pull-up resistance on PCB<br />
  - platform: gpio<br />
    name: "f24-W1-io48"<br />
    pin: <br />
      number: 48<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f24-W1-io47"<br />
    pin: <br />
      number: 47<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f24-W1-io21"<br />
    pin: <br />
      number: 21<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f24-W1-io15"<br />
    pin: <br />
      number: 15<br />
      inverted: true<br />
## without resistance on PCB<br />
  - platform: gpio<br />
    name: "f24-W1-io13"<br />
    pin: <br />
      number: 13<br />
      inverted: false<br />
<br />
  - platform: gpio<br />
    name: "f24-W1-io14"<br />
    pin: <br />
      number: 14<br />
      inverted:  false<br />
<br />
  - platform: gpio<br />
    name: "f24-433M"<br />
    pin: <br />
      number: 40<br />
      inverted:  false<br />
<br />
sensor:<br />
  - platform: adc<br />
    pin: 5<br />
    name: "f24 A1 Voltage"<br />
    update_interval: 5s<br />
    attenuation: 11db<br />
    filters:<br />
      - lambda:<br />
          if (x &gt;= 3.11) {<br />
            return x * 1.60256;<br />
          } else if (x &lt;= 0.15) {<br />
            return 0;<br />
          } else {<br />
            return x * 1.51;<br />
          }<br />
  - platform: adc<br />
    pin: 7<br />
    name: "f24 A2 Voltage"<br />
    update_interval: 5s<br />
    attenuation: 11db<br />
    filters:<br />
      # - multiply: 1.51515<br />
      - lambda:<br />
          if (x &gt;= 3.11) {<br />
            return x * 1.60256;<br />
          } else if (x &lt;= 0.15) {<br />
            return 0;<br />
          } else {<br />
            return x * 1.51;<br />
          }<br />
  - platform: adc<br />
    pin: 6<br />
    name: "f24 A3 Current"<br />
    update_interval: 5s<br />
    unit_of_measurement: mA<br />
    attenuation: 11db<br />
    filters:<br />
      - multiply: 6.66666666<br />
  - platform: adc<br />
    pin: 4<br />
    name: "f24 A4 Current"<br />
    update_interval: 5s<br />
    unit_of_measurement: mA<br />
    attenuation: 11db<br />
    filters:<br />
      - multiply: 6.66666666<br />
<br />
web_server:<br />
  port: 80<br />
<br />
font:<br />
  - file: "gfonts://Roboto"<br />
    id: roboto<br />
    size: 20<br />
<br />
display:<br />
  - platform: ssd1306_i2c<br />
    i2c_id: bus_a<br />
    model: "SSD1306 128x64"<br />
    address: 0x3C<br />
    lambda: |-<br />
      it.printf(0, 0, id(roboto), "KinCony F24");</code></div></div> download yaml file: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/txt.png" title="Text Document" border="0" alt=".txt" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=6538" target="_blank" title="">F24-HA.txt</a> (Size: 18.55 KB / Downloads: 790)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
	</channel>
</rss>