Update README.md

This commit is contained in:
Dave Williams | DitroniX | G8PUO
2026-06-13 08:47:38 +01:00
parent 6b3f196d62
commit 0baef02817
+57 -1
View File
@@ -11,9 +11,65 @@ Full-featured custom component for the **TCA6408** 8-bit I
- Polling fallback mode
- Compatible with ESP32 (including C3/C5/C6), ESP8266, etc.
The INT pin on TCA6408 is open-drain active-low — connect a pull-up resistor (or use internal pull-up on ESP).
## Installation
1. Download or clone this component into your ESPHome project:
```bash
mkdir -p custom_components
cp -r TCA6408/custom_components/tca6408 custom_components/
cp -r TCA6408/custom_components/tca6408 custom_components/
## Basic Configuration
i2c:
sda: GPIO4
scl: GPIO5
scan: true
frequency: 400kHz
custom_components:
- source:
type: local
path: custom_components/tca6408
tca6408:
- id: tca6408_hub
address: 0x20 # Default: 0x20 (0x200x27 depending on ADDR pins)
interrupt_pin: GPIO6 # Recommended for fast input response
## Example: Outputs (Switches)
switch:
- platform: gpio
name: "TCA6408 Output 0"
pin:
tca6408: tca6408_hub
number: 0
mode: OUTPUT
- platform: gpio
name: "TCA6408 Relay (Active Low)"
pin:
tca6408: tca6408_hub
number: 1
mode: OUTPUT
inverted: true
## Example: Inputs (Binary Sensors) with Interrupt
binary_sensor:
- platform: gpio
name: "Door Sensor"
pin:
tca6408: tca6408_hub
number: 3
mode: INPUT
inverted: true # Uses hardware polarity inversion
- platform: gpio
name: "Push Button"
pin:
tca6408: tca6408_hub
number: 4
mode: INPUT