Foxess Inverter Modbus

Do you still have the Foxess Wifi module plugged in to the inverter?
You could try it once without it.
I didn’t have to change any parameter on the inverter.

Do you have the normal T10, or the dual?

I have normal T10. Yes, Wifi dongle is still plugged. I will give it a try tomorrow, sun is gone for the day.

I’ve disconnected Wifi adapter and tried again (different combinations). Nothing changed. So it must be max485 or inverter does not set data. I’ve checked with voltmeter and there is some voltage on A & B, and it’s changing, so I’d assume some signal is being sent, but I don’t see any data coming on esp. I’ll see if I can source something different and will try again…
Btw, does anybody knows if Foxess LAN adapter would have modbus server reachable from network?

I tried hooking the convert up to known working rs485 USB adapter and I got nothing.
I order a different converter it should arrive on Tuesday or so. I will see then if it was the problem.

Hi guys,

I unplugged my circuit yesterday to get some measurements for a custom pcb. When i plugged it back in mine also wasn’t working anymore.
But good news, I think I’ve found the problem and there is a really easy solution!

Turns out you do need to connect DE and RE together and hook them up to a GPIO.
I’m not sure why it was working before for me before, but I’ve tried so many different things to get this to work, who can tell :slight_smile:

So what changes need to be made:

  • connect DE and RE together and connect them to a GPIO (I used GPIO4).
  • please double check one more time that RO is connected to G17 and DI is connected to G16
  • in the YAML add the following code:
switch:
  - platform: gpio
    pin: 4
    name: "T-Series sending mode"

This creates a switch which switches between sending and receiving mode (on = sending; off = receiving).
This switch is “off” by default so unless you want to send something to the inverter there is no need to add it to any dashboard.

I’m so sorry if this has caused you unnecesary troubleshooting! This was totally my fault.

Awesome thank you now it is working :partying_face:. At first I got nan but you have to just wait and after 1-2 min data will come in.

I have MAX13487EESA RS485 module (one of cheap aliexpress ones) with only “TX” and “RX” (plus power). That one worked from the beginning.

I’m glad it works now.
I’ve just ordered some custom pcb’s. As soon as I’ve succesfully tested, I’ll upload the gerber file for anyone interrested.

3 Likes

@assembly
First.
Thank you for this integration with ESPHome

I made some changes in the custom component class.

  • bytes size is greate than 165 (see byte 8 & 9, is the data length of the user data → 00E8 (232) plus 13 bytes (header, func code, etc. ) = 245)
  • calculate the PV power in the class
  • GridPower →
    is value under 32768 = get from grid
    ( 1 = 1 W)
    is value over 32767 = feed in grid
    (65536 - [VALUE] = W)

I will open an issue in Github.

Because of the TTL to RS485 hardware. I use a board with automatic flow control (Amazon.de).
I also have the same board you are using, but I have not been able to get it to work.

Hi Henry-Sir, thanks for your feedback!

I’m not sure why your bytes size is 245. Mine is definitely only 165 as you can see in my post 41 (0x00 0x98). The code also checks that the end of the message is reached (the last two bytes being 0xE7 0xE7). The protocol documentation also confirmes a bytes size of 165.

I don’t fully understand what you are trying to say with your other two points. Please open an issue on Github and eleborate a bit more; I’ll have a look at it!

Hi

I suppose it depends on the software version of the inverter.
My first tests worked with the programming you created.
Then I installed a software update on the inverter (Master 1.12 → 1.27) and after that it didn’t work anymore because the byte length had changed.
See the post 22 of Safs (Foxess Inverter Modbus - #22 by Safs), there is also already a data length of 00E8 (232) specified.

It is also not a problem because the data length is specified and this can be interpreted.

Ok. Thanks for finding this out!
I’ll update the component so that it works with any bytes length.

Just an update from my side. I didn’t manage to get the data using MAX485 even with additional pin connected. I’ve managed to get a bit different adapter which has RST pin, with this one I can see some data in debug when switching RST for short time, but didn’t tried to automate that at least yet. I’ve also got USB adapter and plugged it to PI which shows that data is coming in. I didn’t managed to source RS485 adapter with automatic flow control, so ordered one from AliExpress. In the meantime, I’m going to try setting up data flow using python or so from PI.
@Henry-Sir or @assembly if you got above mentioned changes regarding bytes length, could you please share that?

I’ll upgrade the code tomorrow. Regardless, this doesn’t affect the serial debug output in the logs. So if you still see no traffic in the logs, something else has to be wrong as well. Please let me know if I can be of any assistance.

No worries, I’m sure it’s hardware fault, so I’m waiting for new adapter to arrive.

Hi,

I’ve updated the code on Github. It should now work with any bytes length.

Screenshot 2022-10-15 115020

1 Like

Could you please export your nodes :pray: I tried to copy it somehow, but my values differ a lot…

I can’t insert here attachment…

I have T10-G3 create Your project almost everything is working fine but i don’t have today yeld and generationTotal this two is missing. In link teher is information about monitoring protocol

QAs say foxess poland we “need to catch” data send to cloud. Can You check why there is no value ? I’m not programmer i want to help but i don’t know how…

Here is log from rs485 sniffer
Also inside logger there is esp32 chit when i have little more time i try to sniff communication on esp32

7e 7e 02 63 50 eb f9 00 e8 00 00 04 49 00 00 09
80 00 11 13 84 01 69 09 4b 00 12 13 84 01 76 09
7c 00 11 13 84 01 69 11 b2 00 06 00 00 11 cb 00
12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
1a 00 1a 00 20 00 92 00 00 3d ce 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 6a 10 00 14 00 00 00 00 00 29 00
00 00 00 00 00 00 00 00 00 16 53 00 76 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 6b 02 5d 04 e5 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 5b 00 02 00 00 00 01 00 08 00 62 00
00 00 01 00 00 00 01 00 01 00 01 00 01 00 01 00
03 00 00 7b a7 00 00 00 00 00 00 00 00 00 00 00
00 59 fe e7 e7

Hello,

from the message you posted above your daily yield should be 14.6kWh and your total yield should be 1582.2kWh. I’m not sure why ESPHome isn’t picking that up. I’ll have a look tomorrow if i can find some time.

Btw. the protocol you linked to doesn’t match the protocol your inverter is using. It’s very similar, but at some point they added two message strings together to one message. The protocol you linked to has 4 different messages and your inverter probably only sends 3. The byte size of the message containing the information we are interested in is 245 instead of 165.
My code from github should however work for both protocols, however I can not test the protocol your inverter is using, so I would be happy for someone to confirm this.