From 95f9370302395fa14dd186985da5c9383dc53b30 Mon Sep 17 00:00:00 2001 From: Victor Alexandrovich Tsyrenschikov <77172321+tsyrenschikov@users.noreply.github.com> Date: Thu, 7 Aug 2025 22:18:20 +0500 Subject: [PATCH] EspHome --- config/test-kc868-a16.yaml | 114 +++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 config/test-kc868-a16.yaml diff --git a/config/test-kc868-a16.yaml b/config/test-kc868-a16.yaml new file mode 100644 index 0000000..13a5af3 --- /dev/null +++ b/config/test-kc868-a16.yaml @@ -0,0 +1,114 @@ +esphome: + name: test-kc868-a16 + friendly_name: Test-KC868-A16 + +esp32: + board: esp32dev + framework: + type: esp-idf + +# Enable logging +logger: + +# Enable Home Assistant API +api: + encryption: + key: "D/MuChEBR8XVbCR8SpQIml+bxj3Huh5tKlwLpZ1QqeU=" + +ota: + - platform: esphome + password: "df5a4ea7cc6a8b628f781e27751c43cf" + +# ethernet: +# type: LAN8720 +# mdc_pin: GPIO23 +# mdio_pin: GPIO18 +# clk_mode: GPIO17_OUT +# phy_addr: 0 +# use_address: 192.168.88.25 + +wifi: + # ssid: !secret wifi_ssid + # password: !secret wifi_password + ssid: "SmartHome" + password: "" + use_address: 192.168.88.172 + + manual_ip: + static_ip: 192.168.88.172 + gateway: 192.168.88.1 + subnet: 255.255.255.0 + + # 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 + +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 + +# Config Modbus +modbus: + uart_id: uart_modbus + id: modbus1 + +modbus_controller: + - id: modbus_sensor + address: 0x01 # device address + modbus_id: modbus1 + update_interval: 10s + +sensor: + - platform: modbus_controller + modbus_controller_id: modbus_sensor + name: "RS485 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 - 10000) * 0.1; + + + - platform: modbus_controller + modbus_controller_id: modbus_sensor + name: "RS485 Humidity Sensor" + id: humidity_sensor + address: 0x0002 + register_type: read + value_type: U_WORD + unit_of_measurement: "%" + accuracy_decimals: 1 + filters: + - multiply: 0.1 + + + +web_server: + port: 80 + auth: + username: "silver" + password: "cbvgcjy0" \ No newline at end of file