Programmatically read data from your Solar Inverter (Voltronic, Axpert, Mppsolar PIP, Voltacon, Effekta etc) and interface with Home Assistant via MQTT - Works with RS232 & USB!

If someone have issue with 2 serial adapter that switch from ttyUSB0 and ttyUSB1 at boot i made a script to fix it automatically
If you use two usb2serial adapters on your raspberry it sometimes happens that on reboot the two devices are inverted between USB0 and USB1, this script launched at boot checks the links created according to the procedure described below and replaces the inverter.conf file with the correct device.

Hi all, I’ve been trying to make my Courtois inverter working with this docker, without success. If I plug the RX-TX-GDN pins (1, 2 and 8 on the RJ45 COMM plug), the inverter fallback in alert mode (red led), the LCD screen goes of, and if it doesn’t the values are incoherent (0V, etc.).

On the terminal I receive a few bits per seconds, but it doesn’t seem to make sense.

$ sudo stty -F /dev/ttyUSB0 sane
$ sudo stty -F /dev/ttyUSB0 2400 raw -echo
$ cat /dev/ttyUSB0
�c����V�e����V�e����V�e����V^C
$ docker-compose up -d
voltronic-mqtt is up-to-date
Recreating watchtower ... done
$ docker exec -it voltronic-mqtt bash -c '/opt/inverter-cli/bin/inverter_poller -d -1'
Mon Feb  6 22:22:08 2023 INVERTER: Debug set
Mon Feb  6 22:22:08 2023 INVERTER: Current CRC: 49 C1
Mon Feb  6 22:22:09 2023 INVERTER: QMOD reply size (5 bytes)
Mon Feb  6 22:22:09 2023 INVERTER: QMOD: incorrect start/stop bytes.  Buffer: �
Mon Feb  6 22:22:09 2023 INVERTER: Current CRC: B7 A9
Mon Feb  6 22:22:12 2023 INVERTER: QPIGS read timeout
Mon Feb  6 22:22:12 2023 INVERTER: QPIGS reply too short (17 bytes)
Mon Feb  6 22:22:12 2023 INVERTER: Current CRC: F8 54
Mon Feb  6 22:22:15 2023 INVERTER: QPIRI read timeout
Mon Feb  6 22:22:15 2023 INVERTER: QPIRI reply too short (24 bytes)
Mon Feb  6 22:22:15 2023 INVERTER: Current CRC: B4 DA
Mon Feb  6 22:22:18 2023 INVERTER: QPIWS read timeout
Mon Feb  6 22:22:18 2023 INVERTER: QPIWS reply too short (24 bytes)
Mon Feb  6 22:22:23 2023 INVERTER: Current CRC: 49 C1
Mon Feb  6 22:22:23 2023 INVERTER: QMOD reply size (5 bytes)
Mon Feb  6 22:22:23 2023 INVERTER: QMOD: incorrect start/stop bytes.  Buffer: �
Mon Feb  6 22:22:23 2023 INVERTER: Current CRC: B7 A9
Mon Feb  6 22:22:26 2023 INVERTER: QPIGS read timeout
Mon Feb  6 22:22:26 2023 INVERTER: QPIGS reply too short (16 bytes)
Mon Feb  6 22:22:26 2023 INVERTER: Current CRC: F8 54
Mon Feb  6 22:22:29 2023 INVERTER: QPIRI read timeout
Mon Feb  6 22:22:29 2023 INVERTER: QPIRI reply too short (24 bytes)
Mon Feb  6 22:22:29 2023 INVERTER: Current CRC: B4 DA
Mon Feb  6 22:22:32 2023 INVERTER: QPIWS read timeout
Mon Feb  6 22:22:32 2023 INVERTER: QPIWS reply too short (8 bytes)
Mon Feb  6 22:22:37 2023 INVERTER: Current CRC: 49 C1
Mon Feb  6 22:22:38 2023 INVERTER: QMOD reply size (5 bytes)
Mon Feb  6 22:22:38 2023 INVERTER: QMOD: incorrect start/stop bytes.  Buffer: 
…

If I unplug the RX pin (the inverter doesn’t receive any data) the inverter doesn’t goes into alert mode, and I still receive this data. If I’m not using the docker poller cli but just using cat /dev/ttyUSB0, therefore not sending any data to inverter’s RX, it still goes into alert mode. The only way to avoid alert is to unplug the RX pin.

Does anyone have any clue?

Thank you very much,

Bests,

Camille.

comm plug? in the picture you show, it is for display connection, when you are moving the display in another room…
for pc it is anothor one…

Hello catalinbordan, thank you for your reply. There is only one external plug named COMM, it works with the BMS connected to my Pylon batteries. On the manual it is presented as the RS323 plug, among other things (dot number 12):

The LCD screen is plugged inside with another RJ45 cable. I saw other people using this plug labelled COMM with RS232. Are you sure it is only for the LCD?

hmmm, interesting…did not pay attention, on your display board I did not saw communication ports.
Mine have it…like this.

1 Like

Thanks to this thread and the various resources listed in it, I was able to get my Voltronic inverter talking to my Home Assistant installation.
Running Home Assistant on Unraid VM
Running Voltronic Docker on Unraid Docker using @catalinbordan fork, thank you
Using USB to Serial cable

1 Like

i would really love if somebody could help me step by step how to read data from my easun inverter on home assistant. i allready learn alot on home assistant but this is rly hard to understand. what is a docker? and how do i install it? if someone could help me i would really apreciate it!

Hello Guys,

@catalinbordan I am using your fork and getting the following result with a Serial to USB cable on ttyUSB0:

Sun Feb 19 20:02:49 2023 INVERTER: Debug set
Sun Feb 19 20:02:49 2023 DEBUG:  Current CRC: 49 C1
Sun Feb 19 20:02:49 2023 DEBUG:  Send buffer hex bytes:  ( 51 4d 4f 44 49 c1 0d )
Sun Feb 19 20:02:49 2023 DEBUG:  7 bytes written, 7 bytes sent, 0 bytes remaining
Sun Feb 19 20:02:49 2023 DEBUG:  7 bytes read, 7 total bytes:  00 28 4e 41 4b 73 73 0a
Sun Feb 19 20:02:55 2023 DEBUG:  QMOD read timeout
Sun Feb 19 20:02:56 2023 DEBUG:  Found reply <cr> at byte: 1430225089

using a direct USB connection with a micro USB to USB A cable on hidraw0 i am getting the following:

Sun Feb 19 19:34:35 2023 INVERTER: Debug set
Sun Feb 19 19:34:35 2023 DEBUG:  Current CRC: 49 C1
Sun Feb 19 19:34:35 2023 DEBUG:  Send buffer hex bytes:  ( 51 4d 4f 44 49 c1 0d )
Sun Feb 19 19:34:35 2023 DEBUG:  7 bytes written, 7 bytes sent, 0 bytes remaining
Sun Feb 19 19:34:41 2023 DEBUG:  QMOD read timeout
Sun Feb 19 19:34:41 2023 DEBUG:  Found reply <cr> at byte: 1
 configuration options for the actual inverter polling process...p bytes.  Buffer: QMODI�

# The device to read from...
# Use: /dev/ttyS0 if you have a serial device,
#      /dev/ttyUSB0 if a USB<>Serial,
#      /dev/hidraw0 if you're connecting via the USB port on the inverter.

device=/dev/hidraw0

# How many times per hour is the program going to run...
# This is used to calculate the PV & Load Watt Hours between runs...
# If unsure, leave as default - it will run every minute...

# (120 = every 30 seconds)...
# run_interval=322 don;t need it anymore for HA

# This allows you to modify the amperage in case the inverter is giving an incorrect
# reading compared to measurement tools.  Normally this will remain '1'
amperage_factor=1.0

# This allows you to modify the wattage in case the inverter is giving an incorrect
# reading compared to measurement tools.  Normally this will remain '1'
watt_factor=1.0


# The following settings allow you to modify runtime buffers.
# N.B. These values may not be applicable to all inverter t
Sun Feb 19 19:34:41 2023 DEBUG:  Current CRC: B7 A9
Sun Feb 19 19:34:41 2023 DEBUG:  Send buffer hex bytes:  ( 51 50 49 47 53 b7 a9 0d )
Sun Feb 19 19:34:41 2023 DEBUG:  8 bytes written, 8 bytes sent, 0 bytes remaining
Sun Feb 19 19:34:47 2023 DEBUG:  QPIGS read timeout
Sun Feb 19 19:34:47 2023 DEBUG:  Found reply <cr> at byte: 1
configuration options for the actual inverter polling process...top bytes.  Buffer: QPIGS��

# The device to read from...
# Use: /dev/ttyS0 if you have a serial device,
#      /dev/ttyUSB0 if a USB<>Serial,
#      /dev/hidraw0 if you're connecting via the USB port on the inverter.

device=/dev/hidraw0

# How many times per hour is the program going to run...
# This is used to calculate the PV & Load Watt Hours between runs...
# If unsure, leave as default - it will run every minute...

# (120 = every 30 seconds)...
# run_interval=322 don;t need it anymore for HA

# This allows you to modify the amperage in case the inverter is giving an incorrect
# reading compared to measurement tools.  Normally this will remain '1'
amperage_factor=1.0

# This allows you to modify the wattage in case the inverter is giving an incorrect
# reading compared to measurement tools.  Normally this will remain '1'
watt_factor=1.0


# The following settings allow you to modify runtime buffers.
# N.B. These values may not be applicable to all inverter t
Sun Feb 19 19:34:47 2023 DEBUG:  Current CRC: F8 54
Sun Feb 19 19:34:47 2023 DEBUG:  Send buffer hex bytes:  ( 51 50 49 52 49 f8 54 0d )
Sun Feb 19 19:34:47 2023 DEBUG:  8 bytes written, 8 bytes sent, 0 bytes remaining
Sun Feb 19 19:34:53 2023 DEBUG:  QPIRI read timeout
Sun Feb 19 19:34:53 2023 DEBUG:  Found reply <cr> at byte: 1
configuration options for the actual inverter polling process...top bytes.  Buffer: QPIRI�T

# The device to read from...
# Use: /dev/ttyS0 if you have a serial device,
#      /dev/ttyUSB0 if a USB<>Serial,
#      /dev/hidraw0 if you're connecting via the USB port on the inverter.

device=/dev/hidraw0

# How many times per hour is the program going to run...
# This is used to calculate the PV & Load Watt Hours between runs...
# If unsure, leave as default - it will run every minute...

# (120 = every 30 seconds)...
# run_interval=322 don;t need it anymore for HA

# This allows you to modify the amperage in case the inverter is giving an incorrect
# reading compared to measurement tools.  Normally this will remain '1'
amperage_factor=1.0

# This allows you to modify the wattage in case the inverter is giving an incorrect
# reading compared to measurement tools.  Normally this will remain '1'
watt_factor=1.0


# The following settings allow you to modify runtime buffers.
# N.B. These values may not be applicable to all inverter t
Sun Feb 19 19:34:53 2023 DEBUG:  Current CRC: B4 DA
Sun Feb 19 19:34:53 2023 DEBUG:  Send buffer hex bytes:  ( 51 50 49 57 53 b4 da 0d )
Sun Feb 19 19:34:53 2023 DEBUG:  8 bytes written, 8 bytes sent, 0 bytes remaining
Sun Feb 19 19:34:59 2023 DEBUG:  QPIWS read timeout
Sun Feb 19 19:34:59 2023 DEBUG:  Found reply <cr> at byte: 1
configuration options for the actual inverter polling process...top bytes.  Buffer: QPIWS��

# The device to read from...
# Use: /dev/ttyS0 if you have a serial device,
#      /dev/ttyUSB0 if a USB<>Serial,
#      /dev/hidraw0 if you're connecting via the USB port on the inverter.

device=/dev/hidraw0

# How many times per hour is the program going to run...
# This is used to calculate the PV & Load Watt Hours between runs...
# If unsure, leave as default - it will run every minute...

# (120 = every 30 seconds)...
# run_interval=322 don;t need it anymore for HA

# This allows you to modify the amperage in case the inverter is giving an incorrect
# reading compared to measurement tools.  Normally this will remain '1'
amperage_factor=1.0

# This allows you to modify the wattage in case the inverter is giving an incorrect
# reading compared to measurement tools.  Normally this will remain '1'
watt_factor=1.0


# The following settings allow you to modify runtime buffers.
# N.B. These values may not be applicable to all inverter t
Sun Feb 19 19:34:59 2023 DEBUG:  Start loop
Sun Feb 19 19:35:00 2023 DEBUG:  Start loop

Using the original @ned-kelly installation and setting the qpiri to 7 output said finished reading but gave NAK.

I am using a Voltronic Infinisolar V IV inverter and I would appreciate getting some advice on how to move forward.

The voltronic-mqtt container is healthy and the sensors are showing in HA with an unknown value.
I have also tried setting the baud rate to 2400 and to 9600 respectively with the same results.

Many thanks

Hi,

Need some help please using the @catalinbordan fork on a Rasp Pi and works great, been trying to install it onto an Orange Pi 3 LTS and when i run the Docker-compose build i get the following error

“[ 40%] Building CXX object CMakeFiles/inverter_poller.dir/inverter.cpp.o
/opt/inverter-cli/inverter.cpp: In member function ‘bool cInverter::query(const char*)’:
/opt/inverter-cli/inverter.cpp:154:29: warning: pointer of type 'void ’ used in arithmetic [-Wpointer-arith]
n = read(fd, (void
)buf+i, 120 - i);
^”

I can run the Inverter-poller but from docker exec command but it just goes into infinite loop

'Starting loop… and repeats

any ideas, is it security or some other apps missing ?

Thanks

Hi,
if I remember correctly there are some errors on compile, witch I did not had the skills to fix it, but it works. So OK.
‘Starting loop… and repeats’ can you be more specific? I’m guessing that you do not have connections with inverter/interface cable(it is not correctly installed in your board). check here
Also take in account that different board need to have different distributions. check the docker-compose yml and the beginning of this threads.

Try to change something in the settings of inverter, maybe a full restart; change something (settings) in the Wi-Fi app. and then try again…
I have found that the inverter stop to communicate without reason for me and another user here present here. Changing the settings in the inverter, it started again to communicate.
Also helps to reboot the board.

NAK = not accepted the command received.

Thanks will give it a try, and update here

While you around, my Inverter has two MPPT’s so need to read the QPIGS2 data how do i change the code to add this and get the mqtt data?

cheers

I found the problem, apparently this Courtois model can’t have both RS232 and LCD screen plugged at the same time. Have to unplug the LCD for the RS232 to communicate properly…

Thanks for your feedback, will test that out and come back if it works.

Hello
I have 3 x 11KW inverters running in parallel, will this work plugged into the master, or will i need 3 instances running?

Thanks
jody

probably 3 instances. look on this page, somebody already had done it.

What are your parameter qpiri qpigs…

HI, managed to plug in again, see below output - @catalinbordan any ideas as what i can try please?

Fri Mar 3 10:10:23 2023 DEBUG: QPIGS: incorrect buffer start/stop bytes. Buffer: 000.0 00.0 229.9 50.0 0966 0936 013 364 49.70 000 025 0054 01.4 205.7 00.00 00011 00010110 00 00 00293 010?
Fri Mar 3 10:10:23 2023 DEBUG: Current CRC: F8 54
Fri Mar 3 10:10:23 2023 DEBUG: Send buffer hex bytes: ( 51 50 49 52 49 f8 54 0d )
Fri Mar 3 10:10:23 2023 DEBUG: 8 bytes written, 8 bytes sent, 0 bytes remaining
Fri Mar 3 10:10:23 2023 DEBUG: 2 bytes read, 2 total bytes: 00 00 00 00 00 00 32 33
Fri Mar 3 10:10:23 2023 DEBUG: 12 bytes read, 14 total bytes: 33 31 2e 33 20 32 33 30
Fri Mar 3 10:10:23 2023 DEBUG: 12 bytes read, 26 total bytes: 30 2e 30 20 33 31 2e 33
Fri Mar 3 10:10:23 2023 DEBUG: 12 bytes read, 38 total bytes: 30 20 37 32 30 30 20 34
Fri Mar 3 10:10:23 2023 DEBUG: 1 bytes read, 39 total bytes: 20 37 32 30 30 20 34 38
Fri Mar 3 10:10:23 2023 DEBUG: 12 bytes read, 51 total bytes: 39 2e 30 20 34 37 2e 30
Fri Mar 3 10:10:23 2023 DEBUG: 12 bytes read, 63 total bytes: 30 20 35 33 2e 35 20 32
Fri Mar 3 10:10:23 2023 DEBUG: 12 bytes read, 75 total bytes: 30 36 30 20 30 20 32 20
Fri Mar 3 10:10:23 2023 DEBUG: 12 bytes read, 87 total bytes: 30 31 20 30 20 30 20 35
Fri Mar 3 10:10:23 2023 DEBUG: 12 bytes read, 99 total bytes: 30 20 31 20 31 32 30 20
Fri Mar 3 10:10:24 2023 DEBUG: 8 bytes read, 107 total bytes: 30 20 30 30 30 10 99 0d
Fri Mar 3 10:10:25 2023 DEBUG: Found reply at byte: 107
Fri Mar 3 10:10:25 2023 DEBUG: QPIRI: incorrect buffer start/stop bytes. Buffer: 230.0 31.3 230.0 50.0 31.3 7200 7200 48.0 49.0 47.0 54.0 53.5 2 30 060 0 2 2 9 01 0 0 52.0 0 1 120 0 000?
Fri Mar 3 10:10:25 2023 DEBUG: Current CRC: B4 DA
Fri Mar 3 10:10:25 2023 DEBUG: Send buffer hex bytes: ( 51 50 49 57 53 b4 da 0d )
Fri Mar 3 10:10:25 2023 DEBUG: 8 bytes written, 8 bytes sent, 0 bytes remaining
Fri Mar 3 10:10:25 2023 DEBUG: 2 bytes read, 2 total bytes: 00 00 00 00 00 00 30 30
Fri Mar 3 10:10:25 2023 DEBUG: 12 bytes read, 14 total bytes: 30 30 30 30 30 30 30 30
Fri Mar 3 10:10:25 2023 DEBUG: 12 bytes read, 26 total bytes: 30 30 30 30 30 30 30 30
Fri Mar 3 10:10:25 2023 DEBUG: 1 bytes read, 27 total bytes: 30 30 30 30 30 30 30 30
Fri Mar 3 10:10:25 2023 DEBUG: 12 bytes read, 39 total bytes: 31 30 30 30 30 18 f6 0d
Fri Mar 3 10:10:26 2023 DEBUG: Found reply at byte: 39
Fri Mar 3 10:10:26 2023 DEBUG: QPIWS: incorrect buffer start/stop bytes. Buffer: 000001000000000000000000000000010000?
Fri Mar 3 10:10:26 2023 DEBUG: Start loop
Fri Mar 3 10:10:27 2023 DEBUG: Start loop
Fri Mar 3 10:10:28 2023 DEBUG: Start loop
Fri Mar 3 10:10:29 2023 DEBUG: Start loop
Fri Mar 3 10:10:30 2023 DEBUG: Start loop
Fri Mar 3 10:10:31 2023 DEBUG: Start loop
Fri Mar 3 10:10:32 2023 DEBUG: Start loop
Fri Mar 3 10:10:33 2023 DEBUG: Start loop

Noticed QMOD seems correct…?

Fri Mar 3 10:10:20 2023 INVERTER: Debug set
Fri Mar 3 10:10:20 2023 DEBUG: Current CRC: 49 C1
Fri Mar 3 10:10:20 2023 DEBUG: Send buffer hex bytes: ( 51 4d 4f 44 49 c1 0d )
Fri Mar 3 10:10:20 2023 DEBUG: 7 bytes written, 7 bytes sent, 0 bytes remaining
Fri Mar 3 10:10:20 2023 DEBUG: 4 bytes read, 4 total bytes: 00 00 00 00 28 42 e7 c9
Fri Mar 3 10:10:20 2023 DEBUG: 1 bytes read, 5 total bytes: 00 00 00 28 42 e7 c9 0d
Fri Mar 3 10:10:21 2023 DEBUG: Found reply at byte: 5
Fri Mar 3 10:10:21 2023 DEBUG: QMOD: 5 bytes read: (B
Fri Mar 3 10:10:21 2023 DEBUG: QMOD query finished
Fri Mar 3 10:10:21 2023 DEBUG: Current CRC: B7 A9
Fri Mar 3 10:10:21 2023 DEBUG: Send buffer hex bytes: ( 51 50 49 47 53 b7 a9 0d )
Fri Mar 3 10:10:21 2023 DEBUG: 8 bytes written, 8 bytes sent, 0 bytes remaining
Fri Mar 3 10:10:21 2023 DEBUG: 2 bytes read, 2 total bytes: 00 00 00 00 00 00 30 30
Fri Mar 3 10:10:22 2023 DEBUG: 12 bytes read, 14 total bytes: 30 30 2e 30 20 32 32 39
Fri Mar 3 10:10:22 2023 DEBUG: 12 bytes read, 26 total bytes: 30 2e 30 20 30 39 36 36
Fri Mar 3 10:10:22 2023 DEBUG: 13 bytes read, 39 total bytes: 20 30 31 33 20 33 36 34
Fri Mar 3 10:10:22 2023 DEBUG: 12 bytes read, 51 total bytes: 37 30 20 30 30 30 20 30
Fri Mar 3 10:10:22 2023 DEBUG: 12 bytes read, 63 total bytes: 30 35 34 20 30 31 2e 34
Fri Mar 3 10:10:22 2023 DEBUG: 12 bytes read, 75 total bytes: 2e 37 20 30 30 2e 30 30
Fri Mar 3 10:10:22 2023 DEBUG: 12 bytes read, 87 total bytes: 31 31 20 30 30 30 31 30
Fri Mar 3 10:10:22 2023 DEBUG: 12 bytes read, 99 total bytes: 30 30 20 30 30 20 30 30
Fri Mar 3 10:10:22 2023 DEBUG: 10 bytes read, 109 total bytes: 33 20 30 31 30 04 a6 0d
Fri Mar 3 10:10:23 2023 DEBUG: Found reply at byte: 109
Fri Mar 3 10:10:23 2023 DEBUG: QPIGS: incorrect buffer start/stop bytes. Buffer: 000.0 00.0 229.9 50.0 0966 0936 013 364 49.70 000 025 0054 01.4 205.7 00.00 00011 00010110 00 00 00293 010?

Need a bit more assistance with this one guys.

My issue is the steps needed to get this working on reboot, 2 parts to this.

How can I get this container to start AFTER everything else, as I have to restarted it once HA is up and MQTT is listening properly (I have portainer if that helps).

How can I set the serial port details on boot because this just will not listen to data unless I run minicomm manually after each boot with 9600 8N1 port details, once I do that then exit minicomm then data will flow to the container.

Thx