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!

Dear @catalinbordan ,

many thanks for your usual help,

the command worked but i noticed that it changes the value for seconds and returns to the previous one.
any idea what could be the issue

Hi,
It could be many reasons: busy/unresponsive Invertor, command not received…
You have an entity for command, what’s the state?
It should be something like this :
[PBFT57.0] [Attempt 1] [Reply: ACK]
First it is your command.
Ack means accepted

It is not perfect,
Sometime you have keep sending the command multiple times.
My Inverter for example do not want to change float voltage when it is in float mode. It say accepted, it change the setting but it do not work with new setting. Do not know why…

Hello,

yes i can notice the ACK when i send the command it do an attempt several times and returns back to the old state .

/opt/ha-inverter-mqtt-agent# sudo docker-compose build
Building voltronic-mqtt
Step 1/8 : FROM debian:stretch
 ---> 6e15796b459e
Step 2/8 : RUN apt update && apt install -y         curl         git         build-essential         cmake         jq         mosquitto-clients
 ---> Running in dd6b0317a664

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Ign:1 http://security.debian.org/debian-security stretch/updates InRelease
Err:2 http://security.debian.org/debian-security stretch/updates Release
  404  Not Found [IP: 151.101.2.132 80]
Ign:3 http://deb.debian.org/debian stretch InRelease
Ign:4 http://deb.debian.org/debian stretch-updates InRelease
Err:5 http://deb.debian.org/debian stretch Release
  404  Not Found
Err:6 http://deb.debian.org/debian stretch-updates Release
  404  Not Found
Reading package lists...
E: The repository 'http://security.debian.org/debian-security stretch/updates Release' does not have a Release file.
E: The repository 'http://deb.debian.org/debian stretch Release' does not have a Release file.
E: The repository 'http://deb.debian.org/debian stretch-updates Release' does not have a Release file.
ERROR: Service 'voltronic-mqtt' failed to build: The command '/bin/sh -c apt update && apt install -y         curl         git         build-essential         cmake         jq         mosquitto-clients' returned a non-zero code: 100

This is what i’m getting.

any pointers please

FWIW, using this tool: GitHub - b48736/axpert-monitor: Monitor Voltronic/Axpert inverter via USB
i am ale to get information from querying the inverter

axpert-query -c QPIGS -p /dev/ttyUSB0
Sending command: QPIGS
{
  "gridVoltage": 197,
  "gridFrequency": 50,
  "outputVoltage": 197,
  "outputFrequency": 50,
  "outputPowerApparent": 0,
  "outputPowerActive": 274,
  "outputLoadPercent": 0,
  "busVoltage": 401,
  "batteryVoltage": 26.7,
  "batteryChargingCurrent": 6,
  "batteryCapacity": 100,
  "temperature": 26,
  "pvBatteryCurrent": 0,
  "pvInputVoltage": 182,
  "batteryVoltageSCC": 26.7,
  "batteryDischargeCurrent": 0,
  "status": {
    "addSBUPriorityVersion": false,
    "configChanged": false,
    "sccFirmwareUpdates": false,
    "loadOn": true,
    "batteryVoltToSteady": false,
    "charging": true,
    "chargingSCC": true,
    "chargingAC": false
  },
  "pvPower": 0
}
axpert-query -c QPIRI -p /dev/ttyUSB0
Sending command: QPIRI
{
  "gridVoltage": 230,
  "gridCurrent": 20,
  "outputVoltage": 230,
  "outputFrequency": 50,
  "outputCurrent": 20,
  "outputPowerApparent": 3000,
  "outputPowerActive": 3000,
  "batteryVoltage": 24,
  "batteryVoltageRecharge": 22.5,
  "batteryVoltageUnder": 22.5,
  "batteryVoltageBulk": 28.8,
  "batteryVoltageFloat": 27.2,
  "batteryType": "User",
  "chargingCurrentMaxAC": 60,
  "chargingCurrentMaxTotal": 6,
  "inputVoltageRange": "UPS",
  "outputSourcePriority": "[UtI] Utility first",
  "chargeSourcePriority": "[CSO] Solar first",
  "parallelMax": 6,
  "inverterType": "Off Grid",
  "topology": "Transformerless",
  "outputMode": "Transformerless",
  "batteryVoltageRedischarge": 52,
  "pvOK": "At least one",
  "pvPowerBalance": "Max charge current plus load"
}

@catalinbordan , I try to run your fork but at build stage I got an error:

3.854 Ign:1 …security.debian.org/debian-security stretch/updates InRelease
3.877 Ign:2 …deb.debian.org/debian stretch InRelease
3.883 Err:3 …security.debian.org/debian-security stretch/updates Release
3.883 404 Not Found [IP: 151.101.66.132 80]
3.902 Ign:4 …deb.debian.org/debian stretch-updates InRelease
3.929 Err:5 Index of /debian stretch Release
3.929 404 Not Found
3.955 Err:6 Index of /debian stretch-updates Release
3.955 404 Not Found

I found a solution:

Add in Dockerfile.dev (after “FROM debian:stretch”):

# Update stretch repositories
RUN sed -i -e ‘s/deb.debian.org/archive.debian.org/g’
-e ‘s|security.debian.org|archive.debian.org/|g
-e ‘/stretch-updates/d’ /etc/apt/sources.list

1 Like

Please can anyone outline how to get the MQTT data into emoncms instead of Home Assistant?

Thank you

Have you found any more info in the meantime?

I’m using a axpert voltronic vm III connected via ttyUSB0 (serial)

Having issues with corrupted/misconfigured data. When I first set it up it worked, but sometime later it the data just got corrupted without touching anything. Tried setting baud rate to 2400 raw as well as 9600 but it still gives corrupted data like this

solar@solar:~$ sudo stty -F /dev/ttyUSB0 sane
solar@solar:~$ sudo stty -F /dev/ttyUSB0 2400 raw -echo
solar@solar:~$ sudo cat /dev/ttyUSB0
(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((000001000000000000000000000000000000��4.0 24.0 22.5 30.4 26.9 2 60 080 1 0 2 1 01 0 0 00.0 0 1)"

Can someone advise please!

Please how do i debug the cause of this when i try to use your fork
I’ll appreciate any help.

@catalinbordan

pi@raspberrypi:/opt/ha-inverter-mqtt-agent $ sudo docker compose up
[+] Running 1/1
 ✔ Container voltronic-mqtt  Created                                                                                    0.3s 
Attaching to voltronic-mqtt
voltronic-mqtt  | Error: Connection refused

sometimes I receive the data, sometimes I don’t and it’s usually in bursts. I really have no idea why. Does Bluetooth interfere with the data output from the serial port?

Anyone using this with EG4 inverters? I just purchased a 3kw off-grid inverter with a 48v 100 amp/hr LiFeP battery.

another cable? usually usb-serial converter can create problems

i have a problem after installing according to the instructions. when i use the command : sudo docker exec -it voltronic-mqtt bash -c ‘/opt/inverter-cli/bin/inverter_poller -d -1’
I have it installed on raspberry pi zero 2W and os: raspbian
i have inverter easy grid sv4
and use it:GitHub - catalinbordan/docker-voltronic-homeassistant: Programmatically read data from your Voltronic, Axpert, Mppsolar PIP, Voltacon, Effekta etc Inverter and send it to Home Assistant via MQTT - Works with RS232 & USB!

I keep getting this over and over again:

raspberrypi:/opt/ha-inverter-mqtt-agent $ sudo docker exec -it voltronic-mqtt bash -c ‘/opt/inverter-cli/bin/inverter_poller -d -1’
Sun Sep 17 17:14:14 2023 INVERTER: Debug set
Sun Sep 17 17:14:14 2023 DEBUG: Current CRC: 49 C1
Sun Sep 17 17:14:14 2023 DEBUG: Send buffer hex bytes: ( 51 4d 4f 44 49 c1 0d )
Sun Sep 17 17:14:14 2023 DEBUG: 7 bytes written, 7 bytes sent, 0 bytes remaining
Sun Sep 17 17:14:14 2023 DEBUG: 8 bytes read, 8 total bytes: 28 4e 41 4b 73 73 0d 00
Sun Sep 17 17:14:14 2023 DEBUG: Found reply at byte: 7
Sun Sep 17 17:14:14 2023 DEBUG: QMOD: 8 bytes read: (NAK
Sun Sep 17 17:14:14 2023 DEBUG: QMOD query finished
Sun Sep 17 17:14:14 2023 DEBUG: Current CRC: B7 A9
Sun Sep 17 17:14:14 2023 DEBUG: Send buffer hex bytes: ( 51 50 49 47 53 b7 a9 0d )
Sun Sep 17 17:14:14 2023 DEBUG: 8 bytes written, 8 bytes sent, 0 bytes remaining
Sun Sep 17 17:14:14 2023 DEBUG: 8 bytes read, 8 total bytes: 28 4e 41 4b 73 73 0d 00
Sun Sep 17 17:14:14 2023 DEBUG: Found reply at byte: 7
Sun Sep 17 17:14:14 2023 DEBUG: QPIGS: 8 bytes read: (NAK
Sun Sep 17 17:14:14 2023 DEBUG: QPIGS query finished
Sun Sep 17 17:14:14 2023 DEBUG: Current CRC: F8 54
Sun Sep 17 17:14:14 2023 DEBUG: Send buffer hex bytes: ( 51 50 49 52 49 f8 54 0d )
Sun Sep 17 17:14:14 2023 DEBUG: 8 bytes written, 8 bytes sent, 0 bytes remaining
Sun Sep 17 17:14:14 2023 DEBUG: 8 bytes read, 8 total bytes: 28 4e 41 4b 73 73 0d 00
Sun Sep 17 17:14:14 2023 DEBUG: Found reply at byte: 7
Sun Sep 17 17:14:14 2023 DEBUG: QPIRI: 8 bytes read: (NAK
Sun Sep 17 17:14:14 2023 DEBUG: QPIRI query finished
Sun Sep 17 17:14:14 2023 DEBUG: Current CRC: B4 DA
Sun Sep 17 17:14:14 2023 DEBUG: Send buffer hex bytes: ( 51 50 49 57 53 b4 da 0d )
Sun Sep 17 17:14:14 2023 DEBUG: 8 bytes written, 8 bytes sent, 0 bytes remaining
Sun Sep 17 17:14:14 2023 DEBUG: 8 bytes read, 8 total bytes: 28 4e 41 4b 73 73 0d 00
Sun Sep 17 17:14:14 2023 DEBUG: Found reply at byte: 7
Sun Sep 17 17:14:14 2023 DEBUG: QPIWS: 8 bytes read: (NAK
Sun Sep 17 17:14:14 2023 DEBUG: QPIWS query finished
Sun Sep 17 17:14:14 2023 DEBUG: Start loop
Sun Sep 17 17:14:15 2023 DEBUG: Start loop
Sun Sep 17 17:14:16 2023 DEBUG: Start loop
Sun Sep 17 17:14:17 2023 DEBUG: Start loop
Sun Sep 17 17:14:18 2023 DEBUG: Start loop
Sun Sep 17 17:14:19 2023 DEBUG: Start loop
Sun Sep 17 17:14:20 2023 DEBUG: Start loop
Sun Sep 17 17:14:21 2023 DEBUG: Start loop
Sun Sep 17 17:14:22 2023 DEBUG: Start loop
Sun Sep 17 17:14:23 2023 DEBUG: Start loop
Sun Sep 17 17:14:24 2023 DEBUG: Start loop
Sun Sep 17 17:14:25 2023 DEBUG: Start loop
Sun Sep 17 17:14:26 2023 DEBUG: Start loop
Sun Sep 17 17:14:27 2023 DEBUG: Start loop
Sun Sep 17 17:14:28 2023 DEBUG: Start loop
Sun Sep 17 17:14:29 2023 DEBUG: Start loop

does anyone want to make a video step by step how to connect them to home assistant?

If you’re new to all of this, you might want to try a simpler way to talk to your inverter. This thread has way too many issues for a newcomer to tackle. Look at these topics on github and see if they work for you. If all else fails you could look into a paid solution called Solar Assistant. It works out of the box.

https://github.com/gadget78/inverter-homeassistant/

https://github.com/njfaria/SolPipLog

i know the payed version, its not about that :slight_smile: im new to this, and i got everything on home assistant. lights water etc etc.
and i have 3 inverters and one BMS, the bms i manage to connect it to home assistant, i want now also the inverter. i will try to read what u sent me maybe il get a start!

also one question is, can i run it on rasberry pi? i have installed home assistant os , or do i need to install that “docker” os ?

Hi!

Could somebody explain this calculation to me? I’ve found it in inverter-cli / main.cpp

// Calculate watt-hours generated per run interval period (given as program argument)
pv_input_watthour = pv_input_watts / (3600 / runinterval);
load_watthour = (float)load_watt / (3600 / runinterval);

It’s not clear to me why is Wh calculated like that. “runinterval” is set to 120 in inverter.conf file (which means a poll of the inverter every 30 seconds). What are these two parameters? Essentially the current power reading (pv_input_watts and load_watt) are divided by 30. But why?