HERMES ELECTRONIC WR3223 ventilation controller ESP32

Hello @mcweis,

Sorry for the long absence.

In the last update I added some commands for testing. (SP, Re, Rd and Es)
There is no sensor component connected to these 4. The “Failed” output is misleading because they didn’t fail, they just couldn’t process the data received from the WR3223 to publish them for HomeAssistant. (The received value is displayed at the end of the line ‘Data: xxx’).

All known commands can be found in wr3223_commands.h.
You can add them as standard commands that will be executed every cycle (the interval is at most 20 seconds or less).
Adding or deleting is possible in the commandPair array in wr3223_controller.h (from line 73). You need to adjust the cmdPairCount to the number of commands in the array on line 72 when changing the amount. This allows you to test all commands and the values ​​received by the WR3223.

Here are the explanations for the 4 commands:

// Zuluftsoll Temperatur auslesen/schreiben (nur bei PC Steuerung) 
    static constexpr const char *SP = "SP";

    // Zulufttemperatur Sollwert
    static constexpr const char *Re = "Re";

    // Raumsollwert 
    static constexpr const char *Rd = "Rd";

    // Schaltpunkt Sommer stopp lesen/schreiben 
    static constexpr const char *Es = "Es";

Best Regards

I found some interesting documents (not from Schwoerer, but about a WR3223):
PDF

Chapter 3.7: In summer operation, the device bypass flap opens depending on the operating status
Outdoor air and indoor temperature

Problem:
The sensor for detecting the room temperature is located in the
Control unit.

BUT: Chapter 2.3:
Alternatively, you can also connect an external sensor
possible in another room.

I think that it will be possible to control the bypass if we manage to add an external temperature sensor.

1 Like

Hi,
that would be awesome.

Can’t we just forward a temperature sensor over the esp?

Edit: Your link is broken, I get an this page is not availible error

Thanks, I corrected the link.

That would theoretically be the easiest. But I wouldn’t know how. The actual control takes place within the WR3223. So far I haven’t seen a way in which the temperature information can be written. The sensors are currently connected directly to the WR3223 and the ESP reads out the various information via commands to the WR3223. (cmd T1 - T8).

It looks like the interior temperature is necessary in order to ‘automatically’ switch the heat pump and additional heater via the WR3223 in winter operation. The inside temperature information is also necessary so that the bypass is opened in summer operation.

According to this document, an alternative temperature sensor can be used. It also seems to be possible to open the bypass for testing purposes when the safety switch is pressed. Maybe that would be another approach.

There is a circuit diagram on page 32.

In my case, T2 is already connected to 9a/b. But 10a/b is free. :thinking:

1 Like

Here’s a little update:
Unfortunately, it does not seem to be possible to connect another (external) sensor with this version of the WR3223.

I think I’ll just add a relay to control the bypass directly.

1 Like

Hello Schmurgel,
Have you summarized the files anywhere? I also want to control my WGT with HA.
Thank you very much in advance!

First of all, thank you for developing the solution! I hope that I can finally integrate my ventilation system into Home Assistant.

I have been trying for a few days to connect my WR3223 controller (Schwörer WRG 400 BP) to Home Assistant using the ESP solution. Unfortunately I still haven’t managed it, I always get this error message:

[17:01:21]rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[17:01:21]configsip: 0, SPIWP:0xee
[17:01:21]clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
[17:01:21]mode:DIO, clock div:2
[17:01:21]load:0x3fff0030,len:1184
[17:01:21]load:0x40078000,len:13132
[17:01:21]load:0x40080400,len:3036
[17:01:21]entry 0x400805e4
[17:01:21][I][logger:156]: Log initialized
[17:01:21][C][safe_mode:079]: There have been 0 suspected unsuccessful boot attempts
[17:01:21][D][esp32.preferences:114]: Saving 1 preferences to flash...
[17:01:21][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[17:01:21][W][app:022]: Component custom_component already registered! (0x3ffb2a50)
[17:01:21][I][app:029]: Running through setup()...
[17:01:21][C][uart.arduino_esp32:077]: Setting up UART...
[17:01:21][D][template.switch:046]: Restored state OFF
[17:01:21][D][switch:016]: 'Zusatzheizung' Turning OFF.
[17:01:21][D][template.switch:046]: Restored state OFF
[17:01:21][D][switch:016]: 'Wärmepumpe' Turning OFF.
[17:01:21][D][template.switch:046]: Restored state OFF
[17:01:21][D][switch:016]: 'Kühlung' Turning OFF.
[17:01:21][E][WRITER:248]: WRITE: 33
[17:01:21][E][WRITER:249]: Data Length: 2
[17:01:21][E][WRITER:250]: COMMAND: SW
[17:01:21][E][WRITER:275]: Data to Write: :04:30:30:31:31:02:53:57:33:33:03:07
[17:01:21][E][WRITER:280]: Bedienteil ist aktiv, kein schreiben möglich
[17:01:21][C][wifi:048]: Setting up WiFi...
[17:01:21][C][wifi:061]: Starting WiFi...
[17:01:21][C][wifi:062]: Local MAC: B0:B2:1C:FF:8C:D0
[17:01:21][D][wifi:482]: Starting scan...
[17:01:21][D][number:012]: 'Update Interval': Sending state 10.000000
[17:01:21][I][START:385]: Command: LS
[17:01:22][D][Reader:044]: Warte auf Antwort von WR3223. Timeout in 5000ms.
…….
…….
[17:01:26][D][Reader:044]: Warte auf Antwort von WR3223. Timeout in 101ms.
[17:01:26]E (10821) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
[17:01:26]E (10821) task_wdt: - loopTask (CPU 1)
[17:01:26]E (10821) task_wdt: Tasks currently running:
[17:01:26]E (10821) task_wdt: CPU 0: IDLE
[17:01:26]E (10821) task_wdt: CPU 1: IDLE
[17:01:26]E (10821) task_wdt: Aborting.
[17:01:26]
[17:01:26]abort() was called at PC 0x40101c24 on core 0
[17:01:26]
[17:01:26]
[17:01:26]Backtrace:0x40083899:0x3ffbe9bc |<-CORRUPTED
[17:01:26]
[17:01:26]
[17:01:26]
[17:01:26]
[17:01:26]ELF file SHA256: 0000000000000000
[17:01:26]
[17:01:26]Rebooting...
[17:01:26]ets Jun 8 2016 00:22:57

I am surprised that the error message doesn’t change regardless of whether I have connected the TTL port of the control unit or not. In any case, the “control unit” isn’t connected.

My previous troubleshooting consisted of:

  • Used three different ESPs (BerryBase NMUC-ESP32, AZ-Delivery ESP32-WROOM-32 and AZ-Delivery ESP32S)

  • Swapped the cables to the TTL port

  • Tried various GPIO ports

  • Flash ESP via WLAN and via web.esphome.io

I just don’t know how to proceed. What am I doing wrong or where could the error be?

Does anyone have any idea what the problem could be or what the error “WRITE:33” refers to? I am grateful for any help.

Hi Stekolos,

Thanks for sharing how you could make it work. Unfortunately I am still facing the issue of my ESP32 not willing to connect to HA, even though it connects to Wifi and I can ping it.

This is the warning I am getting, sometimes it has a different content, but basically it shows as offline in HA.
OTA updates are feasible and the moment I change the YAML file back to the original content which it had when I set it up for first use from within HA, it hooks up to HA perfectly fine.

I have realized, that when I take out the “baud_rate: 0” command, that it seems to at least show some signs of life and I can read out the log file from the web appplication, but still it won’t show as online in HA.

I would appreciate any input from someone who faced the same issues.
My ESP is from AZ-Delivery (KitC V2 ESP32-WROOM-32)

WARNING Can't connect to ESPHome API for wr3223-lueftungsanlage @ 192.168.178.56: Error connecting to [AddrInfo(family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 1>, proto=6, sockaddr=IPv4Sockaddr(address='192.168.178.56', port=6053))]: [Errno 111] Connect call failed ('192.168.178.56', 6053) (SocketAPIError)
INFO Trying to connect to wr3223-lueftungsanlage @ 192.168.178.56 in the background

Here is some part of the logging which I was able to do while it was hooked up to my PC using web.esphome.io (I cannot flash the ESP from within HA as I don’t use https to show the dashboard).
What I realize is, that is takes 10 boot loops before it actually connects to Wifi. Then, after about 5 minutes, the whole boot loop starts again.

[22:51:07][C][esphome.ota:073]: Over-The-Air updates:
[22:51:07][C][esphome.ota:074]:   Address: 192.168.178.56:3232
[22:51:07][C][esphome.ota:075]:   Version: 2
[22:51:07][C][safe_mode:018]: Safe Mode:
[22:51:07][C][safe_mode:020]:   Boot considered successful after 60 seconds
[22:51:07][C][safe_mode:021]:   Invoke after 10 boot attempts
[22:51:07][C][safe_mode:023]:   Remain in safe mode for 300 seconds
[22:51:07][W][safe_mode:031]: SAFE MODE IS ACTIVE
[22:51:54][I][safe_mode:041]: Boot seems successful; resetting boot loop counter
[22:51:54][D][esp32.preferences:114]: Saving 1 preferences to flash...
[22:51:54][D][esp32.preferences:143]: Saving 1 preferences to flash: 1 cached, 0 written, 0 failed
[22:55:54][W][safe_mode:091]: Safe mode enable time has elapsed -- restarting
[22:55:54][I][app:125]: Forcing a reboot...
[22:55:54][W][wifi_esp32:537][arduino_events]: Event: Disconnected ssid='FRITZ!Box Fon WLAN 7270-B' bssid=[redacted] reason='Association Leave'
[22:55:54]ets Jul 29 2019 12:21:46
[22:55:54]
[22:55:54]rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[22:55:54]configsip: 0, SPIWP:0xee
[22:55:54]clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
[22:55:54]mode:DIO, clock div:2
[22:55:54]load:0x3fff0030,len:1184
[22:55:54]load:0x40078000,len:13132
[22:55:54]load:0x40080400,len:3036
[22:55:54]entry 0x400805e4
[22:55:54][I][logger:156]: Log initialized
[22:55:54][C][safe_mode:079]: There have been 0 suspected unsuccessful boot attempts
[22:55:54][D][esp32.preferences:114]: Saving 1 preferences to flash...
[22:55:54][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[22:55:54][W][app:022]: Component custom_component already registered! (0x3ffb2a84)
[22:55:55][I][app:029]: Running through setup()...
[22:55:55][C][uart.arduino_esp32:077]: Setting up UART...
[22:55:55][D][template.switch:046]:   Restored state OFF
[22:55:55][D][switch:016]: 'Zusatzheizung' Turning OFF.
[22:55:55][D][template.switch:046]:   Restored state OFF
[22:55:55][D][switch:016]: 'Wärmepumpe' Turning OFF.
[22:55:55][D][template.switch:046]:   Restored state OFF
[22:55:55][D][switch:016]: 'Kühlung' Turning OFF.
[22:55:55][E][WRITER:248]: WRITE: 33
[22:55:55][E][WRITER:249]: Data Length: 2
[22:55:55][E][WRITER:250]: COMMAND: SW
[22:55:55][E][WRITER:275]: Data to Write: :04:30:30:31:31:02:53:57:33:33:03:07
[22:55:55][E][WRITER:280]: Bedienteil ist aktiv, kein schreiben möglich
[22:55:55][C][wifi:048]: Setting up WiFi...
[22:55:55][C][wifi:061]: Starting WiFi...
[22:55:56][C][wifi:062]:   Local MAC: E0:5A:1B:E4:DE:0C
[22:55:56][D][wifi:482]: Starting scan...
[22:55:56][D][MODUS:205]: Get_Modus: 0
[22:55:56][D][select:015]: 'Betriebsmodus': Sending state AUS (index 0)
[22:55:56][D][number:012]: 'Update Interval': Sending state 10.000000
[22:55:56][I][START:385]: Command: LS
[22:55:56][D][Reader:044]: Warte auf Antwort von WR3223. Timeout in 5000ms.
[22:55:56][D][Reader:044]: Warte auf Antwort von WR3223. Timeout in 4799ms.
[22:55:56][D][Reader:044]: Warte auf Antwort von WR3223. Timeout in 4699ms.
[22:55:56][D][Reader:044]: Warte auf Antwort von WR3223. Timeout in 4599ms.
[22:55:56][D][Reader:044]: Warte auf Antwort von WR3223. Timeout in 4499ms.
[22:55:56][D][Reader:044]: Warte auf Antwort von WR3223. Timeout in 4399ms.

Hi @FooFighter

I had the same problems.
Until then simply used this module.
Since then, it has been working wonderfully without break -off and the updates of Esphomas no longer make raven.
Important, the ESP module definitely connects outside of the actual housing so that the WLAN reception is not disturbed.


My actual YAML:

esphome:
  name: heizunglueftung
  friendly_name: HeizungLueftung
  includes:
    - wr3223_commands.h
    - wr3223_connector.h
    - wr3223_sensorConnectors.h
    - wr3223_relaisValueDecoder.h
    - wr3223_statusValueHolder.h
    - wr3223_errorValueDecoder.h
    - wr3223_modeValueDecoder.h
    - wr3223_controller.h
  libraries: 
    - EEPROM
  platformio_options: 
    build_flags:
      -fexceptions
    build_unflags:
      -fno-exceptions

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:
  baud_rate: 0

# Enable Home Assistant API
api:
  encryption:
    key: "insert Key here"

ota:
  password: "instert password here"
  platform: esphome
  
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
    
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Heizung Fallback Hotspot"
    password: "YOURPASSWORD"

captive_portal:

uart:
  - id: uart_1
    tx_pin: GPIO19
    rx_pin: GPIO18
    baud_rate: 9600
    data_bits: 7
    parity: EVEN
    stop_bits: 1
    #debug:

custom_component:
  - lambda: |-
      auto wr3223 = new WR3223::WR3223Controller(10000, id(uart_1));
      return {wr3223};
    components:
    - id: wr3223Controller

text_sensor:
  - platform: custom    
    id: WR3223TextSensorConnector
    lambda: |-
      auto wr3223Text = new WR3223::WR3223TextSensorConnector();
      App.register_component(wr3223Text);
      return {wr3223Text->errorTextSensor,
              wr3223Text->customTextSensor};
    text_sensors: 
      - name: "FEHLER-Text"
        entity_category: diagnostic
      - name: "Custom-Text"
        entity_category: diagnostic

# das sollte hier genau übereinstimme, die flags des modus passen hier zum index
select:
  - platform: template
    name: "Betriebsmodus"
    id: "select_betriebsmodus"    
    options:             
      - "AUS"       
      - "Sommerbetrieb"
      - "Sommer-Abluftbetrieb"
      - "Winterbetrieb"      
      - "Handbetrieb"          
    lambda: |-
      auto wr3223Ctrl = static_cast<WR3223::WR3223Controller *>(wr3223Controller);
      int modus = wr3223Ctrl->Get_Modus();
      // if (modus == 1)      
      //   id(select_betriebsmodus).set_icon("mdi:white-balance-sunny");
      // else if (modus == 2)
      //   id(select_betriebsmodus).set_icon("mdi:sun-angle-outline");
      // else if (modus == 3)
      //   id(select_betriebsmodus).set_icon("mdi:snowflake");
      // else if (modus == 3)
      //   id(select_betriebsmodus).set_icon("mdi:hand-back-left-outline");
      // else
      //   id(select_betriebsmodus).set_icon("mdi:pump-off");           
      return id(select_betriebsmodus).at(modus);
    set_action: 
      then:
        - lambda: |-
            auto wr3223Ctrl = static_cast<WR3223::WR3223Controller *>(wr3223Controller);
            wr3223Ctrl->Set_Modus(id(select_betriebsmodus).index_of(x));
    update_interval: 2s
    
  - platform: template
    name: "Luftstufe"    
    id: "select_luftstufe"
    icon: mdi:fan
    options:             
      - "AUS"
      - "Luftstufe 1"
      - "Luftstufe 2"
      - "Luftstufe 3"      
    lambda: |-
      auto wr3223Ctrl = static_cast<WR3223::WR3223Controller *>(wr3223Controller);
      int stufe = wr3223Ctrl->Get_Luftstufe();            
      // if (stufe == 1)      
      //   id(select_luftstufe).set_icon("mdi:fan-speed-1");
      // else if (stufe == 2)
      //   id(select_luftstufe).set_icon("mdi:fan-speed-2");
      // else if (stufe == 3)
      //   id(select_luftstufe).set_icon("mdi:fan-speed-3");
      // else
      //   id(select_luftstufe).set_icon("mdi:fan-off");        
      return id(select_luftstufe).at(stufe);
    set_action: 
      then:
        - lambda: |-
            auto wr3223Ctrl = static_cast<WR3223::WR3223Controller *>(wr3223Controller);            
            wr3223Ctrl->Set_Luftstufe(id(select_luftstufe).index_of(x));
    update_interval: 2s

switch:
  - platform: template
    name: "Zusatzheizung"
    device_class: switch
    icon: mdi:heat-wave    
    lambda: 'return static_cast<WR3223::WR3223Controller *>(wr3223Controller)->Get_Zusatzheizung_On();'
    turn_on_action:
      - lambda: 'static_cast<WR3223::WR3223Controller *>(wr3223Controller)->Set_Zusatzheizung_On(true);'
    turn_off_action:
      - lambda: 'static_cast<WR3223::WR3223Controller *>(wr3223Controller)->Set_Zusatzheizung_On(false);'

  - platform: template
    name: "Wärmepumpe"
    id: warmepumpe_an    
    device_class: switch 
    icon: mdi:heat-pump-outline       
    lambda: |-
      bool result = static_cast<WR3223::WR3223Controller *>(wr3223Controller)->Get_Waermepunpe_On();      
      // if (result)      
      //   id(warmepumpe_an).set_icon("mdi:pump");
      // else
      //   id(warmepumpe_an).set_icon("mdi:pump-off");
      return result;
    turn_on_action:
      - lambda: 'static_cast<WR3223::WR3223Controller *>(wr3223Controller)->Set_Waermepunpe_On(true);'
    turn_off_action:
      - lambda: 'static_cast<WR3223::WR3223Controller *>(wr3223Controller)->Set_Waermepunpe_On(false);'

  - platform: template
    name: "Kühlung"    
    id: "kuhlung_an"
    device_class: switch    
    icon: mdi:snowflake    
    lambda: |-
      bool result = static_cast<WR3223::WR3223Controller *>(wr3223Controller)->Get_Kuehlung_On();      
      // if (result)      
      //   id(kuhlung_an).set_icon("mdi:snowflake");
      // else
      //   id(kuhlung_an).set_icon("mdi:snowflake-off");
      return result;
    turn_on_action:
      - lambda: 'static_cast<WR3223::WR3223Controller *>(wr3223Controller)->Set_Kuehlung_On(true);'
    turn_off_action:
      - lambda: 'static_cast<WR3223::WR3223Controller *>(wr3223Controller)->Set_Kuehlung_On(false);'

number:
  - platform: template
    name: "Luftstufe 1 Ventilatorstellwert"
    id: "vent_level_1_speed"
    min_value: 40
    max_value: 100
    step: 1
    entity_category: config
    icon: mdi:fan-speed-1
    unit_of_measurement: "%"    
    update_interval: never
    lambda: 'return static_cast<WR3223::WR3223Controller *>(wr3223Controller)->get_vent_level_speed(1);'
    set_action: 
      then:
        - lambda: 'static_cast<WR3223::WR3223Controller *>(wr3223Controller)->set_vent_level_speed(1, (int)x);'

  - platform: template
    name: "Luftstufe 2 Ventilatorstellwert"
    id: "vent_level_2_speed"
    min_value: 40
    max_value: 100
    step: 1
    entity_category: config
    icon: mdi:fan-speed-2
    unit_of_measurement: "%"
    update_interval: never
    lambda: 'return static_cast<WR3223::WR3223Controller *>(wr3223Controller)->get_vent_level_speed(2);'
    set_action: 
      then:
        - lambda: 'static_cast<WR3223::WR3223Controller *>(wr3223Controller)->set_vent_level_speed(2, (int)x);'

  - platform: template
    name: "Luftstufe 3 Ventilatorstellwert"
    id: "vent_level_3_speed"
    min_value: 40
    max_value: 100
    step: 1
    entity_category: config
    icon: mdi:fan-speed-3
    unit_of_measurement: "%"
    update_interval: never
    lambda: 'return static_cast<WR3223::WR3223Controller *>(wr3223Controller)->get_vent_level_speed(3);'
    set_action: 
      then:
        - lambda: 'static_cast<WR3223::WR3223Controller *>(wr3223Controller)->set_vent_level_speed(3, (int)x);'

  - platform: template
    name: "Update Interval"
    min_value: 1
    max_value: 20
    step: 1
    mode: SLIDER
    entity_category: config    
    icon: mdi:refresh-circle
    lambda: 'return (static_cast<WR3223::WR3223Controller *>(wr3223Controller)->get_update_interval() / 1000);'
    set_action: 
      then:
        - lambda: |-
            auto controller = static_cast<WR3223::WR3223Controller *>(wr3223Controller);
            controller->set_update_interval((int)x * 1000);
            controller->call_setup();    
  # - platform: template
  #   name: "Zuluft soll Temperatur"
  #   min_value: 18
  #   max_value: 35
  #   step: 1
  #   mode: SLIDER
  #   entity_category: config    
  #   icon: mdi:home-thermometer-outline
  #   lambda: 'return static_cast<WR3223::WR3223Controller *>(wr3223Controller)->Get_Zuluft_Soll_Temp();'
  #   set_action: 
  #     then:
  #       - lambda: 'static_cast<WR3223::WR3223Controller *>(wr3223Controller)->Set_Zuluft_Soll_Temp(x);'

binary_sensor:
  - platform: custom
    id: WR3223BinarySensorConnector
    lambda: |-
      auto wr3223Binary = new WR3223::WR3223BinarySensorConnector();
      App.register_component(wr3223Binary);
      return {wr3223Binary->kompressorRelaySensor,
              wr3223Binary->zusatzheizungRelaySensor,
              wr3223Binary->erdwaermetauscherRelaySensor,
              wr3223Binary->bypassRelaySensor,
              wr3223Binary->vorheizregisterRelaySensor,
              wr3223Binary->netzrelaisBypassRelaySensor,
              wr3223Binary->bedienteilAktivRelaySensor,
              wr3223Binary->bedienungViaRSSchnittstelleRelaySensor,
              wr3223Binary->luftstufeVorhandenRelaySensor,
              wr3223Binary->wW_NachheizregisterRelaySensor,
              wr3223Binary->magnetventilRelaySensor,
              wr3223Binary->vorheizenAktivRelaySensor,
              wr3223Binary->errorSensor,
              wr3223Binary->nachheizregisterSensor,
              wr3223Binary->absenkungSensor};
    binary_sensors: 
      - name: "Relais: Kompressor"
        entity_category: diagnostic
      - name: "Relais: Zusatzheizung"
        entity_category: diagnostic
      - name: "Relais: Erdwaermetauscher"
        entity_category: diagnostic
      - name: "Relais: Bypass"
        entity_category: diagnostic
      - name: "Relais: Vorheizregister"
        entity_category: diagnostic
      - name: "Relais: Netzrelais Bypass"
        entity_category: diagnostic
      - name: "Relais: Bedienteil aktiv"
        entity_category: diagnostic
      - name: "Relais: Bedienung via RSSchnittstelle"
        entity_category: diagnostic
      - name: "Relais: Luftstufe Vorhanden"
        entity_category: diagnostic
      - name: "Relais: Warmwasser Nachheizregister"
        entity_category: diagnostic
      - name: "Relais: Magnetventil"
        entity_category: diagnostic
      - name: "Relais: Vorheizen aktiv"
        entity_category: diagnostic
      - name: "FEHLER"
        device_class: problem
        entity_category: diagnostic
      - name: "Nachheizregister ON"
        entity_category: diagnostic
      - name: "Absenkung ON"
        entity_category: diagnostic



sensor:
- platform: custom
  id: WR3223SensorConnector
  lambda: |-
    auto wr3223Sensor = new WR3223::WR3223SensorConnector();
    App.register_component(wr3223Sensor);
    return {wr3223Sensor->verdampfertemperatur_sensor, 
            wr3223Sensor->kondensatortemperatur_sensor,
            wr3223Sensor->aussentemperatur_sensor,            
            wr3223Sensor->fortlufttemperatur_sensor,
            wr3223Sensor->zulufttemperatur_sensor,
            wr3223Sensor->nachvorheizregistertemperatur_sensor,
            wr3223Sensor->drehzahl_zuluft_sensor,
            wr3223Sensor->drehzahl_abluft_sensor};
  sensors:
  - name: "Temp: Verdampfer"
    unit_of_measurement: °C
    accuracy_decimals: 1
    device_class: temperature    
  - name: "Temp: Kondensator"
    unit_of_measurement: °C
    accuracy_decimals: 1
    device_class: temperature    
  - name: "Temp: Aussen"
    unit_of_measurement: °C
    accuracy_decimals: 1
    device_class: temperature      
  - name: "Temp: Nach Wärmetauscher (Fortluft)"
    unit_of_measurement: °C
    accuracy_decimals: 1
    device_class: temperature    
  - name: "Temp: Zuluft"
    unit_of_measurement: °C
    accuracy_decimals: 1
    device_class: temperature    
  - name: "Temp: Nach Vorheizregister"
    unit_of_measurement: °C
    accuracy_decimals: 1    
    device_class: temperature    
  - name: "Drehzahl: Zuluft"    
    unit_of_measurement: rpm
    state_class: measurement    
  - name: "Drehzahl: Abluft"
    unit_of_measurement: rpm
    state_class: measurement    

button:
  - platform: template
    name: Update Relais    
    icon: mdi:update
    entity_category: config    
    on_press:
      - lambda: 'static_cast<WR3223::WR3223Controller *>(wr3223Controller)->Refresh_Relais();'
  - platform: template
    name: Restore config
    icon: mdi:update
    entity_category: config
    on_press:
      - lambda: 'static_cast<WR3223::WR3223Controller *>(wr3223Controller)->Config_Restore();'
  - platform: template
    name: Save config
    icon: mdi:update
    entity_category: config    
    on_press:
      - lambda: 'static_cast<WR3223::WR3223Controller *>(wr3223Controller)->Config_Save();'

#switch:
#  - platform: template
#    name: "RefreshRelais"
#    lambda: |-
#      auto wr3223Relais = new WR3223RelaisConnector();      
#      if(wr3223Relais->zusatzheizungSensor->state){
#        return true;
#      } else {
#        return false;
#      }
#    turn_on_action:      
#      - homeassistant.service: 
#          service: Refresh_Relais
#    turn_off_action:
#      - homeassistant.service: 
#          service: Refresh_Relais

#text_sensor:
#- platform: custom
#  lambda: |-
#    auto wr3223 = new WR3223Connector(id(uart_1));
#    App.register_component(wr3223);
#    return {wr3223};
#  text_sensors:
#    id: "uart_readline"

#interval:
#  - interval: 3s    
#    then:
#      - uart.write:
#          id: uart_1
#          data: [0x04, 0x30, 0x30, 0x31, 0x31, 0x54, 0x32, 0x05]