520 lines
9.7 KiB
YAML
520 lines
9.7 KiB
YAML
esphome:
|
|
name: kontroller-kocheg-a16
|
|
friendly_name: Kontroller_Kocheg_a16
|
|
|
|
esp32:
|
|
board: esp32dev
|
|
framework:
|
|
type: esp-idf
|
|
|
|
# Enable logging
|
|
logger:
|
|
|
|
# Enable Home Assistant API
|
|
api:
|
|
encryption:
|
|
key: "cjSokZz0SdHshCFIhZ2m/kz9nyKzVDhK4IP3GXeuPe4="
|
|
|
|
ota:
|
|
- platform: esphome
|
|
password: "b8cd17679860ec655bec01d924f92a91"
|
|
|
|
ethernet:
|
|
type: LAN8720
|
|
mdc_pin: GPIO23
|
|
mdio_pin: GPIO18
|
|
clk_mode: GPIO17_OUT
|
|
phy_addr: 0
|
|
use_address: 192.168.88.25
|
|
|
|
manual_ip:
|
|
static_ip: 192.168.88.25
|
|
gateway: 192.168.88.1
|
|
subnet: 255.255.255.0
|
|
|
|
# wifi:
|
|
# # ssid: !secret wifi_ssid
|
|
# # password: !secret wifi_password
|
|
# ssid: "SmartHome"
|
|
# password: ""
|
|
|
|
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
|
# ap:
|
|
# ssid: "Kc868-A16 Fallback Hotspot"
|
|
# password: "gCJlyJ5kec3y"
|
|
|
|
|
|
uart:
|
|
- id: uart_modbus
|
|
tx_pin: GPIO13
|
|
rx_pin: GPIO16
|
|
baud_rate: 9600
|
|
|
|
|
|
# Config Modbus
|
|
modbus:
|
|
uart_id: uart_modbus
|
|
id: modbus1
|
|
|
|
modbus_controller:
|
|
- id: modbus_sensor
|
|
address: 0x01 # device address
|
|
modbus_id: modbus1
|
|
update_interval: 10s
|
|
|
|
remote_receiver:
|
|
pin:
|
|
number: GPIO2
|
|
ignore_strapping_warning: true
|
|
|
|
remote_transmitter:
|
|
pin:
|
|
number: GPIO15
|
|
ignore_strapping_warning: true
|
|
carrier_duty_percent: 100%
|
|
|
|
i2c:
|
|
sda: GPIO4
|
|
scl:
|
|
number: GPIO5
|
|
ignore_strapping_warning: true
|
|
|
|
pcf8574:
|
|
- id: inputs_1_8
|
|
address: 0x22
|
|
pcf8575: false
|
|
- id: inputs_9_16
|
|
address: 0x21
|
|
pcf8575: false
|
|
- id: outputs_1_8
|
|
address: 0x24
|
|
pcf8575: false
|
|
- id: outputs_9_16
|
|
address: 0x25
|
|
pcf8575: false
|
|
|
|
|
|
one_wire:
|
|
- platform: gpio
|
|
pin: GPIO32
|
|
id: bus32
|
|
|
|
|
|
binary_sensor:
|
|
- platform: gpio
|
|
name: "KC868-A16-HT2"
|
|
pin:
|
|
number: GPIO33
|
|
inverted: true
|
|
|
|
|
|
- platform: gpio
|
|
name: "KC868-A16-HT3"
|
|
pin:
|
|
number: GPIO14
|
|
inverted: true
|
|
|
|
- platform: gpio
|
|
name: "input1_veranda_osv"
|
|
pin:
|
|
pcf8574: inputs_1_8
|
|
number: 0
|
|
mode: INPUT
|
|
inverted: true
|
|
on_press:
|
|
- switch.toggle: switch_output4
|
|
on_release:
|
|
- switch.toggle: switch_output4
|
|
|
|
- platform: gpio
|
|
name: "input2_veranda_stolb_krylco"
|
|
pin:
|
|
pcf8574: inputs_1_8
|
|
number: 1
|
|
mode: INPUT
|
|
inverted: true
|
|
on_press:
|
|
- switch.toggle: switch_output7
|
|
on_release:
|
|
- switch.toggle: switch_output7
|
|
|
|
- platform: gpio
|
|
name: "input3_veranda_osvechen"
|
|
pin:
|
|
pcf8574: inputs_1_8
|
|
number: 2
|
|
mode: INPUT
|
|
inverted: true
|
|
on_press:
|
|
- switch.toggle: switch_output6
|
|
on_release:
|
|
- switch.toggle: switch_output6
|
|
|
|
- platform: gpio
|
|
name: "input4_krylco_stolb"
|
|
pin:
|
|
pcf8574: inputs_1_8
|
|
number: 3
|
|
mode: INPUT
|
|
inverted: true
|
|
on_press:
|
|
- switch.toggle: switch_output7
|
|
on_release:
|
|
- switch.toggle: switch_output7
|
|
|
|
- platform: gpio
|
|
name: "input5_krylco_podsvetka"
|
|
pin:
|
|
pcf8574: inputs_1_8
|
|
number: 4
|
|
mode: INPUT
|
|
inverted: true
|
|
on_press:
|
|
- switch.toggle: switch_output6
|
|
on_release:
|
|
- switch.toggle: switch_output6
|
|
|
|
- platform: gpio
|
|
name: "input6_krylco_osv"
|
|
pin:
|
|
pcf8574: inputs_1_8
|
|
number: 5
|
|
mode: INPUT
|
|
inverted: true
|
|
on_press:
|
|
- switch.toggle: switch_output4
|
|
on_release:
|
|
- switch.toggle: switch_output4
|
|
|
|
- platform: gpio
|
|
name: "input7_veranda_rozetka"
|
|
pin:
|
|
pcf8574: inputs_1_8
|
|
number: 6
|
|
mode: INPUT
|
|
inverted: true
|
|
on_click:
|
|
if:
|
|
condition:
|
|
- switch.is_off: switch_output8
|
|
then:
|
|
- switch.turn_on: switch_output8
|
|
else:
|
|
- switch.turn_off: switch_output8
|
|
|
|
|
|
- platform: gpio
|
|
name: "input8_podval_osv"
|
|
pin:
|
|
pcf8574: inputs_1_8
|
|
number: 7
|
|
mode: INPUT
|
|
inverted: true
|
|
on_press:
|
|
- switch.toggle: switch_output3
|
|
on_release:
|
|
- switch.toggle: switch_output3
|
|
|
|
- platform: gpio
|
|
name: "input9_nasos"
|
|
pin:
|
|
pcf8574: inputs_9_16
|
|
number: 0
|
|
mode: INPUT
|
|
inverted: true
|
|
on_press:
|
|
- switch.toggle: switch_output2
|
|
on_release:
|
|
- switch.toggle: switch_output2
|
|
|
|
- platform: gpio
|
|
name: "input10_boiler"
|
|
pin:
|
|
pcf8574: inputs_9_16
|
|
number: 1
|
|
mode: INPUT
|
|
inverted: true
|
|
on_press:
|
|
- switch.toggle: switch_output1
|
|
on_release:
|
|
- switch.toggle: switch_output1
|
|
|
|
- platform: gpio
|
|
name: "KC868-A16-X11"
|
|
pin:
|
|
pcf8574: inputs_9_16
|
|
number: 2
|
|
mode: INPUT
|
|
inverted: true
|
|
|
|
- platform: gpio
|
|
name: "KC868-A16-X12"
|
|
pin:
|
|
pcf8574: inputs_9_16
|
|
number: 3
|
|
mode: INPUT
|
|
inverted: true
|
|
|
|
- platform: gpio
|
|
name: "KC868-A16-X13"
|
|
pin:
|
|
pcf8574: inputs_9_16
|
|
number: 4
|
|
mode: INPUT
|
|
inverted: true
|
|
|
|
- platform: gpio
|
|
name: "KC868-A16-X14"
|
|
pin:
|
|
pcf8574: inputs_9_16
|
|
number: 5
|
|
mode: INPUT
|
|
inverted: true
|
|
|
|
- platform: gpio
|
|
name: "KC868-A16-X15"
|
|
pin:
|
|
pcf8574: inputs_9_16
|
|
number: 6
|
|
mode: INPUT
|
|
inverted: true
|
|
|
|
- platform: gpio
|
|
name: "KC868-A16-X16"
|
|
pin:
|
|
pcf8574: inputs_9_16
|
|
number: 7
|
|
mode: INPUT
|
|
inverted: true
|
|
|
|
|
|
switch:
|
|
- platform: gpio
|
|
name: "Output01_podval_boiler"
|
|
id: switch_output1
|
|
pin:
|
|
pcf8574: outputs_1_8
|
|
number: 0
|
|
mode: OUTPUT
|
|
inverted: true
|
|
|
|
- platform: gpio
|
|
name: "Output02_podval_nasos"
|
|
id: switch_output2
|
|
pin:
|
|
pcf8574: outputs_1_8
|
|
number: 1
|
|
mode: OUTPUT
|
|
inverted: true
|
|
|
|
- platform: gpio
|
|
name: "Output03_podval_svet"
|
|
id: switch_output3
|
|
pin:
|
|
pcf8574: outputs_1_8
|
|
number: 2
|
|
mode: OUTPUT
|
|
inverted: true
|
|
|
|
- platform: gpio
|
|
name: "Output04_veranda_svet"
|
|
id: switch_output4
|
|
pin:
|
|
pcf8574: outputs_1_8
|
|
number: 3
|
|
mode: OUTPUT
|
|
inverted: true
|
|
|
|
- platform: gpio
|
|
name: "Output05_teplica"
|
|
id: switch_output5
|
|
pin:
|
|
pcf8574: outputs_1_8
|
|
number: 4
|
|
mode: OUTPUT
|
|
inverted: true
|
|
|
|
- platform: gpio
|
|
name: "Output06_podsvetka"
|
|
id: switch_output6
|
|
pin:
|
|
pcf8574: outputs_1_8
|
|
number: 5
|
|
mode: OUTPUT
|
|
inverted: true
|
|
|
|
- platform: gpio
|
|
name: "Output07_stolb"
|
|
id: switch_output7
|
|
pin:
|
|
pcf8574: outputs_1_8
|
|
number: 6
|
|
mode: OUTPUT
|
|
inverted: true
|
|
|
|
- platform: gpio
|
|
name: "Output08_rozetka"
|
|
id: switch_output8
|
|
pin:
|
|
pcf8574: outputs_1_8
|
|
number: 7
|
|
mode: OUTPUT
|
|
inverted: true
|
|
|
|
- platform: gpio
|
|
name: "Output09"
|
|
id: switch_output9
|
|
pin:
|
|
pcf8574: outputs_9_16
|
|
number: 0
|
|
mode: OUTPUT
|
|
inverted: true
|
|
|
|
- platform: gpio
|
|
name: "Output10"
|
|
id: switch_output10
|
|
pin:
|
|
pcf8574: outputs_9_16
|
|
number: 1
|
|
mode: OUTPUT
|
|
inverted: true
|
|
|
|
- platform: gpio
|
|
name: "Output11"
|
|
id: switch_output11
|
|
pin:
|
|
pcf8574: outputs_9_16
|
|
number: 2
|
|
mode: OUTPUT
|
|
inverted: true
|
|
|
|
- platform: gpio
|
|
name: "Output12"
|
|
id: switch_output12
|
|
pin:
|
|
pcf8574: outputs_9_16
|
|
number: 3
|
|
mode: OUTPUT
|
|
inverted: true
|
|
|
|
- platform: gpio
|
|
name: "Output13"
|
|
id: switch_output13
|
|
pin:
|
|
pcf8574: outputs_9_16
|
|
number: 4
|
|
mode: OUTPUT
|
|
inverted: true
|
|
|
|
- platform: gpio
|
|
name: "Output14"
|
|
id: switch_output14
|
|
pin:
|
|
pcf8574: outputs_9_16
|
|
number: 5
|
|
mode: OUTPUT
|
|
inverted: true
|
|
|
|
- platform: gpio
|
|
name: "Output15"
|
|
id: switch_output15
|
|
pin:
|
|
pcf8574: outputs_9_16
|
|
number: 6
|
|
mode: OUTPUT
|
|
inverted: true
|
|
|
|
- platform: gpio
|
|
name: "Output16"
|
|
id: switch_output16
|
|
pin:
|
|
pcf8574: outputs_9_16
|
|
number: 7
|
|
mode: OUTPUT
|
|
inverted: true
|
|
|
|
# substitutions:
|
|
# update_interval: 1s
|
|
|
|
sensor:
|
|
# - platform: adc
|
|
# pin: A0
|
|
# name: "Flame Detector QRB1"
|
|
# update_interval: 1s
|
|
# unit_of_measurement: "V"
|
|
# filters:
|
|
# # Опционально: инверсия или калибровка
|
|
# # Чем выше вольтаж, тем интенсивнее пламя
|
|
# - multiply: 1.0
|
|
|
|
- platform: ina219
|
|
address: 0x40
|
|
shunt_resistance: 0.1 ohm
|
|
current:
|
|
name: "INA219 Current"
|
|
unit_of_measurement: "A"
|
|
power:
|
|
name: "INA219 Power"
|
|
unit_of_measurement: "W"
|
|
filters:
|
|
- multiply: 10
|
|
bus_voltage:
|
|
name: "INA219 Bus Voltage"
|
|
unit_of_measurement: "V"
|
|
shunt_voltage:
|
|
name: "INA219 Shunt Voltage"
|
|
unit_of_measurement: "V"
|
|
max_voltage: 32.0V
|
|
max_current: 3.2A
|
|
update_interval: 1s
|
|
|
|
- platform: modbus_controller
|
|
modbus_controller_id: modbus_sensor
|
|
name: "Temperature Sensor"
|
|
id: temperature_sensor
|
|
address: 0x0001
|
|
# register_type: read
|
|
# value_type: U_WORD
|
|
# unit_of_measurement: "°C"
|
|
# accuracy_decimals: 1
|
|
# filters:
|
|
# - lambda: if (x < 10000) return x * 0.1; else return -1 * x * 0.0001;
|
|
unit_of_measurement: "°C"
|
|
register_type: read
|
|
value_type: S_WORD
|
|
accuracy_decimals: 1
|
|
filters:
|
|
- multiply: 0.1
|
|
|
|
|
|
|
|
- platform: modbus_controller
|
|
modbus_controller_id: modbus_sensor
|
|
name: "Humidity Sensor"
|
|
id: humidity_sensor
|
|
address: 0x0002
|
|
register_type: read
|
|
value_type: U_WORD
|
|
unit_of_measurement: "%"
|
|
accuracy_decimals: 1
|
|
filters:
|
|
- multiply: 0.1
|
|
|
|
- platform: dallas_temp
|
|
one_wire_id: bus32
|
|
name: "DS18B20"
|
|
update_interval: 30s
|
|
|
|
|
|
# web_server:
|
|
# port: 80
|
|
# auth:
|
|
# username: "silver"
|
|
# password: "cbvgcjy0"
|
|
|
|
mqtt:
|
|
broker: 192.168.88.4
|
|
username: 'miroca'
|
|
password: 'cbvgcjy0'
|
|
discovery: False # disable entity discovery
|
|
discover_ip: True # enable device discovery |