Code:
esphome:
name: device-191
friendly_name: Switch - TR House Hub 1
esp32:
variant: esp32
framework:
type: esp-idf
external_components:
- source:
type: git
url: https://github.com/hzkincony/esphome-kc868-ha
ref: v3.0.3
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "xxxxx"
reboot_timeout:
seconds: 120
ota:
- platform: esphome
password: "xxxxx"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
fast_connect: on
manual_ip:
static_ip: 172.16.5.191
gateway: 172.16.5.1
subnet: 255.255.255.0
dns1: 172.16.5.1
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Device-191 Fallback Hotspot"
password: "xxxxx"
captive_portal:
web_server:
port: 80
uart:
- id: rs485
tx_pin: GPIO13
rx_pin: GPIO16
baud_rate: 9600
i2c:
sda: GPIO4
scl: GPIO5
scan: True
id: bus_a
pcf8574:
- id: inputs_1_8
address: 0x22
- id: inputs_9_16
address: 0x21
- id: outputs_1_8
address: 0x24
- id: outputs_9_16
address: 0x25
kc686_ha:
binary_sensor:
### RS485 ###
### Master Bed INT ###
- platform: kc868_ha
target_relay_controller_addr: 1 # Default value is 1, corresponds to the Target Relay Controller Addr parameter in HA485_Ctrl software
switch_adapter_addr: 11 # Default value is 10, corresponds to the Switch Adapter Addr parameter in HA485_Ctrl software
bind_output: 1 # Corresponds to the BindOutput parameter in HA485_Ctrl software
name: "Master Bed Internal Button 1"
### Master Bed EXT ###
- platform: kc868_ha
target_relay_controller_addr: 1 # Default value is 1, corresponds to the Target Relay Controller Addr parameter in HA485_Ctrl software
switch_adapter_addr: 12 # Default value is 10, corresponds to the Switch Adapter Addr parameter in HA485_Ctrl software
bind_output: 7 # Corresponds to the BindOutput parameter in HA485_Ctrl software
name: "Master Bed External Button 1"
- platform: kc868_ha
target_relay_controller_addr: 1 # Default value is 1, corresponds to the Target Relay Controller Addr parameter in HA485_Ctrl software
switch_adapter_addr: 12 # Default value is 10, corresponds to the Switch Adapter Addr parameter in HA485_Ctrl software
bind_output: 8 # Corresponds to the BindOutput parameter in HA485_Ctrl software
name: "Master Bed External Button 2"
### Master WIR ###
- platform: kc868_ha
target_relay_controller_addr: 1 # Default value is 1, corresponds to the Target Relay Controller Addr parameter in HA485_Ctrl software
switch_adapter_addr: 13 # Default value is 10, corresponds to the Switch Adapter Addr parameter in HA485_Ctrl software
bind_output: 13 # Corresponds to the BindOutput parameter in HA485_Ctrl software
name: "Master WIR Button 1"
### Master Ensuite ###
- platform: kc868_ha
target_relay_controller_addr: 1 # Default value is 1, corresponds to the Target Relay Controller Addr parameter in HA485_Ctrl software
switch_adapter_addr: 14 # Default value is 10, corresponds to the Switch Adapter Addr parameter in HA485_Ctrl software
bind_output: 19 # Corresponds to the BindOutput parameter in HA485_Ctrl software
name: "Master Ensuite Button 1"
- platform: kc868_ha
target_relay_controller_addr: 1 # Default value is 1, corresponds to the Target Relay Controller Addr parameter in HA485_Ctrl software
switch_adapter_addr: 14 # Default value is 10, corresponds to the Switch Adapter Addr parameter in HA485_Ctrl software
bind_output: 20 # Corresponds to the BindOutput parameter in HA485_Ctrl software
name: "Master Ensuite Button 2"
- platform: kc868_ha
target_relay_controller_addr: 1 # Default value is 1, corresponds to the Target Relay Controller Addr parameter in HA485_Ctrl software
switch_adapter_addr: 14 # Default value is 10, corresponds to the Switch Adapter Addr parameter in HA485_Ctrl software
bind_output: 21 # Corresponds to the BindOutput parameter in HA485_Ctrl software
name: "Master Ensuite Button 3"
switch:
### RS485 ###
### Master INT ###
- platform: kc868_ha
target_relay_controller_addr: 1
switch_adapter_addr: 11
bind_output: 1
name: "Master Bed Internal Indicator 1"
### Master EXT ###
- platform: kc868_ha
target_relay_controller_addr: 1
switch_adapter_addr: 12
bind_output: 7
name: "Master Bed External Indicator 1"
- platform: kc868_ha
target_relay_controller_addr: 1
switch_adapter_addr: 12
bind_output: 8
name: "Master Bed External Indicator 2"
### Master WIR ###
- platform: kc868_ha
target_relay_controller_addr: 1
switch_adapter_addr: 13
bind_output: 13
name: "Master WIR Indicator 1"
### Master Ens ###
- platform: kc868_ha
target_relay_controller_addr: 1
switch_adapter_addr: 14
bind_output: 19
name: "Master Ensuite Indicator 1"
- platform: kc868_ha
target_relay_controller_addr: 1
switch_adapter_addr: 14
bind_output: 20
name: "Master Ensuite Indicator 2"
- platform: kc868_ha
target_relay_controller_addr: 1
switch_adapter_addr: 14
bind_output: 21
name: "Master Ensuite Indicator 3"