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!

I can see the topics have been crated but no data been sent.

Does this have anything to do with it?
mrmiles@solarsummerhouse:/opt/ha-inverter-mqtt-agent $ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0c3766ebcae8 containrrr/watchtower “/watchtower --inter…” 3 hours ago Up 43 seconds 8080/tcp watchtower
f1b3106fd748 bushrangers/ha-voltronic-mqtt “/bin/bash /opt/inve…” 3 hours ago Up 43 seconds (health: starting) voltronic-mqtt
mrmiles@solarsummerhouse:/opt/ha-inverter-mqtt-agent $ sudo docker exec -it voltronic-mqtt bash -c ‘/opt/inverter-cli/bin/inverter_poller -d -r QPIRI’
Fri Jun 17 18:20:19 2022 INVERTER: Debug set
Fri Jun 17 18:20:19 2022 INVERTER: Current CRC: F8 54
Fri Jun 17 18:20:22 2022 INVERTER: QPIRI read timeout
Fri Jun 17 18:20:22 2022 INVERTER: QPIRI reply too short (0 bytes)
Reply:
mrmiles@solarsummerhouse:/opt/ha-inverter-mqtt-agent $ sudo docker exec -it voltronic-mqtt bash -c ‘/opt/inverter-cli/bin/inverter_poller -d -r QPIGS’
Fri Jun 17 18:20:35 2022 INVERTER: Debug set
Fri Jun 17 18:20:35 2022 INVERTER: Current CRC: B7 A9
Fri Jun 17 18:20:38 2022 INVERTER: QPIGS read timeout
Fri Jun 17 18:20:38 2022 INVERTER: QPIGS reply too short (0 bytes)
Reply:
mrmiles@solarsummerhouse:/opt/ha-inverter-mqtt-agent $ sudo docker exec -it voltronic-mqtt bash -c ‘/opt/inverter-cli/bin/inverter_poller -d -r QMOD’
Fri Jun 17 18:20:47 2022 INVERTER: Debug set
Fri Jun 17 18:20:47 2022 INVERTER: Current CRC: 49 C1
Fri Jun 17 18:20:50 2022 INVERTER: QMOD read timeout
Fri Jun 17 18:20:50 2022 INVERTER: QMOD reply too short (0 bytes)
Reply:
mrmiles@solarsummerhouse:/opt/ha-inverter-mqtt-agent $ sudo docker exec -it voltronic-mqtt bash -c ‘/opt/inverter-cli/bin/inverter_poller -d -r QPIWS’
Fri Jun 17 18:20:59 2022 INVERTER: Debug set
Fri Jun 17 18:20:59 2022 INVERTER: Current CRC: B4 DA
Fri Jun 17 18:21:02 2022 INVERTER: QPIWS read timeout
Fri Jun 17 18:21:02 2022 INVERTER: QPIWS reply too short (0 bytes)
Reply:
mrmiles@solarsummerhouse:/opt/ha-inverter-mqtt-agent $

I’m using USB cable direct to inverter and have this configured in the inv
device=/dev/hidraw0

Hello @byte4geek,
Thanks for your reply.

What cable are you using?
With the inverter comes a rs232 cable (picture below), are you connecting this cable to a rs232 module and then to the RPi?
image

So I think I have managed to move this forward.

I have used this fork https://github.com/gadget78/inverter-homeassistant and managed to get the device to be seen in-home assistant.

all my sensor info is unknown. when running
sudo docker exec -it inverter bash -c ‘/opt/inverter-cli/bin/inverter_poller -d -1’

I get the following

Fri Jun 17 20:43:52 2022 INVERTER: Debug set
Fri Jun 17 20:43:52 2022 INVERTER: Current CRC: 49 C1
Fri Jun 17 20:43:55 2022 INVERTER: QMOD read timeout
Fri Jun 17 20:43:55 2022 INVERTER: QMOD reply too short (0 bytes)
Fri Jun 17 20:43:55 2022 INVERTER: Current CRC: B7 A9
Fri Jun 17 20:43:58 2022 INVERTER: QPIGS read timeout
Fri Jun 17 20:43:58 2022 INVERTER: QPIGS reply too short (0 bytes)
Fri Jun 17 20:43:58 2022 INVERTER: Current CRC: F8 54
Fri Jun 17 20:44:01 2022 INVERTER: QPIRI read timeout
Fri Jun 17 20:44:01 2022 INVERTER: QPIRI reply too short (0 bytes)
Fri Jun 17 20:44:01 2022 INVERTER: Current CRC: B4 DA
Fri Jun 17 20:44:04 2022 INVERTER: QPIWS read timeout
Fri Jun 17 20:44:04 2022 INVERTER: QPIWS reply too short (0 bytes)
Fri Jun 17 20:44:09 2022 INVERTER: Current CRC: 49 C1
Fri Jun 17 20:44:12 2022 INVERTER: QMOD read timeout
Fri Jun 17 20:44:12 2022 INVERTER: QMOD reply too short (0 bytes)
Fri Jun 17 20:44:12 2022 INVERTER: Current CRC: B7 A9
Fri Jun 17 20:44:15 2022 INVERTER: QPIGS read timeout
Fri Jun 17 20:44:15 2022 INVERTER: QPIGS reply too short (0 bytes)
Fri Jun 17 20:44:15 2022 INVERTER: Current CRC: F8 54
Fri Jun 17 20:44:18 2022 INVERTER: QPIRI read timeout
Fri Jun 17 20:44:18 2022 INVERTER: QPIRI reply too short (0 bytes)
Fri Jun 17 20:44:18 2022 INVERTER: Current CRC: B4 DA
Fri Jun 17 20:44:21 2022 INVERTER: QPIWS read timeout
Fri Jun 17 20:44:21 2022 INVERTER: QPIWS reply too short (0 bytes)

Can anyone help me with this?

Hello @catalinbordan,

I was trying to use your fork but during the installation I’ve get this error:

I don’t if it is related, but my docker is unhealthy since from the beginning.

Thanks

Edit:

My server IP was incorrect, now I’m getting “healthy” in docker status.
And I’m also getting data in HA! :wink:

Let’s see how it goes, since with the original fork I was getting some freezes after some time.

Btw, this is what I’m getting from the Warnings:

Thanks

Hi, in post 456 I used gadget78 fork, and I installed it again and when execute cat /dev/ttyUSB0 working like on screenshot in post 456.

After 2h it freezes!!! :confused:
The docker status remains “healthy”.

I think the last solution I have is to connect like @byte4geek did, through rs232 and abandon usb direct cable.

@catalinbordan Is there any debug That I can do to understand what is happening?
Thanks

Time out, not OK. Bad connection to Inverter/bad fixed response

There is an adapter from serial to USB. You need to buy a good one
Post 503:
You have pdf in fork for understanding warnings. First digit from left if I remember correctly it is reserved. But you should count according pdf. You probably have an error on Inverter.
In my fork you have an example of sensor to put in HA for translate the codes for warnings
Post 505:
I think there is commands for docker for logging in general
And for this exactly you can type - help to see the options for test pulling command
Also may be an issue with my fork for some Inverters because of pulling time to fast causing to freeze the Inverter interface. I have 7 seconds, ned Kelly have 30s. You can clone, or modify locally my fork to test.

Same. No improve. Bad connection

I can not post 3 posts consecutively.
@icedog what about:
sudo docker exec -it voltronic-mqtt bash -c ‘/opt/inverter-cli/bin/inverter_poller -d -r QPI’

nope friend, my seller say to me that the usb port is unstable, use the rs232 please, i have no disconnection ever.
After you lost connection check if is present or not on the raspberry host the file /dev/hidraw0, if the file is not present, the usb port on the inverter was crashed.
The warning code you say is “PV loss”, see the protocol datasheet to learn how to decode the warning code (page 8) doc below.

What can I do about this “Time out, not OK. Bad connection to Inverter/bad fixed response”
As I’m on a raspberry pi do I need to allow the USB connection through the docker container?

Do I need to try a USB to serial? I do have one that i’m trying but I can’t see it in /dev/ttyUSB0

what am I doing so wrong, I have an Iconica ICMP100012.

Any help would be much appreciated, please.

Hi, that’s result. Is there any way to calculate what values should be entered on QPIWS and QPIRI?

I don’t know. did you find/know your inverter fixed responses? because that fork relies on fixed response.
nothing with ttyUSB0/1/2…?

this is good and bad in same time.
good because response it is protocol PI30. This program works on this protocol.
bad because I don’t know why it is not working for you.

If you have an rs232 to ttl converter and a esp board you can also try integration from esphome.
any how search this site maybe you will find somebody with a solution.

sorry, how would I find the fix response?

Hi Andre
I have the same inverter(exactly a clone- Easun IGridSV-IV5.6KW) and a free raspbery py 3 so I could try your setup on my configuration.
I need an image of your inverter py card - maybe on some file sharring.
Maybe others could help on this issue by having an easyer acces to the problem.
Regards

1 Like

Sorry to keep posting, I have just brought a new serial to usb adapter as I wasn’t seeing ttyUSB0 when using my old cable.

The new cable appears straight away under /dev/
I have completely removed and readded the image and configured the inventer.conf to use ttyUSB0
I’m still seeing unknown in home assistant but when running

sudo docker exec -it inverter bash -c ‘/opt/inverter-cli/bin/inverter_poller -d -1’

I see the following. is there something I’m missing?

The following settings allow you to modify runtime buffers.

N.B. These values may not be applicable to all inverter types, as such you will

need

Sun Jun 19 19:06:56 2022 INVERTER: Current CRC: B7 A9
Sun Jun 19 19:06:59 2022 INVERTER: QPIGS read timeout
Sun Jun 19 19:07:00 2022 INVERTER: QPIGS reply too short (7 bytes)
Sun Jun 19 19:07:00 2022 INVERTER: Current CRC: F8 54
Sun Jun 19 19:07:03 2022 INVERTER: QPIRI read timeout
Sun Jun 19 19:07:04 2022 INVERTER: QPIRI reply too short (7 bytes)
Sun Jun 19 19:07:04 2022 INVERTER: Current CRC: B4 DA
Sun Jun 19 19:07:07 2022 INVERTER: QPIWS read timeout
Sun Jun 19 19:07:08 2022 INVERTER: QPIWS reply too short (7 bytes)
Sun Jun 19 19:07:13 2022 INVERTER: Current CRC: 49 C1
Sun Jun 19 19:07:16 2022 INVERTER: QMOD read timeout
Sun Jun 19 19:07:16 2022 INVERTER: QMOD reply too short (0 bytes)
Sun Jun 19 19:07:16 2022 INVERTER: Current CRC: B7 A9
Sun Jun 19 19:07:19 2022 INVERTER: QPIGS read timeout
Sun Jun 19 19:07:19 2022 INVERTER: QPIGS reply too short (14 bytes)
Sun Jun 19 19:07:19 2022 INVERTER: Current CRC: F8 54
Sun Jun 19 19:07:22 2022 INVERTER: QPIRI read timeout
Sun Jun 19 19:07:23 2022 INVERTER: QPIRI reply too short (0 bytes)
Sun Jun 19 19:07:23 2022 INVERTER: Current CRC: B4 DA
Sun Jun 19 19:07:26 2022 INVERTER: QPIWS read timeout
Sun Jun 19 19:07:27 2022 INVERTER: QPIWS reply too short (7 bytes)
Sun Jun 19 19:07:32 2022 INVERTER: Current CRC: 49 C1
Sun Jun 19 19:07:33 2022 INVERTER: QMOD reply size (5 bytes)
NAKssun 19 19:07:33 2022 INVERTER: QMOD: incorrect start/stop bytes. Buffer: (NAKs▒
uration options for the actual inverter polling process…

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/ttyUSB0

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=120

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

Did you try the python script was i wrote?

on the raspberry create a file with name test_my_com.py with inside:

import serial

serialport = serial.Serial("/dev/ttyUSB0", 2400, timeout=0.5)
        
serialport.write(b"QMOD 4\r")
response = serialport.readlines(None)
print(response)

serialport.write(b"QPIGS 5\r")
response = serialport.readlines(None)
print(response)

stop the container with sudo docker-compose down

then run:

python test_my_com.py

NOTE: If don’t have python3 on raspberry, install it and import serial python lib, with pip install pyserial

and try to see if the output is like this below:

pi@solarpi:~ $ python test_my_com.py
['(B\xe7\xc9\r']
['(228.9 50.0 230.0 50.0 0552 0446 009 425 54.40 000 077 0047 01.5 351.8 00.00 00000 00010010 00 00 00541 110\xfe7\r']

1 Like

Hello @catalinbordan and @byte4geek,

I think I finally made it, I had a rs232-usb cable that I connected to the rj45-rs232 inverter cable, and for now the data is reaching well to HA.

I was reading (again) all this topic and found some useful information that led me to success:
sudo stty -F /dev/ttyUSB0 sane (to first clean all the settings)
sudo stty -F /dev/ttyUSB0 2400 raw -echo (without the first command this one did not work)
cat /dev/ttyUSB0 (to confirm that data is passing by the rs232 usb adapter)

@catalinbordan
In this post you mention that you had changed the “readme” file with your instructions, but looking at your github page it remains the same as the ned-kelly.

@byte4geek
My final step is to learn all the necessary things to implement your python script at boot.

Thanks guys!

Hi @Andre_Magro ,
Glad you figure out!
My instructions was at the end of readme :slight_smile: I have also updated the heather.

1 Like