217 lines
3.9 KiB
YAML
217 lines
3.9 KiB
YAML
esphome:
|
|
name: ventilation
|
|
friendly_name: KC868-A6
|
|
|
|
esp32:
|
|
board: esp32dev
|
|
framework:
|
|
type: arduino
|
|
|
|
# Enable logging
|
|
logger:
|
|
|
|
# Enable Home Assistant API
|
|
api:
|
|
encryption:
|
|
key: "/Tq+moXS9oIsH4e7/QMtww6zqAdP23DCzeTaM+6KxdM="
|
|
|
|
ota:
|
|
- platform: esphome
|
|
password: "64c599445a6dddc9a3cfc44a1413086e"
|
|
|
|
wifi:
|
|
ssid: 'SmartHome'
|
|
password: ''
|
|
use_address: 192.168.88.192
|
|
|
|
manual_ip:
|
|
static_ip: 192.168.88.192
|
|
gateway: 192.168.88.1
|
|
subnet: 255.255.255.0
|
|
|
|
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
|
# ap:
|
|
# ssid: "Kc868-A6 Fallback Hotspot"
|
|
# password: "Eqh4eO1YIQUi"
|
|
|
|
uart:
|
|
#RS485
|
|
- id: uart_modbus
|
|
tx_pin: GPIO27
|
|
rx_pin: GPIO14
|
|
baud_rate: 9600
|
|
stop_bits: 1
|
|
|
|
|
|
#RS2332
|
|
- id: rs232
|
|
tx_pin: GPIO17
|
|
rx_pin: GPIO16
|
|
baud_rate: 9600
|
|
|
|
spi:
|
|
clk_pin: GPIO18
|
|
mosi_pin: GPIO23
|
|
miso_pin: GPIO19
|
|
# cs pin: GPIO5
|
|
|
|
modbus:
|
|
uart_id: uart_modbus
|
|
id: modbus1
|
|
|
|
modbus_controller:
|
|
- id: modbus_sensor
|
|
address: 0x01 # device address
|
|
modbus_id: modbus1
|
|
|
|
i2c:
|
|
sda: GPIO4
|
|
scl:
|
|
number: GPIO15
|
|
ignore_strapping_warning: true
|
|
|
|
pcf8574:
|
|
- id: inputs
|
|
address: 0x22
|
|
- id: outputs
|
|
address: 0x24
|
|
|
|
time:
|
|
- platform: ds1307
|
|
id: rtc_time
|
|
|
|
|
|
binary_sensor:
|
|
- platform: gpio
|
|
name: "KC868-A6-IN-1"
|
|
pin:
|
|
pcf8574: inputs
|
|
number: 0
|
|
mode: INPUT
|
|
inverted: true
|
|
- platform: gpio
|
|
name: "KC868-A6-IN-2"
|
|
pin:
|
|
pcf8574: inputs
|
|
number: 1
|
|
mode: INPUT
|
|
inverted: true
|
|
- platform: gpio
|
|
name: "KC868-A6-IN-3"
|
|
pin:
|
|
pcf8574: inputs
|
|
number: 2
|
|
mode: INPUT
|
|
inverted: true
|
|
- platform: gpio
|
|
name: "KC868-A6-IN-4"
|
|
pin:
|
|
pcf8574: inputs
|
|
number: 3
|
|
mode: INPUT
|
|
inverted: true
|
|
- platform: gpio
|
|
name: "KC868-A6-IN-5"
|
|
pin:
|
|
pcf8574: inputs
|
|
number: 4
|
|
mode: INPUT
|
|
inverted: true
|
|
- platform: gpio
|
|
name: "KC868-A6-IN-6"
|
|
pin:
|
|
pcf8574: inputs
|
|
number: 5
|
|
mode: INPUT
|
|
inverted: true
|
|
|
|
switch:
|
|
- platform: gpio
|
|
name: "KC868-A6-RELAY-1"
|
|
id: relay_1
|
|
pin:
|
|
pcf8574: outputs
|
|
number: 0
|
|
mode: OUTPUT
|
|
inverted: true
|
|
- platform: gpio
|
|
name: "KC868-A6-RELAY-2"
|
|
id: relay_2
|
|
pin:
|
|
pcf8574: outputs
|
|
number: 1
|
|
mode: OUTPUT
|
|
inverted: true
|
|
- platform: gpio
|
|
name: "KC868-A6-RELAY-3"
|
|
id: relay_3
|
|
pin:
|
|
pcf8574: outputs
|
|
number: 2
|
|
mode: OUTPUT
|
|
inverted: true
|
|
- platform: gpio
|
|
name: "KC868-A6-RELAY-4"
|
|
id: relay_4
|
|
pin:
|
|
pcf8574: outputs
|
|
number: 3
|
|
mode: OUTPUT
|
|
inverted: true
|
|
- platform: gpio
|
|
name: "KC868-A6-RELAY-5"
|
|
id: relay_5
|
|
pin:
|
|
pcf8574: outputs
|
|
number: 4
|
|
mode: OUTPUT
|
|
inverted: true
|
|
- platform: gpio
|
|
name: "KC868-A6-RELAY-6"
|
|
id: relay_6
|
|
pin:
|
|
pcf8574: outputs
|
|
number: 5
|
|
mode: OUTPUT
|
|
inverted: true
|
|
|
|
sensor:
|
|
- platform: modbus_controller
|
|
modbus_controller_id: modbus_sensor
|
|
name: "Temperature SHT30"
|
|
id: temperature_sensor
|
|
address: 0x0000
|
|
register_type: holding
|
|
value_type: U_WORD
|
|
unit_of_measurement: "°C"
|
|
accuracy_decimals: 1
|
|
filters:
|
|
- throttle_average: 1s
|
|
- lambda: if (x < 10000) return x * 0.1; else return -1 * (x - 10000) * 0.1;
|
|
# - throttle_average: ${update_interval}
|
|
|
|
- platform: modbus_controller
|
|
modbus_controller_id: modbus_sensor
|
|
name: "Humidity_SHT30"
|
|
id: humidity_sensor
|
|
address: 0x0001
|
|
register_type: holding
|
|
value_type: U_WORD
|
|
unit_of_measurement: "%"
|
|
accuracy_decimals: 1
|
|
filters:
|
|
- throttle_average: 1s
|
|
- multiply: 0.1
|
|
# - throttle_average: ${update_interval}
|
|
|
|
|
|
|
|
web_server:
|
|
port: 80
|
|
|
|
mqtt:
|
|
broker: 192.168.88.4
|
|
username: 'miroca'
|
|
password: 'cbvgcjy0'
|
|
discovery: False # disable entity discovery
|
|
discover_ip: True # enable device discovery |