Klar! Hier ist das yaml.
esphome:
name: heatpump
on_boot:
priority: -10
then:
- script.execute: restore_from_flash
esp32:
board: nodemcu-32s
framework:
type: arduino
# Enable logging
logger:
level: DEBUG
#Enable Home Assistant API
api:
ota:
- platform: esphome
password: ""
wifi:
# Priorisierte Liste Ihrer
WLAN-
Netzwerke
networks:
# 1. Haupt-WLAN
- ssid: ''
password: ''
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Aquarea Fallback Hotspot"
password: "YYjYHIEMxT6q"
captive_portal:
external_components:
# 1. Lokale Aquarea Komponente
- source:
type: local
path: ../custom_components
components: [ aquarea ]
# === Globals für die Speicherung im Flash ===
globals:
- id: g_heat_out_temp_low
type: float
restore_value: true
initial_value: "-15"
- id: g_heat_out_temp_high
type: float
restore_value: true
initial_value: "5"
- id: g_heat_water_temp_low
type: float
restore_value: true
initial_value: "35"
- id: g_heat_water_temp_high
type: float
restore_value: true
initial_value: "27"
- id: g_heat_off_out_temp
type: float
restore_value: true
initial_value: "17"
- id: g_heater_on_out_temp
type: float
restore_value: true
initial_value: "-15"
- id: g_cool_setpoint_temp
type: float
restore_value: true
initial_value: "18"
- id: g_tank_setpoint_temp
type: float
restore_value: true
initial_value: "50"
- id: g_shift_setpoint_temp
type: float
restore_value: true
initial_value: "0"
- id: g_quiet_mode
type: int
restore_value: true
initial_value: "0"
sensor:
- platform: wifi_signal
name: 'Heatpump wifi RSSI'
- platform: uptime
name: "Heatpump uptime"
- platform: aquarea
outside_temperature:
name: "Outside temperature"
outlet_temperature:
name: "Outlet temperature"
inlet_temperature:
name: "Inlet temperature"
tank_temperature:
name: "Tank temperature"
compressor_value:
name: "Heatpump compressor value"
id: hp_compressor
heat_power:
name: "Heat power"
id: hp_heat_power
unit_of_measurement: "W"
accuracy_decimals: 0
filters:
- sliding_window_moving_average:
window_size: 5
send_every: 1
cool_power:
name: "Cool power"
id: hp_cool_power
tank_power:
name: "Tank power"
id: hp_tank_power
pump_speed:
name: "Water pump speed"
text_sensor:
- platform: aquarea
error_code:
name: "Error code"
last_error_code:
name: "Last error code"
current_mode:
name: "Current operation mode"
id: hp_current_mode
- platform: template
name: "Heizung Betriebsstatus"
id: heatpump_state_combined
icon: "mdi:heat-pump"
update_interval: 10s
lambda: |-
auto compressor = id(hp_compressor).state;
auto heat_pwr = id(hp_heat_power).state;
auto cool_pwr = id(hp_cool_power).state;
auto tank_pwr = id(hp_tank_power).state;
auto defrost_on = id(hp_defrost).state;
auto mode = id(hp_current_mode).state;
std::string status = "Unbekannt";
// 1. Basis-Zustand ermitteln
if (mode == "off heat") {
status = "Aus";
} else if (defrost_on) {
status = "Abtauen";
} else if (compressor == 0) {
if (heat_pwr > 20 || cool_pwr > 20) status = "Umwälzen";
else if (tank_pwr > 0) status = "Warten auf Tank";
else status = "Standby";
} else if (compressor > 0) {
if (heat_pwr > 0) status = "Heizen";
else if (cool_pwr > 0) status = "Kühlen";
else if (tank_pwr > 0) status = "Speicherladung";
}
// 2. Quiet-Zusatz anhängen, falls aktiv
if (mode.find("quiet") != std::string::npos) {
status += " (Leise)";
}
return status;
binary_sensor:
- platform: aquarea
booster:
name: "Booster heater active"
defrost:
name: "Defrost active"
id: hp_defrost
- platform: template
name: "Heat Mode Active"
lambda: 'return (id(hp_current_mode).state == "on heat" || id(hp_current_mode).state == "on heat tank");'
button:
- platform: restart
name: "Heatpump restart"
id: hp_restart
- platform: aquarea
reset_error:
name: "Reset errors"
switch:
- platform: aquarea
force:
name: "Force operation"
- platform: template
name: "Bus-Sync (F-Serie)"
id: manual_rts_override
icon: "mdi:sync"
turn_on_action:
- logger.log: "ERZWINGE SENDEBEREITSCHAFT (10 SEKUNDEN)..."
- lambda: |-
pinMode(32, OUTPUT);
digitalWrite(32, HIGH); // Aktiviert Q3 -> gibt Sendezweig frei
- delay: 10s
- lambda: |-
digitalWrite(32, LOW);
- logger.log: "ZURÜCK IN DEN LESEMODUS."
- switch.turn_off: manual_rts_override
- platform: template
name: "Heatpump Quiet Mode"
id: quiet_mode_switch
icon: "mdi:volume-mute"
# Der Schalter leuchtet blau, wenn "quiet" im Text vorkommt
lambda: 'return id(hp_current_mode).state.find("quiet") != std::string::npos;'
turn_on_action:
- lambda: |-
uint8_t current_val = 3; // Standard: ON + HEAT
// Wenn wir gerade im Tank-Modus sind (Bit 16), Wert anpassen
if (id(hp_current_mode).state.find("tank") != std::string::npos) {
current_val = 19; // ON + HEAT + TANK
}
id(aq).write_queue.push({144, (uint8_t)(current_val + 64)}); // +64 setzt das Quiet-Bit
id(g_quiet_mode) = 1;
turn_off_action:
- lambda: |-
uint8_t current_val = 3; // Standard: ON + HEAT
if (id(hp_current_mode).state.find("tank") != std::string::npos) {
current_val = 19;
}
id(aq).write_queue.push({144, current_val}); // Sende ohne das Quiet-Bit
id(g_quiet_mode) = 0;
number:
- platform: aquarea
heat_out_temp_low:
name: "Low heat outside temperature"
id: n_heat_out_low
initial_value: -15
on_value:
then:
- globals.set: {id: g_heat_out_temp_low, value: !lambda 'return x;'}
heat_out_temp_high:
name: "High heat outside temperature"
id: n_heat_out_high
initial_value: 5
on_value:
then:
- globals.set: {id: g_heat_out_temp_high, value: !lambda 'return x;'}
heat_water_temp_low:
name: "Low heat water temperature"
id: n_heat_water_low
initial_value: 35
on_value:
then:
- globals.set: {id: g_heat_water_temp_low, value: !lambda 'return x;'}
heat_water_temp_high:
name: "High heat water temperature"
id: n_heat_water_high
initial_value: 27
on_value:
then:
- globals.set: {id: g_heat_water_temp_high, value: !lambda 'return x;'}
heat_off_out_temp:
name: "Heat off outside temperature"
id: n_heat_off_temp
initial_value: 15
on_value:
then:
- globals.set: {id: g_heat_off_out_temp, value: !lambda 'return x;'}
heater_on_out_temp:
name: "Heater On outside temperature"
id: n_heater_on_temp
initial_value: -6
on_value:
then:
- globals.set: {id: g_heater_on_out_temp, value: !lambda 'return x;'}
cool_setpoint_temp:
name: "Cool setpoint temperature"
id: n_cool_setpoint
initial_value: 18
on_value:
then:
- globals.set: {id: g_cool_setpoint_temp, value: !lambda 'return x;'}
tank_setpoint_temp:
name: "Tank setpoint temperature"
id: n_tank_setpoint
initial_value: 50
on_value:
then:
- globals.set: {id: g_tank_setpoint_temp, value: !lambda 'return x;'}
shift_setpoint_temp:
name: "Shift setpoint temperature"
id: n_shift_setpoint
initial_value: 0
on_value:
then:
- globals.set: {id: g_shift_setpoint_temp, value: !lambda 'return x;'}
select:
- platform: aquarea
request_mode:
name: "Request mode"
options:
- "off heat"
- "on heat"
- "on cool"
- "on tank"
- "on heat tank"
- "on cool tank"
# === Wiederherstellungs-Script ===
script:
- id: restore_from_flash
then:
- delay: 8s
- logger.log: "--- START: Synchronisiere Werte mit Geisha ---"
- logger.log: "Setze
Heizkurve..."
- number.set: {id: n_heat_out_low, value: !lambda 'return id(g_heat_out_temp_low);'}
- delay: 800ms
- number.set: {id: n_heat_out_high, value: !lambda 'return id(g_heat_out_temp_high);'}
- delay: 800ms
- logger.log: "Setze
Wassertemperaturen..."
- number.set: {id: n_heat_water_low, value: !lambda 'return id(g_heat_water_temp_low);'}
- delay: 800ms
- number.set: {id: n_heat_water_high, value: !lambda 'return id(g_heat_water_temp_high);'}
- delay: 800ms
- logger.log: "Setze Off-Temp und Heater..."
- number.set: {id: n_heat_off_temp, value: !lambda 'return id(g_heat_off_out_temp);'}
- delay: 800ms
- number.set: {id: n_heater_on_temp, value: !lambda 'return id(g_heater_on_out_temp);'}
- delay: 800ms
- logger.log: "Setze Sollwerte (Tank/Cool/Shift)..."
- number.set: {id: n_cool_setpoint, value: !lambda 'return id(g_cool_setpoint_temp);'}
- delay: 800ms
- number.set: {id: n_tank_setpoint, value: !lambda 'return id(g_tank_setpoint_temp);'}
- delay: 800ms
- number.set: {id: n_shift_setpoint, value: !lambda 'return id(g_shift_setpoint_temp);'}
- logger.log: "--- SYNC BEENDET ---"
uart:
tx_pin:
number: GPIO27
rx_pin:
number: GPIO26
baud_rate: 960
data_bits: 8
stop_bits: 1
parity: EVEN
rx_buffer_size: 1024
aquarea:
id: aq
rts_pin: GPIO32