Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
KC868-A6v3 ESPHome yaml for home assistant
#4
Could you check if my code, added to your code for this board, is causing any Wi-Fi issues?

In the ESP32 version, it caused a Wi-Fi conflict and wouldn't connect to Home Assistant. You can adapt the pins to the ESP32 S3 board.

Thanks for checking.

uart:
rx_pin: 1
tx_pin: 3
baud_rate: 9600

modbus:

one_wire:
#Zółty przewód
- platform: gpio
id: Rekuperator
pin: 18
#Pomarańczowy przewód
- platform: gpio
id: Nagrzewnica
pin: 17


time:
- platform: homeassistant
id: esp_time
on_time:
- seconds: 1
minutes: 0
hours: 0
then:
- lambda: |-
id(daily_energy_total) = 0.0;
# id(last_pzem_energy) = id(PC_PkWh).state;

# Reset miesięcznego zużycia pierwszego dnia miesiąca o 00:00:01
- seconds: 1
minutes: 0
hours: 0
days_of_month: 1
then:
- lambda: |-
id(monthly_energy_total) = 0.0;
# id(last_pzem_energy) = id(PC_PkWh).state;

- platform: sntp
id: sntp_time
timezone: Europe/Warsaw
servers:
- 0.pl.pool.ntp.org
- 1.pl.pool.ntp.org
- 2.pl.pool.ntp.org

sensor:
- platform: template
name: "Czas od ostatniego włączenia"
id: time_since_last_on
accuracy_decimals: 0
unit_of_measurement: "min"
update_interval: 1s
lambda: |-
auto now = id(esp_time).now().timestamp;
if (id(last_on_time) == 0) {
return 0;
} else {
return (now - id(last_on_time)) / 60;
}
- platform: template
name: "Dzienne zużycie energii"
id: daily_energy
unit_of_measurement: "kWh"
accuracy_decimals: 2
update_interval: 1s
lambda: |-
return id(daily_energy_total) / 1000.0;

# Miesięczny licznik energii
- platform: template
name: "Miesięczne zużycie energii"
id: monthly_energy
unit_of_measurement: "kWh"
accuracy_decimals: 2
update_interval: 1s
lambda: |-
return id(monthly_energy_total) / 1000.0;
- platform: template
name: "Podniesienie temperatury przez GWC"
id: gwc_delta_temp
unit_of_measurement: "°C"
accuracy_decimals: 1
lambda: |-
// Jeśli GWC Powietrze jest włączone, zwróć 0
if (id(Pozycja_GWC_Powietrze).state) {
return 0.0;
}

// Jeśli GWC Ziemia nie jest włączone, zwróć 0 (opcjonalne zabezpieczenie)
if (!id(Pozycja_GWC_Ziemia).state) {
return 0.0;
}
return id(CZ).state - id(temperatura_zew_HA).state;
update_interval: 15s

- platform: template
name: "Koszt całkowity"
id: koszt_calkowity
accuracy_decimals: 2
lambda: |-
// Pobierz wartość zużycia energii
float A = id(PC_PkWh).state;
// Oblicz koszt całkowity
return A * 1.0;
unit_of_measurement: "PLN"

- platform: wifi_signal
name: "Moc sygnału Wi-Fi"
update_interval: 60s # Aktualizacja co minutę
id: wifi_signal_sensor
# MODUŁ PZEM 004 T MIERNIK ENERGII
- platform: pzemac
id: pzemac1
current:
name: "PZEM-004T V3 Current"
id: "PC_J"
voltage:
name: "PZEM-004T V3 Voltage"
id: "PC_V"
energy:
name: "PZEM-004T V3 Energy"
id: "PC_P"
unit_of_measurement: Wh
power:
name: "PZEM-004T V3 Power"
id: "PC_W"
unit_of_measurement: W
frequency:
name: "PZEM-004T V3 Frequency"
id: "PC_Freq"
power_factor:
name: "PZEM-004T V3 Power Factor"
update_interval: 1s

- platform: pzemac
energy:
name: "PZEM-004T V3 Energy kWh"
id: "PC_PkWh"
unit_of_measurement: kWh
filters:
# Multiplication factor from Wh to kWh is 0.001
- multiply: 0.001
power:
name: "PZEM-004T V3 Power kWh"
id: "PC_WkWh"
unit_of_measurement: kW
filters:
# Multiplication factor from Wh to kWh is 0.001
- multiply: 0.001
update_interval: 1s

- platform: dht
model: AUTO_DETECT
pin: 15
temperature:
id: Temperatura
name: "Tstrych"
humidity:
id: Wilgotnosc
name: "Wstrych"
update_interval: 15min

# CZUJNIK TEMPERATURY REKUPERATOR
- platform: dallas_temp
one_wire_id: Rekuperator
address: 0x0900000083a04028
id: CZ
name: "Czerpnia"
accuracy_decimals: 1
update_interval: 15s
filters:
multiply: 1.05

- platform: dallas_temp
one_wire_id: Rekuperator
address: 0x350000006a8f2628
id: NW
name: "Nawiew"
accuracy_decimals: 1
update_interval: 15s
filters:
multiply: 0.99

- platform: dallas_temp
one_wire_id: Rekuperator
address: 0xdf00000085c2fd28
id: WYC
name: "Wyciag"
accuracy_decimals: 1
update_interval: 15s
filters:
multiply: 1.04

- platform: dallas_temp
one_wire_id: Rekuperator
address: 0xe200000069f46728
id: WYRZ
name: "Wyrzutnia"
accuracy_decimals: 1
update_interval: 15s
filters:
multiply: 1.05
#CZUJNIK TEMPERATURY NAGRZEWNICY
- platform: dallas_temp
one_wire_id: Nagrzewnica
address: 0xde0000008300b928
id: GZ
name: "GZ"
accuracy_decimals: 1
update_interval: 15s
filters:
multiply: 0.99

- platform: dallas_temp
one_wire_id: Nagrzewnica
address: 0x5200000083035c28
id: GP
name: "GP"
accuracy_decimals: 1
update_interval: 15s
filters:
multiply: 1.01

- platform: dallas_temp
one_wire_id: Nagrzewnica
address: 0xc000000082fc1428
id: TPN
name: "Teperatura Nawiew"
accuracy_decimals: 1
update_interval: 15s
filters:
multiply: 0.993

- platform: dallas_temp
one_wire_id: Nagrzewnica
address: 0x170000008807d328
id: TW
name: "Temperatura Wywiew"
accuracy_decimals: 1
update_interval: 15s

- platform: dallas_temp
one_wire_id: Nagrzewnica
address: 0x93000000854b3828
id: TK
name: "Temperatura Kompresor"
accuracy_decimals: 1
update_interval: 15s
filters:
multiply: 0.99
Reply


Messages In This Thread
RE: KC868-A6v3 ESPHome yaml for home assistant - by strzegus - 07-27-2025, 06:15 PM

Forum Jump:


Users browsing this thread:
1 Guest(s)