Hello everyone,
Although I signed up to the openenergymonitor forum in September 2023, and with much interest and great benefit have followed the various discussions both before and after that time, this is my first contribution here. Sorry if it does not (yet) follow standard layout or terminology.
My interest in openenergymonitor and their emoncms system stems from planning and installing solar PV and ASHP systems at my house in spring/summer of 2023. I wanted to collect & monitor the systemsâ running data in-house, and being an old time Debian Linux user (and with a Raspberry pi3 to spare) I decided to use emoncms for this.
My installations are (briefly told): Vaillant Aerotherm Plus 7kW, and Solax X1 Gen.4 3.7D hybrid inverter with Solax Triple Power batteries, 3 x 5.8kWh.
I put the (Raspbian 11 based) emoncms Nov.2022 image onto a (industrial grade) microSD card for my pi3, and communicate with the OS over a wifi connection (via ssh).
I have been collecting data (into emoncms) from the heatpump (through a Sontex Supercal 5S heatmeter and SM120 power meter) since the beginning, and more recently also from the heatpump ebus system directly (using the elecrow eBUS Adapter Shield C6).
Now I am trying to retrieve data from the Solax inverter via its RJ45 âCOM/LCDâ port (RS485 modbus) into my pi3 emoncms using a modbus-USB converter cable (the FTDI USB-RS485-WE-1800-BT), as the inverter and the pi3 are just 1.5 metres apart.
But so far without complete success, and this is where I need help.
I am not a programmer, but here is what I have tried and where Iâve got to in this process:
To check the inverter-pi3 connection I installed âmbpollâ (from the raspbian 11 repository), and tested (after a few failed attempts) with the following command string:
mbpoll -P none -a 1 -b 19200 -l 10000 -1 -t 3 -r 1 -c 10 /dev/ttyUSB1
which gave the following output, which shows that the connection as such is OK:
Protocol configuration: Modbus RTU
Slave configuration...: address = [1]
start reference = 1, count = 10
Communication.........: /dev/ttyUSB1, 19200-8N1
t/o 1.00 s, poll rate 10000 ms
Data type.............: 16-bit register, input register table
-- Polling slave 1...
[1]: 2401
[2]: 21
[3]: 493
[4]: 1544
[5]: 1217
[6]: 26
[7]: 27
[8]: 5011
[9]: 38
[10]: 2
......
These are the first 10 registers in the table â0x04: Read Input Registerâ of Solaxâ document
âEnergy Storage Inverter Modbus TCP&RTU Communications Protocols v.3.36â
(the file is named âHybrid X1&X3-G4 ModbusTCP&RTU V3.36-English_240611.pdfâ),
and include registers I want to access.
Inspired by the configuration for SM120 in /etc/emoncms/emoncms.conf
, I hazarded the following for a Solax configuration:
[[SolaxX1G4]]
Type = EmonHubMinimalModbusInterfacer
[[[init_settings]]]
device = /dev/ttyUSB1
baud = 19200
parity = none
datatype = int
[[[runtimesettings]]]
pubchannels = ToEmonCMS,
read_interval = 30
nodename = solaxX1G4
# prefix = solax_
[[[[meters]]]]
[[[[[inverter]]]]]
address = 1
registers = 0,1,2,3,4,5,6,9,10,11,22,24,28,32,70,72,80
names = GridVoltage,GridCurrent,GridPower,PV1Voltage,PV2Voltage,PV1Current,PV2Current,RunMODE,PowerDC1,PowerDC2,BatteryPowerCharge,BatteryTemp,BatterySOC,BatteryOutputEnergyToday,FeedInPower,FeedInTotal,DailyYield
scales = 0.1,0.1,1,0.1,0.1,0.1,0.1,1,1,1,1,1,0.01,0.1,1,1,0.1
precision = 2,3,1,2,2,3,3,1,1,1,1,1,1,1,1,1,1
This pulls Solax data into emoncms OK, but not the values I want.
When running the command string:
mbpoll -P none -a 1 -b 19200 -l 10000 -1 -t 4 -r 1 -c 10 /dev/ttyUSB1 (so -t 4 rather than -t 3 used above)
output is:
Protocol configuration: Modbus RTU
Slave configuration...: address = [1]
start reference = 1, count = 10
Communication.........: /dev/ttyUSB1, 19200-8N1
t/o 1.00 s, poll rate 10000 ms
Data type.............: 16-bit register, output (holding) register table
-- Polling slave 1...
[1]: 18484
[2]: 13111
[3]: 12865
[4]: 18743
[5]: 13363
[6]: 13617
[7]: 13620
[8]: 21359
[9]: 27745
[10]: 30752
......
These data are the same as those received into emoncms through my emonhub [[SolaxX1G4]] configuration above, taken from what mbpoll calls the âoutput (holding) register tableâ.
If this is the same as Solaxâ document â0x03: Read Holding Registerâ table, the first registers should give the inverter serial number (SN), but the figures bear no resemblance to the actual serial number is has, and anyway are not the data I want.
And from here I donât know how to proceed.
So if anyone can suggest a (simple) way to change the âregistersâ in above Solax configuration script to point to the Solax 0x04 Input Registers, I would be very thankful. Any other suggestions for a solution would also be welcome. Although if it means heavy editing of the
/opt/openenergymonitor/emonhub/src/interfacers/EmonHubMinimalModbusInterfacer.py script,
it would probably be beyond me.
Thanks,
LB