Foxess Inverter Modbus

Ok. I’ve ordered the same one you are using. I almost ordered that one back then to begin with, but didn’t know what the pin left of the a and b pins was for (the one which is only labeled in chinese). Is this supposed to be connected to the ground of the modbus device?

Hello!

There is answer from foxess support:
“It is the same data. The inverter sends the same data to the server and on the rs485 port.
This is not a traditional modbus. There is no question-answer communication. RS485 is a standard communication interface which can transmit the real time data from inverter to a PC or other monitoring devices.”

Maybe it helps…

If it use “custom header” it will not work in esphome.

You could try with tasmota. But you need the new ttl rs485.

With Elfin-EW11 modbus to WiFi, it will work?

Elfin is just a bridge. You need at the end a custom parser

Tasmota has multi parsers

https://tasmota.github.io/docs/Smart-Meter-Interface/

You need read raw value to have sure of protocol

I connect inverter with Elfin-EW11, Elfin-EW11 configured as MMQT client and get in HA MMQT mosquito messages like this:

Message 15 received on fox_modbus at 09:05:
b'~~\x02c"zV\x00\xe8\x00\x00\x04\xf8\x00\x00\t4\x00\x13\x13\x87\x01\x99\t.\x00\x14\x13\x87\x01\xae\t@\x00\x14\x13\x87\x01\xb1\x15\xe3\x00\x0e\x00\x00\r\x18\x00\r\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1e\x00\x1e\x00#\x00\x05\x00\x00T=\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00)\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xda\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02\x00\x00\x00\x00\x03\x93\xfd\xd0\x05n\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x19\x92\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14]\xe7\xe7'

Something that begins with x7f\x7f
And ends with xf7\xf7

So… How to decode that?

You need to know where registers start

It’s just hex values

But

aa bb cc dd ee

How do you know if:

  • aa bb
  • bb cc
  • dd ee

If you have a static value in inverter, we can check.

Just convert decimal to hex and compare

From manual:

Data format explanation:
a) Frame Header:indicate the start byte, fixed data:7E7E.
b) Data Length:indicate the data pack length, include user data, data type is Uint16.
c) Function Code:indicate all function requirements and responses, please see below table in detail.
d) Timestamp: indicates the current time, in seconds.
e) User data: represents the monitoring data of the inverter.
f) Check Code:MODBUS CRC16 check, LSB first, don’t contain frame header.
g) Frame End:indicate the end byte for data pack, fixed bytes: E7E7.

https://tasmota.github.io/docs/Smart-Meter-Interface/

1 Like

I’m away from home right now. I’ll definitely have a go at decoding this weekend, though. There should be easy to identify bits (like voltage being close to 230), and then go from there. Seems like the first part of your example message is missing? It ends with e7/e7, but should also start with 7e/7e

I haven’t been able to get any message from my inverter with my esphome setup. Hope the new rs485 module will change that (arrives tomorrow). If not I perhaps will also order a elfin.

Those are all mesages that shown in HA MMQT mosquito, and they are repeated, as you can see (I removed serial nr.)…

Message 5 received on fox_modbus at 09:39:
b'~~\x06c#\xd3\xc4\x00VB10400there_was_serial\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00000000000000000000000000\x00\x00\x00\x00\x00\x00\x00\x00G\x91\xe7\xe7'

Message 4 received on fox_modbus at 09:38:
b'~~\x02c#\xd3\xa6\x00\xe8\x00\x00\x11\t\x00\x00\te\x00<\x13\x88\x05\xa1\tW\x00=\x13\x88\x05\xb1\ts\x00<\x13\x88\x05\xa9\x15r\x00F\x00\x00\rB\x00\r\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00(\x00(\x00(\x007\x00\x00U\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x16\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01B\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02\x00\x00\x00\x00\x03\xe7\xff|\x11\x0b\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01%\xdf\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00n/\xe7\xe7'

Message 3 received on fox_modbus at 09:38:
b"~~\x01c#\xd3\x88\x00l1.24\x00\x001.00\x00\x001.14\x00\x000.18\x00\x00\x00\x00T3\x00\x00\x00\x00\x00\x00T10-G3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\x10\x00\x0e\x00\x001.24\x00\x001.00\x00\x001.14\x00\x000.18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff6\xe7\xe7"

Message 2 received on fox_modbus at 09:37:
b'~~\x06c#\xd3j\x00VB10400there_was_serial\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00000000000000000000000000\x00\x00\x00\x00\x00\x00\x00\x00Oz\xe7\xe7'

Message 1 received on fox_modbus at 09:37:
b'~~\x02c#\xd3L\x00\xe8\x00\x00\x10\xe2\x00\x00\t[\x00<\x13\x85\x05\x9b\tK\x00<\x13\x85\x05\x91\ti\x00<\x13\x85\x05\xa3\x15,\x00G\x00\x00\x0c\xdf\x00\r\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00(\x00(\x00(\x006\x00\x00U\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x16\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01?\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02\x00\x00\x00\x00\x03\xe7\xff}\x10\xe4\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01%\x85\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa2\x95\xe7\xe7'

Message 0 received on fox_modbus at 09:36:
b"~~\x01c#\xd3.\x00l1.24\x00\x001.00\x00\x001.14\x00\x000.18\x00\x00\x00\x00T3\x00\x00\x00\x00\x00\x00T10-G3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\x10\x00\x0e\x00\x001.24\x00\x001.00\x00\x001.14\x00\x000.18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\xb6\xe7\xe7"

I got this string from Easymodbus client, if I click any “Read” button every ~30sec:

7E 7E 02 63 23 ED AC 00 E8 00 00 17 E8 00 00 09 5B 00 55 13 87 07 F1 09 53 00 55 13 87 07 EA 09 63 00 55 13 87 07 F8 14 DA 00 60 00 00 0E 7F 00 1B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2C 00 2C 00 2C 00 82 00 00 55 5A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 03 50 78 00 10 00 00 00 00 00 1A 00 00 00 00 00 00 00 00 00 00 02 21 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 02 00 00 00 00 03 E7 FF 64 17 EA 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 3F E5 00 00 00 00 00 00 00 00 00 00 00 00 C6 63 E7 E7
1 Like

I believe I’ve got your message from your last post decrypted!
It’s giving all the realtime data.
I’m still on my phone and it’s getting a bit complicated, so I’ll wait till tomorrow when I’ve got acces to my PC to post my findings in detail.
Now we need to write a parser (which shouldn’t be too hard), and receive this string in HA somehow.

So, here’s what I was able to extract:

7E 7E	header	
02	function code	
63 23 ED AC	timestamp	september 16th 2022 03:29:48 GMT
00 E8	number of bits	
00 00	grid power	0W
17 E8	generation power	6120W
00 00	loads power	0W
09 5B	gridvoltage R	239,5V
00 55	gridcurrent R	8,5A
13 87	gridfrequency R	49,99Hz
07 F1	gridpower R	2033W
09 53	gridvoltage S	238,7V
00 55	gridcurrent S	8,5A
13 87	gridfrequency S	49,99Hz
07 EA	gridpower S	2026W
09 63	gridvoltage T	240,3V
00 55	gridcurrent T	8,5A
13 87	gridfrequency T	49,99Hz
07 F8	gridpower T	2040W
14 DA	PV 1 voltage	533,8V
00 60	PV 1 current	9,6A
00 00	PV 1 power	0W
0E 7F	PV 2 voltage	371,1V
00 1B	PV 2 current	2,7A
00 00	PV 2 power	0W
00 00	PV 3 voltage	0V
00 00	PV 3 current	0A
00 00	PV 3 power	0W
00 00	PV 4 voltage	0V
00 00	PV 4 current	0A
00 00	PV 4 power	0W
00 2C	boost temperature	44C°
00 2C	inverter temperature	44C°
00 2C	ambient temperature	44C°
00 82	todays yield	13kWh
00 00 55 5A	total yield	2185kWh
some more uninterresting Info		
C6 63	checksum	
E7 E7	footer	

What doesn’t add up though, is PV1 power and PV2 power both being 0W.
As I understand it, you were generating about 6120W of PV Energy at the moment you captured this message. The sum of PV1 power and PV2 power should be approximately 6120W (minus the loss resulting from transforming). I’m not sure why it isn’t…

Are these values plausible for your inverter? For example your current total yield should be a bit more than 2185kWh.

I’ll try to get some readings from my own inverter this weekend, hopefully. That will make troubleshooting at bit easier.

1 Like

Very good news! Data is obsoluly right. I have two inputs in my inventer, PV1 and PV2. Generation power is sum of both inputs power. Power of PV1 and PV2 not show in inventer a screen too, power of PV1 must be calculated of voltage and current of PV.

Power of PV1 and PV2 I can see in foxesscloud, I think, they calculated it from voltage and current data.

1 Like

yeah, it shouldn’t be a problem to calculate PV1 power and PV2 power.
PV1 power = 533.8 * 9.6 = 5124.5
PV2 power = 371.1 * 2.7 = 1002

PV1 + PV2 = 6126.5W → which corresponds with generated power and the cumulated power from the 3 phases.

I just don’t understand why the inverter doesn’t report this properly. It must be a bug?

Inventer send other data too, configuration and identification data, but I think that data not need fof importing in HA.

If you really need it, it shouldn’t be a problem to get it in HA.
But i’m honestly only interested in the realtime PV generation (PV1 + PV2), so i know when to turn on the heat pump :wink:

About PV wattage, I think is not a bug, it’s a peculiarities. of the software.
Generation power is power of PV panels, grid power is power send to grid.