Files
Ofensteuerung/esphome/ofensteuerung.yaml
T

230 lines
6.0 KiB
YAML

# Ofensteuerung auf der Platine pcb/ (v1.0)
# D0/GPIO16 Relais K1 (230-V-Pumpe, Schließer) - Thermostat an J4 liegt parallel zum Kontakt
# D1/GPIO5 SCL, D2/GPIO4 SDA -> ADS1115 (0x48): A0-A1 = Stromwandler ZMCT103C (Bürde 100 R, Mitte 1,65 V)
# D5/GPIO14 SCK, D6/GPIO12 SO, D8/GPIO15 CS -> MAX6675 (Abgas, Thermoelement Typ K)
# D4/GPIO2 1-Wire, 3x DS18B20 (J5-J7, 4k7 Pull-up)
# TX/GPIO1 Servo MG996R (Zuluftklappe, 330 R in Serie; kein Boot-Pin, logger baud_rate 0)
# D7/GPIO13 PWM-Pumpe (Transistorstufe wie Umwälzpumpe), RX/GPIO3 Rückmeldung
# frei auf J10: A0, D3/GPIO0 (Boot-Pin), ADS1115 A2/A3
substitutions:
name: ofensteuerung
esphome:
name: ${name}
friendly_name: Ofensteuerung
esp8266:
board: d1_mini
restore_from_flash: true
logger:
level: INFO
baud_rate: 0 # RX/GPIO3 = Rückmeldung PWM-Pumpe
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
reboot_timeout: 15min
ap:
ssid: "Ofensteuerung Fallback"
captive_portal:
api:
reboot_timeout: 0s
encryption:
key: !secret api_key
mqtt:
broker: 192.168.179.24
port: 1883
username: ramiro
password: !secret mqtt_password
topic_prefix: gunter/ofensteuerung
reboot_timeout: 0s
discovery: true
log_topic: null
birth_message:
topic: gunter/ofensteuerung/status
payload: online
will_message:
topic: gunter/ofensteuerung/status
payload: offline
ota:
- platform: esphome
password: !secret ota_password
web_server:
port: 80
i2c:
sda: GPIO4 # D2
scl: GPIO5 # D1
scan: true
frequency: 400kHz
spi:
clk_pin: GPIO14 # D5
miso_pin: GPIO12 # D6
one_wire:
- platform: gpio
pin: GPIO2 # D4
ads1115:
- address: 0x48
continuous_mode: true
# ---------------- Pumpe 230 V ----------------
switch:
- platform: gpio
pin: GPIO16 # D0 -> BC546B -> K1
name: "Pumpe Relais"
id: pumpe_relais
restore_mode: RESTORE_DEFAULT_OFF
icon: mdi:pump
# ---------------- Luftklappe (Servo MG996R) ----------------
output:
- platform: esp8266_pwm
id: klappe_pwm
pin: GPIO1 # TX (Servo; UART aus, logger baud_rate: 0)
frequency: 50 Hz
- platform: esp8266_pwm
id: pump_pwm
pin: GPIO13 # D7
frequency: 1000 Hz
inverted: false # Stufe invertiert: Klemmen-Duty = 1 - power (VTS/AMG Profil H)
min_power: 0.16
max_power: 0.93
zero_means_zero: true
servo:
- id: klappe_servo
output: klappe_pwm
min_level: 3% # ~0,6 ms -> ggf. an Klappenanschlag anpassen
max_level: 12% # ~2,4 ms
transition_length: 4s
auto_detach_time: 3s # danach kein Haltestrom/Brummen; Klappe hält per Getriebe
number:
- platform: template
name: "Pumpe Faktor W pro A"
id: pumpe_w_pro_a
min_value: 50
max_value: 230
step: 1
initial_value: 115
optimistic: true
restore_value: true
entity_category: config
icon: mdi:tune
- platform: template
name: "Luftklappe"
id: luftklappe
unit_of_measurement: "%"
min_value: 0
max_value: 100
step: 1
optimistic: true
restore_value: true
initial_value: 50
icon: mdi:valve
set_action:
- servo.write:
id: klappe_servo
level: !lambda 'return x / 50.0f - 1.0f;' # 0..100 % -> -1..+1
# ---------------- PWM-Pumpe (optional) ----------------
fan:
- platform: speed
output: pump_pwm
name: "PWM-Pumpe"
id: pwm_pumpe
restore_mode: RESTORE_DEFAULT_ON
sensor:
# Pumpenstrom über ZMCT103C: 1 A primär = 1 mA sekundär = 100 mV an der Bürde
- platform: ads1115
multiplexer: A0_A1
gain: 0.256 # +-256 mV -> bis ca. 1,8 A eff.
id: ct_spannung
sample_rate: 860
update_interval: never
internal: true
- platform: ct_clamp
sensor: ct_spannung
name: "Pumpe Strom"
id: pumpe_strom
sample_duration: 400ms
update_interval: 5s
unit_of_measurement: A
accuracy_decimals: 3
filters:
- multiply: 10.0 # V an 100 R -> A primär
- lambda: 'return x < 0.015f ? 0.0f : x;'
- platform: template
name: "Pumpe Leistung (geschätzt)"
unit_of_measurement: W
device_class: power
accuracy_decimals: 0
update_interval: 5s
# Wirkleistung = Strom x Faktor (W/A). Faktor einmal mit Shelly einmessen: Shelly-Watt / "Pumpe Strom".
# Ohne Einmessung 230 V x cos phi 0,5 (typisch für EC-Hocheffizienzpumpen ohne PFC).
lambda: 'return id(pumpe_strom).state * id(pumpe_w_pro_a).state;'
- platform: max6675
cs_pin: GPIO15 # D8 (10k Pull-down auf der Platine)
name: "Abgastemperatur"
id: abgas
update_interval: 5s
filters:
- sliding_window_moving_average: {window_size: 3, send_every: 1}
# DS18B20 an J5/J6/J7 (ein Bus). Nach dem ersten Start die Adressen aus dem Log eintragen
# und index durch address: 0x... ersetzen, sonst können die Fühler die Reihenfolge tauschen.
- platform: dallas_temp
name: "Temperatur 1"
index: 0
update_interval: 10s
- platform: dallas_temp
name: "Temperatur 2"
index: 1
update_interval: 10s
- platform: dallas_temp
name: "Temperatur 3"
index: 2
update_interval: 10s
- platform: duty_cycle
pin:
number: GPIO3 # RX
mode: INPUT
name: "PWM-Pumpe Rückmeldung"
update_interval: 5s
accuracy_decimals: 0
- platform: wifi_signal
name: "WLAN Signal"
update_interval: 60s
- platform: uptime
name: "Uptime"
binary_sensor:
- platform: template
name: "Pumpe läuft"
device_class: running
lambda: 'return id(pumpe_strom).state > 0.03f;'
- platform: template
name: "Pumpe läuft über Thermostat"
lambda: 'return id(pumpe_strom).state > 0.03f && !id(pumpe_relais).state;'
- platform: template
name: "Pumpe Störung" # Relais an, aber kein Strom (Sicherung, Pumpe, Kabel)
device_class: problem
lambda: 'return id(pumpe_relais).state && id(pumpe_strom).state < 0.03f;'
filters:
- delayed_on: 20s
- platform: status
name: "Status"