Home Assistant Integration for Lelit MaraX with ESPHome

I build an integration for my Lelit MaraX Espresso Machine for Home Assistant.

This integration is based on this great Reddit article

I used an Wemos Lolin32 to connect with the PID of the MaraX. The connection is done via UART.

The coffee machine sends the following data about 4 times a second:


First Character: C or S for Coffee-/Steam-Priority. Followed by the current firmware version. Second value: Actual steam temperature Third value: Target steam temperature Fourth value: Actual Heatexchanger temperature Fifth value: Remaining timer for fast heating Sixth value: Heating on/off

When data is received it is shown on the display (Actual temperature of heat exchanger and steam) and sent to Home Assistant.

ESP32 in Coffee mode

ESP32 in Coffee mode closeup

If no data is received for 5s the current time is shown instead.

ESP32 in Clock mode

In Home Assistant the data can be used to build dashboards.

ESP32 in Clock mode

ESP32 in Clock mode

Case: Wemos Lolin 32 OLED Box by pangodream - Thingiverse

The code can be found here

@manyos-robert Im just doing this same thing with my Lelit Elizabeth V3 I found the Gicar control box (its not as easy to get to as your MaraX), and just looking at the pins… could you remember or confirm which colours you added to which pins? it looks like pin 2 (green) and 3 (white) from left to right in this pic?

EDIT: Read the Reddit link article a bit closer and have my answer - Green wire (TXD) to Pin 3 and White (RXD) to Pin 4

1 Like

I absolutely love this!

I actually opened my Gicar unit to check the correct pinout, as it turns out (at least for the V2 version) all available pinouts are wrong. The 4th pin from the wall is the actual ground pin. By using this pin you can draw 12V fro the 12V pin of the buzzer connector labeled on the cartridge, that sits right next to the 6 pin aux port. The Tx pin is actually the one right next to the Ground pin (Pin 3 from the wall) and is all you need to hook up to read data from the Gicar. After all we don’t know any commands the Gicar understands anyway. Until somebody dumps the firmware of the ST mcu that does all the magic.

Marking on the MCU is:

1 Like

In case anyone is interested in trying to dump the ST MCU firmware, CN8 is the On-board Programming port. That being said, the firmware is very likely readout protected.

Fun fact, the board is extremely similar to the corresponding board in the Lelit Bianca, but the firmware is very different (in the Bianca, there’s an additional board, the LCC, which does all of the interesting stuff like PID, so for that machine role of this board is basically just an IO board).

I’ve documented the protocol on the Bianca at GitHub - magnusnordlander/lelit-bianca-protocol: Project notes for trying to sniff and reverse engineer the protocol used for LCC information on the Lelit Bianca. I’ve also considered designing an open source replacement for these boards (I’ve designed one that replaces the LCC), but I’ve only done low voltage boards before, so doing a mains voltage one scares me :sweat_smile:

1 Like

Do you know the pinout of the programming port? I have a stlink v2, I could try a dump fwiw.
I was also considering doing my own electronics, but I figured especially in the Mara X the logic might be slightly more sophisticated than slapping a pid on some temp probes, as it seems Lelit really knows how to keep the hx temps in sane ranges and spent quite some effort getting these right.

The only thing I’d ask would be to set my brewing temperatures independent of the 3 way switch we have in the mara. But I’m pretty sure that’s quite a stretch to ask for.

Nice work on the Bianca! I had an eye on here but she was just too far off budget, and I don’t have the space for her.

Just looking at an incomplete reverse engineering of the control board I did a while ago (where U5 is the MCU component):

Pin 1: +5V
Pin 2: U5_PD1
Pin 3: GND
Pin 4: U5_NRST

I’ve uploaded the partial schematic to https://github.com/open-lcc/control-board-schematic (pull requests are welcome).

By the way, you didn’t by any chance snap a photo of the high voltage side of the assembly? I’m a little interested to see if that is identical too.

1 Like

This is interesting!

I ordered my Mara X V2 last week and it did not arrive yet, but I’m afraid the V2 needs some extra care to be turned on and off via a (e.g.) WiFi Plug
So I’m reading a lot of threads what has been done already.
I’m looking for an option to have (beside what seems possible already) the following functions:
Control Mains Power by a WiFi Plug (easy)

  1. When Mains Power is on, set Mara X to “on” Mode with Standby-Mode activated
  2. Beeing able to wake up Mara X from Standby

Reason? It would be quite inconvenient when I need to get up 25mins earlier before having Morning-Coffee. I want that I can turn on Mara either manual via Home System, or having Mara turned on by Home System at a given time in the morning.

I’m happy developing a small PCB with an (e.g.) ESP32 if someone could help me with the coding.

Edit: yesterday I received the MaraX and after beeing able to inspect it in practice, I have to correct some assumptions I made in an error.
So my machine was delivered with a mechanical on-off push button.
The means there’s no problem operation the “power on” function with a WiFi plug.
This has been implemented yesterday and is working great!

2nd Edit: After watching the Energy consumption over the day, I end up at about 1 kWh with Stand By Mode deactivated. This equals 35Ct. … even with StandBy Mode activated, it is not much less than that.
If I compare this to the price of a single coffee @ Starbucks, it stopped thinking about this.

Other point: even after reading hundreds of threads, nowhere is mentioned, which connector can be used for connecting to the AUX Port of the Gicar… From Pictures I’ve seen it must be one from the TE catalogue, but not sure which series.
Is this publicly known?

Learning curve done!
A lot of nonsense is circulating around re MaraX serial connection.

Here a summary what & why and how to do it right: Lelit Mara X V2 Gicar Internals - Engineering Office Grafe