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!

Don’t mind already fix the problem

Hi everyone

I seem to have run into an issue which has already been closed on github.

I get the following when connecting my Axpert 3kVa 24V inverter via USB to RPi3B+.

Wed Mar 31 11:44:16 2021 INVERTER: QPIRI reply size (98 bytes)
Wed Mar 31 11:44:16 2021 INVERTER: QPIRI: incorrect start/stop bytes.  Buffer: (230.0 13.0 230.0 50.0 13.0 3000 3000 24.0 24.0 21.0 28.8 27.6 2 30 30 0 0 0 - 01 1 0 27.0 0 0?W

I have checked and my qpiri bytes are already set in inverter.conf to 98. What else can I do?
any help would be greatly appreciated! Thank you for this awesome project/product!

Can be your QPIRI is different from 98…because updated/newer Inverter Firmware have different Qpiri …display more data(probably).
For example Pip 5048Mg Fw 71.85 have Qpiri 103…instead of 102.
Try 99…100…101…102…103 …you should got it.

Sorry if I am understanding you wrong. I thought the response coming from the inverter showed reply size is indeed 98 bytes? That is why my inverter.conf has 98 set as a config value. So are you saying the line

Wed Mar 31 11:44:16 2021 INVERTER: QPIRI reply size (98 bytes)

is not the response line from the inverter?

The response line is also this:
Wed Mar 31 11:44:16 2021 INVERTER: QPIRI: incorrect start/stop bytes. Buffer: (230.0 13.0 230.0 50.0 13.0 3000 3000 24.0 24.0 21.0 28.8 27.6 2 30 30 0 0 0 - 01 1 0 27.0 0 0?W
and say :incorrect start/stop bytes.

Try 99…100…102…103…104
should be fine

Thank you. What I did now was to change the value from 99 all the way up to 104 in config/inverter.conf and then run the docker exec -it voltronic-mqtt bash -c '/opt/inverter-cli/bin/inverter_poller -d -1' command. Every time it would complain with the same error messages as above. When I change it to 105, then I get:

Wed Mar 31 15:41:54 2021 INVERTER: QPIRI read timeout
Wed Mar 31 15:41:54 2021 INVERTER: QPIRI reply too short (104 bytes)

Abstract:some inverter shows new value in Qpigs answer,
As x this issue https://github.com/ned-kelly/docker-voltronic-homeassistant/issues/40

Now have a new update patch to get new data entry from Inverter to Home Assistant.:this data entry is :Pv_Imput Watt…(01539)…not all inversters display this data!

Thu Feb 25 06:34:09 2021 INVERTER: QPIGS: 110 bytes read: (231.6 50.0 229.9 49.9 0436 0367 008 418 54.10 018 069 0062 0018 329.6 00.00 00000 00010010 00 00 01539 010

“Out_source_priority”:2,
“Charger_source_priority”:1,
“Battery_redischarge_voltage”:-0.3,
“Warnings”:“000000000000000000000000000000000000”
“PV_input_watts”:“1539”

I post the process how to do the update…for everybody need to update,and expecially for those, like me, are not so expert users. The diff includes the changes in docker files for a local build.

  1. cd /opt/ha-inverter-mqtt-agent:
    2.sudo docker-compose down
    3.copy inverter.conf from opt/ha-inverter-mqtt-agent/config to
    opt/ha-inverter-mqtt-agent/sources/inverter-cli,and overwrite the inverter.conf already exist in inverter-cli directory.
    Rememeber:you must first set Usb or Serial port,Qpiri,Qpigs ecc in inverter.conf file before copying and overwriting inverter.conf file in inverter-cli directory

  2. sudo wget https://skyboo.net/temp/ha_local_docker_build_v2.diff

  3. sudo patch -p1 < ha_local_docker_build_v2.diff

  4. sudo docker-compose build

  5. sudo docker-compose up -d

Thanks to Manio for developing this test patched inverter-cli
and TheRoarman for developing the patched docker file
And Ned-Kelly for this fantastic program.

2 Likes

mmmm… try 106…or 97

97 was the MAGIC NUMBER! Thank you so much! I assume from this output:

INVERTER: wattfactor from config is 1.01
{
  "Inverter_mode":3,
  "AC_grid_voltage":220.0,
  "AC_grid_frequency":49.7,
  "AC_out_voltage":220.0,
  "AC_out_frequency":49.7,
  "PV_in_voltage":0.0,
  "PV_in_current":0.0,
  "PV_in_watts":0.0,
  "PV_in_watthour":0.0000,
  "SCC_voltage":25.1400,
  "Load_pct":6,
  "Load_watt":183,
  "Load_watthour":6.1000,
  "Load_va":242,
  "Bus_voltage":476,
  "Heatsink_temperature":452,
  "Battery_capacity":100,
  "Battery_voltage":27.57,
  "Battery_charge_current":0,
  "Battery_discharge_current":0,
  "Load_status_on":1,
  "SCC_charge_on":0,
  "AC_charge_on":1,
  "Battery_recharge_voltage":24.0,
  "Battery_under_voltage":21.0,
  "Battery_bulk_voltage":28.8,
  "Battery_float_voltage":27.6,
  "Max_grid_charge_current":30,
  "Max_charge_current":30,
  "Out_source_priority":0,
  "Charger_source_priority":0,
  "Battery_redischarge_voltage":27.0,
  "Warnings":"00000000000000000000000000000000"
}

EDIT: This is a battery backup system, so don’t read too much into the fact that there are zero PV details in that output.

Is it possible to use this to read values from multiple inverters in the same system? For example 2 x 5kW Axpert inverters connected together for 10kW? Or would you need to set up 2 monitoring instances and aggregate the data in grafana somehow?
@ned-kelly thank you VERY much for this awesome piece of software!

Hi @NicolaT

I have tested the standalone command (inverter-poller) that I compiled on a Rpi, on a friend’s system. He has 4 x Axperts all running in the same system. Whilst running the poller it seemed in terms of load and wattage, only the values of the single connected inverter is measured. Although battery voltage etc showed the complete bank (of course voltage will stay the same) the load and PV watts in showed only a fraction of what the total system measured on ICC. So if there is indeed a way, I too am looking for an answer.

Hi @hanserasmus,

Finally I have been using Solar-Assistant.io that is amazing!

Regards,
Alex.

I’m trying to get this thing to work without success. I’m a long time hass.io and mqtt user so things are setup fine on that poit.
Not a linux guru tough, I’we been testing for a couple of days now and I can publish mqtt packages from my raspberry pi zerow to my mqtt broker on hass but the inverter mqtt stuff just dont work.

So I just tested running the mqtt-init.sh script to see what’s wrong and immediately I found a problem. The script assumes that the mqtt.json file is in the folder /etc/inverter but however I go about building or just importing the docker I always end up with the files in the folder /opt/ha-inverter-mqtt-agent/config/

Why is this and how many scripts does this affect?

I changed the folders manually but end up with this:
./mqtt-init.sh: line 5: jq: command not found

Br. Carl

Glad to hear that. I have figured out that one would need a container for each inverter. And each of those containers will run to either each of their own influx databases, and then you aggregate the data into graphs in Grafana, or one can have them write to the same db, just make sure each inverter has its own keys.

Hi!

I have tried to have this awesome piece of work up and running on my Raspberry Pi3+ but I can not make it fully working. My inverter is Axpert 7048 with USB communication.

What have I done:
Installed Raspian Lite with SSH and WiFi, updated and upgraded
Installed Docker, Docker-Compose and Git
Installed Home Assistant and Mosquitto (everything is set on one Raspberry Pi3+, Mosquitto server is set to 0.0.0.0, port 1883, without username and password)
Installed ha-voltronic-mqtt, set it to /dev/hidraw0, QPIRI=108, QPIWS=40, QMOD=5, QPIGS=110.

Docker shows bushrangers/ha-voltronic-mqtt to be unhealthy. Why is that?

Thank you in advance

Hi @infernocs,

Remember the container runs on a different folder structure to outside of the container. Thus you will see differences as you did. The container also has utilities installed that is not installed in our base OS installation. jq is one of them. You will need to install jq on your base OS if you want to run those scripts from the OS and not inside of the container.

Thanks, yeah I suspected that I was missing something. Have been studying docker and mqtt over easter and have a bit more knowledge now.
I’we been trying to log into the docker container with sudo docker attach voltronic-mqtt but this does not seem to work.
As someone mentioned before this can be used to read from the inverter:
sudo docker exec -it voltronic-mqtt bash -c ‘/opt/inverter-cli/bin/inverter_poller -d -1’
And it works fine, but I just cant seem to figure out what other commands can be used to test the functions.
What I would like to do is test the mqtt publish and get an output to see if the mqtt.json ip address is specified in the right way.
{
“server”: “10.0.1.250”,
“port”: “1883”,
“topic”: “homeassistant”,
“devicename”: “voltronic”,
“username”: “homeassistant”,

Mine looks like this but I’m not sure If I need the [] around the IP address or not.
Anyone know how to run more of the read/send commands by hand?
This is a great system I’m sure but troubleshooting is really hard for me.

I installed mqtt onto the base system and I can publish to my hassio server so I know the connection (IP/username/pwd) is correct.

EDIT

I think it was working all the time, I don’t get any mqtt entities into my system but they still show up under entities. I have no idea how but they are there now.

Did you check if you can reach the MQTT instance? I have found it best to make sure that the docker container can reach stuff on the interface IP, like 192.168.10.10 rather than localhost or 0.0.0.0.

He there, i just finished a native esphome-variant… i will clean it up and try to get it approved… so it is a native esphome and therefor HA component.
have a look at https://github.com/esphome/esphome/pull/1664 and https://github.com/esphome/esphome-docs/pull/1084

4 Likes

mmm…good Idea…
…did you put “PV_input_watts”:“1539” from QPIGS ?
Thu Feb 25 06:34:09 2021 INVERTER: QPIGS: 110 bytes read: (231.6 50.0 229.9 49.9 0436 0367 008 418 54.10 018 069 0062 0018 329.6 00.00 00000 00010010 00 00 01539 010
“Out_source_priority”:2,
“Charger_source_priority”:1,
“Battery_redischarge_voltage”:-0.3,
“Warnings”:“000000000000000000000000000000000000”
“PV_input_watts”:“1539”

How to connect to Esp8266?