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).