Foxess Inverter Modbus

You need a ttl rs485 with automatic direction control

Ah sorry. Totally forget to describe my Hardware setup.
I’ve got it setup like this:

Wired like the fritzing diagram On this site

Wired up and powered by the inverter as described in the inverter manual

You need to use flow_control_pin

Hi, thanks for your help!
I’ve enabled the flow control pin on GPIO4 (the connection was allready soldered and i uncommented the line in the YAML).

Unfortunately nothing changes.
I’ve double checked all the wiring and went over the connections with a continuity meter, so i’m fairly certain it has to be something in the software i’m doing wrong.

Buy a rs485 ttl with automatic flow.

Ou check inverter manual for registers

Try with gpio 18 and 19.

I just tested with 18 and 19.

Registers need to be in hex 0x0000, I think

Thanks again for your input!

How would I know the rs485 to ttl converter has automatic flow? I havn’t seen it described in any of the poduct descriptions I’ve seen sofar. I believe the one I’m using does have it, correct me if i’m wrong.

From the log-output it does seem that the ESP is sending and receiving succesfully. It might be that i have the addresses wrong.
I just today found out that my inverter probably uses a different protocol from the (older?) ones.
It can be found here, but I don’t understand how to figure out the addresses. Perhaps you can have a look?

Also I would be interested in what your logs look like for a working connection.

That pdf is for cloud communications.

I need pdf with registers for local modbus communications

us_controller:036]: Sending next modbus command to device 1 register 0x2AF9 count 1
[11:05:11][V][modbus:184]: Modbus write: 01.04.2A.F9.00.01.E9.E3 (8)
[11:05:11][V][modbus_controller:465]: Command sent 4 0x2AF9 1
[11:05:11][V][modbus:058]: Modbus received Byte  1 (0X1)
[11:05:11][V][modbus:058]: Modbus received Byte  4 (0X4)
[11:05:11][V][modbus:058]: Modbus received Byte  42 (0X2a)
[11:05:11][V][modbus:058]: Modbus received Byte  249 (0Xf9)
[11:05:11][V][modbus:058]: Modbus received Byte  0 (0X0)
[11:05:11][V][modbus:058]: Modbus received Byte  1 (0X1)
[11:05:11][V][modbus:058]: Modbus received Byte  233 (0Xe9)
[11:05:11][V][modbus:058]: Modbus received Byte  227 (0Xe3)
[11:05:11][D][modbus_controller:032]: Modbus command to device=1

If you check. The received command is the same as sent.

Flow control is not working

Or bad soldering

Automatic flow direction ttl marked in yellow:

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"