Adapt pymodbus Ascii framer to communicate with ABL EMH1 wallbox

Dear community,

I would like to estabilish the communication between Home Assistant and my wallbox ABL EMH1.

The wallbox supports modbus Ascii for communication. Unfortunatelly, the wallbox uses a non-standard start string (0x3e instead of 0x3a which is modbus ascii standard).
information of wallbox see: https://www.ablmobility.de/global/downloads/anleitungen/emh1/Schnittstellenbeschreibung_Modbus-ASCII.pdf?m=1652185246&
information of modbus standard see: Modbus ASCII

In order to communicate with the wallbox it is necessary to adapt the expected start string in the checkFrame routine in pymodbus\framer\ascii_framer.

def checkFrame(self):
        """Check and decode the next frame.

        :returns: True if we successful, False otherwise
        """
        #start = self._buffer.find(self._start)             #original code which need to be changed
        start = self._buffer.find(0x3e)
        if start == -1:
            return False
        if start > 0:  # go ahead and skip old bad data
            self._buffer = self._buffer[start:]
            start = 0

        if (end := self._buffer.find(self._end)) != -1:
            self._header["len"] = end
            self._header["uid"] = int(self._buffer[1:3], 16)
            self._header["lrc"] = int(self._buffer[end - 2 : end], 16)
            data = a2b_hex(self._buffer[start + 1 : end - 2])

           return checkLRC(data, self._header["lrc"])
        return False

I have tested successfully the adaptation in a local python environment.
Now I am struggeling to make this change in the home assistant environment.

Could somebody tell me where I can find the pymodbus source files in home assistant and is it possible to adapt the framer file?
Is there maybe another way to customize the framer? (something like custom component which override only the framer file would be very nice).

Hello,
Is there already a solution to this? I’m trying to connect an ABL emH1 to HA without EVCC. It works without any problems with EVCC, I use a Waveshare RS232 TO ETH (B).
However, the range of functions of EVCC is too high for my applications, so I need a “slim” solution.

Hello @MSteinis ,
I’m curious to hear if you have been able to find a workaround.
I do as well own an ABL eMH1 and would be eager to make it work with Homeassistant.

For those searching for a solution to connect the ABL eMH1 to Home Assistant: I’ve created a component that does this, using a generic esp32 and a serial to RS485 chip.

See this thread here: Connecting the ABL eMH1 EV charger as ESPHome Component

thanks @jrv , that would be exactly what I need, although I was not planing to do any electronics, but merely recycling a USB RS485 adapter.
Any chance to add a picture of your assembled ESP32 component?

This is my test setup, it’s just an ESP32 with a SN75LBC176P chip to convert serial to RS485. All the other stuff you see is optional (resistor with led to visualize the sending of data, 12V->5V converter to steal electricity from the ABL board (X10 has 12V and GND)

There’s a schematic in the doc directory of my github repository

1 Like