Attention!!! 0.0.6 changed some of the pins and is not 100% compatible anymore. Please keep in mind, when using the ESPhome YAML or when implementing your own firmware.

If you need to assemble a few parts (ECAPs and optional stuff) or flash another firmware, watch my video on YouTube.

Introduction

At first, do not get confused, KM217 and KM271 ist the same, I just had a number swap in and it is simply impossible to change all the historic stuff and naming 🙁

If you ordered the module described in Reverse Engineering the Buderus KM271 – And Making It WiFi-Flying on ESPhome and Home Assistant from my Tindie store or built it on your own, this is the place to search for, when it comes to getting it up and running. You will find the Information for both versions (0.0.5 and 0.0.6 here). Version 0.0.6 is already available and can be ordered.

Known compatible Heating Control Units

  • Buderus Logamatic 2107 M (this is my own unit)
  • Logamatic HS2102 (not EcoMatic !!!)

If you have one of my boards and a different control unit that works, please tell me about, so I can add it to this list 🙂 If you are not 100% sure, I have still plenty of old bare 0.0.5-Boards for a very low price. Antoher option is to print one of the PCB pages with 1:1 scale, glue it on a cardboard cut it out and test if it fits in your heating controller.

The Hardware

To make your life easier for aseembly and to find the parts and signals, here is the interactie BOM.

The Software

There is a ton of software alternatives for the board, but I’ll only describe three of them in more detail. You can select the firmware when you order the board.

Default, no FW selected: Blinkenlights

At first, I’ll just tell you, what is on the board, when you did not select any firmware during your order on Tindie. It is a simple test program, that ensures, that the ESP32 and the LEDs are working.

It does nothing more than rolling through the 4 LEDs on the board.

It will be possibly extended in future to catch hardware and assembly bugs, should they arise in future.

You can find it on GitLab. Use VSCode with PlatformIO to open, compile and flash it. This is also a very nice foundation for developing your own firmware.

Flashing can be done, by connecting power, ground, RX and TX. IO0 and EN is not needed and can be triggered with the buttons. Press BOOT and keep it pressed, shortly press RESET and start your flash tool. Then release BOOT and flashing will start.

I’ll possibly improve the Blinkenlight to be able to update the board via WiFi or BLE. If you feel responsible to do this, I would be happy to take the pull request. If I get a working firmware, the minimal thing I would do is refunding the board you bought from me 🙂

Sven’s great MQTT-firmware

Sven published a firmware on GitHub for my module that speaks MQTT on the network. This was probably the most complete piece of code for my module before JEns accepted the challenge on the ESPhome part. The „only thing“ you need to do is installing VSCode and the PlatformIO addon, set the credentials for WiFi, MQTT and OTA (in include/Credentials.h), compile and flash it to the board.

ESPhome

If you selected ESPhome, you will get an (older) ESPhome firmware version for this board. But as you will update the firmware after adjusting the config, you will have the latest firmware aligned with your ESPhome instance. Currently, the firmware is likely to be feature complete and runs without problems. See the section below, ho to connect to your board.

Diggers Full Example YAML (Drop Down Accordeon)

esphome:
  name: buderus-km217
  platform: ESP32
  board: esp32dev

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  password: "XYZ"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_pass

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Fallback Hotspot"
    password: "XXX"

captive_portal:

uart:
  id: uart_bus
  tx_pin: GPIO2
  rx_pin: GPIO4
  baud_rate: 2400

external_components:
#  - source:
#      type: local
#      path: my_components/components
#    components: [ km271_wifi ]
  - source: github://the78mole/esphome_components@main
    components: [ km271_wifi ]
 

km271_wifi:
  - id: budoil
    uart_id: uart_bus

# SPI starting from version 0.0.6
spi:
  clk_pin: GPIO18
  mosi_pin: GPIO23
  miso_pin: GPIO19
  id: bus_spi1

# nCS for SPI is GPIO15

i2c:
  sda: GPIO13
  scl: GPIO16
  scan: true
  id: bus_i2c1

# For version 0.0.6
# For triggered actions, I2C devices can use GPIO14
# To enable the I2C level shifter (I2C_EXT_EN), use GPIO 12

status_led:
  id: ledgn1
  pin: 
    number: GPIO21
    inverted: true

number:
  - platform: km271_wifi
    warm_water_temperature:
      name: "Warmwassersolltemperatur Tag"

select:
  - platform: template
    name: "Warmwasser Betriebsart"
    id: warmwasser_betriebsart
    entity_category: config
    optimistic: true
    options:
      - Dauerhaft aus (0)
      - Dauerhaft ein (1)
      - Automatik (2)
    initial_option: Automatik (2)
    set_action: 
      - lambda:
          auto index = id(warmwasser_betriebsart).index_of(x);
          if (index.has_value()) {
            uint8_t command[] = {0x0C, 0x0E, (uint8_t)index.value(), 0x65, 0x65, 0x65, 0x65, 0x65};
            budoil->writer.enqueueTelegram(command, 8);
          }

binary_sensor:
  - platform: km271_wifi
    boiler_error:
      name: "KM271 Kesselfehler"
    boiler_running:
      name: "KM271 Kesselbetrieb"
    load_pump_running:
      name: "KM271 Ladepumpe"

sensor:
  - platform: km271_wifi
    heating_circuit_1_flow_target_temperature:
      name: "KM271 Vorlaufsolltemperatur"
    heating_circuit_1_flow_temperature:
      name: "KM271 Vorlauftemperatur"
    hot_water_target_temperature:
      name: "KM271 Warmwassersolltemperatur"
    hot_water_temperature:
      name: "KM271 Warmwassertemperatur"
    boiler_target_temperature:
      name: "KM271 Kesselvorlaufsolltemperatur"
    boiler_temperature:
      name: "KM271 Kesselvorlauftemperatur"
    outdoor_temperature:
      name: "KM271 Außentemperatur"
    heating_circuit_1_room_target_temperature:
      name: "KM271 Raumsolltemperatur"
    heating_circuit_1_curve_n10:
      name: "KM271 Heizkurve -10 °C"
    heating_circuit_1_curve_0:
      name: "KM271 Heizkurve 0 °C"
    heating_circuit_1_curve_p10:
      name: "KM271 Heizkurve +10 °C"
    boiler_turn_on_temperature:
      name: "KM271 Brennereinschalttemperatur"
    boiler_turn_off_temperature:
      name: "KM271 Brennerausschalttemperatur"

  - platform: wifi_signal
    name: "KM217 WiFi Signal Sensor"
    update_interval: 60s

  - platform: adc
    pin: 36
    unit_of_measurement: "V"
    name: "KM217 5V Supply"
    accuracy_decimals: 2
    update_interval: 5s
    attenuation: 6dB
    filters:
      - multiply: 27.7317
      - throttle_average: 60s
      
switch:
  - platform: gpio
    name: LED2_Green
    pin: 
      number: 22
      mode: OUTPUT
      inverted: true
  - platform: gpio
    name: LED3_Yellow
    pin: 
      number: 17
#     number: 23  # For 0.0.5
      mode: OUTPUT
      inverted: true
  - platform: gpio
    name: LED4_Red
    pin: 
      number: 25
      mode: OUTPUT
      inverted: true

Connecting to the board

I configured the ESPhome firmware to run a captive portal after approx one minute. So, after powering the board, you could (after one minute) connect to the SSID „Fallback Hotspot“. Turn of your cellular internet (it disturbs the WiFi very often) and select the Fallback (password is "Z8zfajgxVvNw"). When WiFi of your phone is connected (sometimes you need some tries), a pop-up should ask you to sign in to the network. Follow this. It will present the portal of the ESPhome firmware and show you all WiFis it has found. Select the appropriate one and enter the password of this WiFi.

When the module is correctly connected to the network, it should soon show up as a new ESPhome board in your Home Assistant. Sometimes, you need to wait for a few minutes for the notification to show up. When adopted, you will see it in your ESPhome devices overview and can enter adjust the YAML to your needs. New sensor nodes will also take a few minutes to be shown sometimes.

The relevant part of the YAML is as follows:

esphome:
  name: km217-for-friends
  platform: ESP32
  board: esp32dev

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

wifi:
  ssid: "<YOUR WIFI SSID>"
  password: "<YOUR WIFI PASSPHRASE>"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Fallback Hotspot"
    password: "Z8zfajgxVvNw"

Other Settings

Renaming the module should be done using ESPhome GUI

For more detailed information, see my blog about the development of the module.

Using Arduino with MQTT

Coming soon 🙂

5,0
5,0 von 5 Sternen (basierend auf 21 Bewertungen)
Ausgezeichnet100%
Sehr gut0%
Durchschnittlich0%
Schlecht0%
Furchtbar0%

ESPHome und EEPROM

28. April 2023

Funktioniert richtig gut!

Da ich damit HK1 und HK2(Fußboden) betriebe habe ich mir mal einfach das hier mit allen Reglern geflashed: https://github.com/the78mole/esphome_components/blob/main/components/km271_wifi/km271-for-friends.yaml

In Github schreibst du:

„MORE CAUTION: If you plan to change settings, please take care not to change settings too frequently. Devices such as these heaters typically use so called EEPROM chips to store settings. Such chips only support a certain number of write operations before breaking down. You should be safe for some years if you don’t write more 20 values per day – but there is no guarantee. Maybe someone can dig out some documentation about this to make sure.“

Was meinst du mit „beraking down“? Gehen kaputt oder stürzen ab und man muss manuell neustarten?

Ich habe vor damit ab un zu ca. 2x Mal die Woche HK1 und HK2 Betriebsmodus zu ändern,

Warmwassersolltemperatur Tag – bei Bedarf 3-4 Mal (da ich mit Holz heize, warte ich bis der Pufferspeicher voll ist und dreh dann hoch)

HK1 & HK2 Raumsolltemperatur – 2-3 Mal am Tag, ebenfalls abhängig von der Pufferspeichertemperatur

Das alles mache ich manuell schon die ganze Zeit, belastet das auch den EEPROM?

Noch eine kleine Frage:

Direkt am Gerät habe ich die Temperatur für die beiden Heizkreise synchron verändern können, hier habe ich die Möglichkeit diese unabhängig voneinander zu verändern. Kann man das wirklich so machen, oder ist das nur visuell?

Ansonsten bin ich echt sehr sehr begesitert davon was du da auf die Beine gestellt hast und bin auch sowas von stolz ein Teil davon zu sein!

Danke!

Alex Kusnezov

Antwort von MolesBlog

Hallo Alex,

zuerst einmal, wenn das EEPROM kaputt geht, weiß ich tatsächlich nciht, was genau passiert. Ich kann ja nicht in die Firmware von Buderus schauen, sondern nur vermuten, wie ich es implementiert hätte. Sehr wahrscheinlich ist aber, dass dann entweder alles zu spinnen anfängt oder, dass die Heizung einfach mit einem Fehler den Diesnt quittiert oder einen Fehler anzeigt und in einem Notprogramm läuft.

Fakt ist aber, dass zwei Schreibvorgänge am Tag absolut OK sind. Bei mir sind es ca. 3 Änderungen des WW-Betriebsmodus am Tag. Andere Einstellungen verändere ich eher selten (z.B. die Auslegungstemperatur), da ich mittlerweile den passenden Betriebspunkt gefunden habe.

Was Du mich da bzgl. der beiden Heizkreise fragst, kann ich leider nicht beantworten. Bei mir ist nur ein Heizkreis. Zudem gibt es mehrere Temperaturen, die Du meinen könntest. Tatsächlich sind einige Parameter „doppelt“ vorhanden, beziehen sich aber meines Wissens auf die gleiche Größe. Also egal, wo Du sie änderst, es ändern sich immer beide.

Kannst es ja mal testen und zurück schreiben.

Und ich bin auch begeistert, wie viele Leute sich über mein KM271 freuen. Anfangs dachte ich, das sind vielleicht ein Duzend „Chaoten“, die genau so verrückt sind wie ich, aber tatsächlich sind es schon deutlich über 100. Einfach unglaublich.

Und vielen Dank für die tolle Bewertung 🙂

Grüße,

Daniel (der freundliche Maulwurf aus Deinem Vorgarten :-P)

Funzt

20. April 2023

Respekt! Funktioniert einwandfrei und macht mega Laune das ganze in Home Assistant einzublenden. Sehr sehr geil die alte Buderus in Wifi einzubinden.

Jan

Antwort von MolesBlog

Hallo Jan,

ja, das gleiche Gefühl hatte ich auch, als ich es geschafft hatte. Ohne die Unterstützung meiner kleinen Community wäre das niemals möglich gewesen (die Firmware habe ich zum größten Teil von Jens zugeliefert bekommen) und ich war schlicht begeistert und dachte: „Sehr cool, so eine geniale Einbindung schaffen nicht einmal die neuesten Heizungen, die es derzeit zu kaufen gibt und das Ding ist gut 20 Jahre alt!“

Grüße,

Dein Maulwurf 🙂

Kein wifi

8. April 2023

Habe meine PCB erhalten habe sie voll ausgestattet gekauft mit der Software etc. Nachdem ich sie nun eingebaut habe – erschien kein wifi was kann ich denn hier nun tun?

Denis

Antwort von MolesBlog

Hallo Denis,

es dauert ein bis zwei Minuten, bis der Fallback-AP auftaucht. Währenddessen blinkt die grüne LED etwa im 2-Sekunden-Takt. Blinkt diese nicht, liegt entweder ein Problem mit der Spannungsversorgung vor (Jumper-Einstellungen prüfen, wenn PWRSEL und USB bestückt) oder ein Problem mit der FW (sehr unwahrscheinlich)

Frohe Ostern, Dein

Maulwurf