105 lines
2.2 KiB
YAML
105 lines
2.2 KiB
YAML
esphome:
|
|
name: tca6408-node
|
|
friendly_name: TCA6408 Node
|
|
|
|
esp32:
|
|
board: esp32-c5-devkitc-1 # Change to your board (or esp32dev for S3/C3)
|
|
framework:
|
|
type: esp-idf
|
|
|
|
# Enable logging
|
|
logger:
|
|
level: DEBUG
|
|
|
|
# WiFi & API (Home Assistant)
|
|
wifi:
|
|
ssid: !secret wifi_ssid
|
|
password: !secret wifi_password
|
|
|
|
api:
|
|
ota:
|
|
|
|
# ====================== I2C & TCA6408 ======================
|
|
i2c:
|
|
sda: GPIO2 # Adjust pins for your board
|
|
scl: GPIO3
|
|
scan: true
|
|
frequency: 400kHz
|
|
|
|
external_components:
|
|
- source:
|
|
type: git
|
|
url: https://github.com/DitroniX/Home-Assistant-Dev
|
|
ref: main
|
|
refresh: 0s #optional, how often to download fresh files from source, defaults to 1 day, use 0 to force updates
|
|
components: [ tca6408 ]
|
|
|
|
|
|
tca6408:
|
|
- id: tca6408_hub
|
|
address: 0x20 # Common default (0x20 - 0x27 depending on ADDR pins) DitroniX boards sometimes use 0x21 as default to avoid conflicts
|
|
interrupt_pin: GPIO6 # Recommended - connect to TCA6408 INT pin
|
|
|
|
# ====================== OUTPUTS (Switches) ======================
|
|
switch:
|
|
- platform: gpio
|
|
name: "TCA6408 Output 0"
|
|
id: tca_out0
|
|
pin:
|
|
tca6408: tca6408_hub
|
|
number: 0
|
|
mode: OUTPUT
|
|
|
|
- platform: gpio
|
|
name: "TCA6408 Output 1 (Relay)"
|
|
id: tca_out1
|
|
pin:
|
|
tca6408: tca6408_hub
|
|
number: 1
|
|
mode: OUTPUT
|
|
inverted: false
|
|
|
|
- platform: gpio
|
|
name: "TCA6408 Output 2"
|
|
id: tca_out2
|
|
pin:
|
|
tca6408: tca6408_hub
|
|
number: 2
|
|
mode: OUTPUT
|
|
|
|
# ====================== INPUTS (Binary Sensors) ======================
|
|
binary_sensor:
|
|
- platform: gpio
|
|
name: "TCA6408 Input 3 (Door Sensor)"
|
|
pin:
|
|
tca6408: tca6408_hub
|
|
number: 3
|
|
mode: INPUT
|
|
inverted: true # Use hardware polarity inversion if active-low
|
|
|
|
- platform: gpio
|
|
name: "TCA6408 Input 4 (Button)"
|
|
pin:
|
|
tca6408: tca6408_hub
|
|
number: 4
|
|
mode: INPUT
|
|
|
|
- platform: gpio
|
|
name: "TCA6408 Input 5"
|
|
pin:
|
|
tca6408: tca6408_hub
|
|
number: 5
|
|
mode: INPUT
|
|
inverted: false
|
|
|
|
- platform: gpio
|
|
name: "TCA6408 Input 6"
|
|
pin:
|
|
tca6408: tca6408_hub
|
|
number: 6
|
|
mode: INPUT
|
|
|
|
# Optional: Status LED or other outputs
|
|
status_led:
|
|
pin:
|
|
number: GPIO2 |