RS485 communication interface

sunown
Posts: 4
Joined: Mon Mar 13, 2023 12:23 pm

Hi there,

to do energy management I need locally the realtime data.
There is a section in the Inverter Model : H3-10.0-E manual whích says:
RS485 is a standard communication interface which can transmit the real time data from inverter
to PC or other monitoring devices.

I have no problem to wire it but I cant find and got no feedback from Fox support about a manual on how to.
I mean a description on the part of the Fox inverter like MODBUS table etc.
I dont want to go via home assistant (additional system...) or else.
Does anyone have something?

Best
Chris
Dave Foster
Posts: 824
Joined: Thu Oct 13, 2022 7:21 pm

Sadly there is nothing off the shelf to do this, Home Assistant will do this and you can find out the register values by looking at the code.

When connected by an RS485 device over TCP it is possible to interrogate the unit registers via a windows pc command prompt using modpoll.exe - but you'd have to write a program or similar to interpret the commands. It is also possible to write to the registers so you could have batch files set up that set charge times to a pre-defined setting.

Here is a link to the page for Home Assistant and it shows the register addresses when talking to an H3 over RS485 https://github.com/StealthChesnut/HA-Fo ... 3-USB.yaml

This is a link to the modpoll.exe command line utility https://www.modbusdriver.com/modpoll.html
sunown
Posts: 4
Joined: Mon Mar 13, 2023 12:23 pm

Thanks a lot Dave but try to motivate Fox following their own manual ;-)
calum
Posts: 389
Joined: Fri Feb 24, 2023 11:00 am
Location: Stockport

It is also possible to write to the registers so you could have batch files set up that set charge times to a pre-defined setting.
Do you mean like a command line batch file? Do you happen to have an example you could share? Having to go via the Fox app to change this for the following day is one of my biggest annoyances with what is otherwise a very nice system. (I already have HA set up for monitoring etc)
H1-3.7 / 6xHV2600 / 14x400W / RS485 Modbus->HA
FoxESS Modbus HA Integration
Contact Fox here
Dave Foster
Posts: 824
Joined: Thu Oct 13, 2022 7:21 pm

calum wrote: Fri Mar 17, 2023 7:13 am
It is also possible to write to the registers so you could have batch files set up that set charge times to a pre-defined setting.
Do you mean like a command line batch file? Do you happen to have an example you could share? Having to go via the Fox app to change this for the following day is one of my biggest annoyances with what is otherwise a very nice system. (I already have HA set up for monitoring etc)
Yes it’s possible to set it via a command line using modpoll.exe if you use HA on RS485, if you are connected via RS485 there is a more elegant HA solution that will work for you.
calum
Posts: 389
Joined: Fri Feb 24, 2023 11:00 am
Location: Stockport

My HA is connected via the LAN port at the moment, I have a serial to TCP converter on order so I can keep my HA environment running if I move to the later versions of the master / slave firmware.

Is your method via the modbus integration in HA ?
H1-3.7 / 6xHV2600 / 14x400W / RS485 Modbus->HA
FoxESS Modbus HA Integration
Contact Fox here
Dave Foster
Posts: 824
Joined: Thu Oct 13, 2022 7:21 pm

calum wrote: Fri Mar 17, 2023 7:04 pm My HA is connected via the LAN port at the moment, I have a serial to TCP converter on order so I can keep my HA environment running if I move to the later versions of the master / slave firmware.

Is your method via the modbus integration in HA ?
Yes is you want to modify the inverter registers you have to have the RS485 version - unfortunately the available LAN registers don't (yet) support it.
calum
Posts: 389
Joined: Fri Feb 24, 2023 11:00 am
Location: Stockport

OK thanks. I've just got my hands on a USR-TCP232-410S so I'll need to get that talking to the inverter and come back to this. I've got everything set up beautifully in InfluxDB & Grafana so I am hoping I can just swap the YAML over that defines the sensors and HA won't notice.

Anyway, first job, get this USR box working with the inverter reliably...
H1-3.7 / 6xHV2600 / 14x400W / RS485 Modbus->HA
FoxESS Modbus HA Integration
Contact Fox here
Dave Foster
Posts: 824
Joined: Thu Oct 13, 2022 7:21 pm

calum wrote: Sun Mar 19, 2023 10:16 pm OK thanks. I've just got my hands on a USR-TCP232-410S so I'll need to get that talking to the inverter and come back to this. I've got everything set up beautifully in InfluxDB & Grafana so I am hoping I can just swap the YAML over that defines the sensors and HA won't notice.

Anyway, first job, get this USR box working with the inverter reliably...
That looks a nice solution, the modbus yaml will be transparent to the register values so once it’s setup it should work fine.
calum
Posts: 389
Joined: Fri Feb 24, 2023 11:00 am
Location: Stockport

Right, so I got the 410S connected up and working this evening :D

In the end the biggest drama was working out how to get the COM port connector apart so I could connect the cable. After that I had to uh, "interpolate" from the W610 guidance, since there are options in the 410S absent from the W610 and vice versa. Anyway, the finalised and working config looks as follows:
Screenshot 2023-03-23 230333.png
I'm quite sure you could change the TCP Server MAX Sockets value to something bigger, but I don't need more than one since there's only one system (my HA VM) that will be talking to it.

I had already prepared an alternative YAML file and INCLUDE line in configuration.yaml, so a quick add and delete of a # and a restart of HA and I'm running on RS485 derived data, which is a result.

~~~~~~~~~~~~~~~~~~~~~~~~~~~

One thing I noticed is the temperature sensors seem to be mapped differently in the LAN version of the sensors vs the COM port.

Code: Select all

- name: "AmbTemp"
      address: 31018 (LAN) or 11018 (RS485)
- name: "InvTemp"
      address: 31019 (LAN) or 11019 (RS485)
Looking at the historical data derived from the LAN port mappings, I'd come to expect InvTemp/31019 to be higher (by about 5-6C) than AmbTemp/31019.

Code: Select all

- name: "InvTemp"
      address: 11024
- name: "AmbTemp"
      address: 11025
However InvTemp/11024 is lower than AmbTemp/11025, by about the same amount - suggests that they are swapped over. Further I see in the Data Register Reference table for the Integration that 11024 is actually the inverter cooling fins, and 11025 is actually the CPU, and these have been validated against temps in FoxCloud.

So, having said all that, it looks like my inverter is running a lot cooler than I thought!

I'll submit the config for the 410S to StealthChesnut for inclusion in the integration wiki, in case folks are after a straight serial to ethernet bridge option.
H1-3.7 / 6xHV2600 / 14x400W / RS485 Modbus->HA
FoxESS Modbus HA Integration
Contact Fox here
Dave Foster
Posts: 824
Joined: Thu Oct 13, 2022 7:21 pm

Yes agree about the manuals.. not very good, it takes some work ;)

The latest version of modbus is much easier to configure on HA, doesn’t need yaml edits and is much more resource efficient - I was getting a lot of blocking in HA at startup and shutdown but tbh I think that’s the W610 it’s not very fast.

https://github.com/nathanmarlor/foxess_modbus

It’s also worth having as it will let you set min/maxsoc and work mode - I think something you were looking for.

If you do install it, firstly comment out the old modbus include file and restart HA so the sensors are ophaned, then add the new one in HACS, go to devices and services to configure it - needs to know TCP/Serial etc.. and IP address and that’s it.

If i’m not mistaken the temperature issue was recently spotted when the new version was being done (based on the wiki) and they realised it didn’t match the Foxcloud, so there is a PR in to correct it.
calum
Posts: 389
Joined: Fri Feb 24, 2023 11:00 am
Location: Stockport

Yes agree about the manuals.. not very good, it takes some work ;)
Having read this discussion in Nathan's repo I'm kinda sorta regretting not having gone for the Waveshare device, which is half the price of the 410S, has a very comprehensive manual and looks to have lightning fast readouts. That said, for something that is going to spend the vast majority of its time being ignored in a garage just shuffling packets for a decade or more, it probably doesn't matter. And the 410S is a much more modern device than the W610, so I suspect the CPU is considerably quicker.

Interface hardware aside though, it looks like the FoxESS Modbus integration is a replacement for the StealthChesnut one? I wonder if all the sensor mappings are the same...I've got various charts set up in InfluxDB/Grafana to look at long(er) term trends with the system, I'd be loathe to have to set all that up again or hand edit the sensor names to match the ones I have now, since that would end up being a de facto fork of the integration :o. But as you say, the potential for control over the inverter via writing to Modbus registers is very attractive. More research needed!

Still need to get the (good but overworked) installers to update all the firmware for my installation, my battery lost 27% SoC in about 90 minutes early this morning, which should equate to about 3kWh of discharge, but I doubt it used more than 500Wh in that time...
H1-3.7 / 6xHV2600 / 14x400W / RS485 Modbus->HA
FoxESS Modbus HA Integration
Contact Fox here
Dave Foster
Posts: 824
Joined: Thu Oct 13, 2022 7:21 pm

calum wrote: Fri Mar 24, 2023 1:29 pm
Yes agree about the manuals.. not very good, it takes some work ;)
Interface hardware aside though, it looks like the FoxESS Modbus integration is a replacement for the StealthChesnut one? I wonder if all the sensor mappings are the same...I've got various charts set up in InfluxDB/Grafana to look at long(er) term trends with the system, I'd be loathe to have to set all that up again or hand edit the sensor names to match the ones I have now, since that would end up being a de facto fork of the integration :o. But as you say, the potential for control over the inverter via writing to Modbus registers is very attractive. More research needed!

Still need to get the (good but overworked) installers to update all the firmware for my installation, my battery lost 27% SoC in about 90 minutes early this morning, which should equate to about 3kWh of discharge, but I doubt it used more than 500Wh in that time...
I think the 410S is quicker than the W610 - there's something not quite right about its performance but it looks to be under-powered, it does go much quicker on UDP without all the TCP overhead and I think there should be an update in the next few releases that allows it to use UDP instead - but the Waveshare device is in a whole different league of performance.

To answer you're question both of the modbus options are still supported but the FoxESS modbus is the latest and supports all the currently known inverter features and will harmonise the inverter types into a single integration (H1/AC1/H3) with multiple connection types (LAN/RS485 TCP/RS485 USB/ RS485UDP). It also bypasses the clunky inbuilt HA modbus which seems to have performance issues of it's own with large register reads.

So far I think it has captured all the sensor names very accurately, but you can also rename them to suit if you have a bespoke installation.

On the battery, the latest versions of firmware for inverter and battery master/slave are night and day better than anything that's gone before, I would highly recommend getting them upgraded. :)
calum
Posts: 389
Joined: Fri Feb 24, 2023 11:00 am
Location: Stockport

On the battery, the latest versions of firmware for inverter and battery master/slave are night and day better than anything that's gone before, I would highly recommend getting them upgraded. :)
Ha, glad to know the later firmwares are worth pushing for. I'll keep on at our installers, they're pretty good but victims of their own success unfortunately. Maybe I can convince them to just let me have the installer access on the kit if they're not going to use it!
If you do install it, firstly comment out the old modbus include file and restart HA so the sensors are ophaned
you can also rename them to suit if you have a bespoke installation.
At the moment I'm using the more 'handcranked' integration from StealthChesnut, I originally installed it when we got the solar installed last November, and I've not touched anything since other than to update to the latest sensor definitions.

The Foxess Modbus integration does look much more sophisticated and also more actively developed. My hesitation is mainly because the naming conventions between the two integrations are different, so if I switch over to a different integration I disconnect several months of historical data because of the entity names changing, even though it's the same basic data. There's probably some tricks I could employ to work around this in Grafana, since I'm trying to be able to view some parameters (like daily yield, feed in, overall house hold consumption) over longer periods of time.

Or maybe I just bite the bullet, refactor the Grafana stuff to the new entity names and see if I can learn how to rename the older data in InfluxDB....decisions, decisions.
H1-3.7 / 6xHV2600 / 14x400W / RS485 Modbus->HA
FoxESS Modbus HA Integration
Contact Fox here
asjp100
Posts: 4
Joined: Wed Apr 19, 2023 2:32 pm

calum wrote: Thu Mar 23, 2023 11:54 pm
In the end the biggest drama was working out how to get the COM port connector apart so I could connect the cable.
@calum
How did you get it apart?
I’ve tried prising it with a screwdriver and mole wrench without any joy and don’t want to break it!

Any advice appreciated 🙂
Dave Foster
Posts: 824
Joined: Thu Oct 13, 2022 7:21 pm

asjp100 wrote: Wed Apr 19, 2023 2:39 pm How did you get it apart?
I’ve tried prising it with a screwdriver and mole wrench without any joy and don’t want to break it!

Any advice appreciated 🙂
The inverter comes with a plastic tool that makes this easy, it’s basically plastic ‘U’ shaped tongs that push through the slots on the side of the connector and push the clips back - you can achieve the same with a medium sized pair of flat bladed screwdrivers pushed in the slots. The connector then comes about but has a bit of resistance from a rubber washer that stops water getting in.
I’m away from home today, back tomorrow - let me know if you’re stuck and i’ll take a picture of the tool and the connector to show how it comes apart.
asjp100
Posts: 4
Joined: Wed Apr 19, 2023 2:32 pm

Dave Foster wrote: Wed Apr 19, 2023 2:52 pm The inverter comes with a plastic tool that makes this easy, it’s basically plastic ‘U’ shaped tongs that push through the slots on the side of the connector and push the clips back - you can achieve the same with a medium sized pair of flat bladed screwdrivers pushed in the slots. The connector then comes about but has a bit of resistance from a rubber washer that stops water getting in.
I’m away from home today, back tomorrow - let me know if you’re stuck and i’ll take a picture of the tool and the connector to show how it comes apart.
I don't appear to have such a tool in the spares the installers left behind, so I guess it'll have to be the screwdrivers method.

Not sure which slots you're referring to on the connector. A picture would be very helpful, thanks.
Dave Foster
Posts: 824
Joined: Thu Oct 13, 2022 7:21 pm

asjp100 wrote: Wed Apr 19, 2023 5:05 pm I don't appear to have such a tool in the spares the installers left behind, so I guess it'll have to be the screwdrivers method.

Not sure which slots you're referring to on the connector. A picture would be very helpful, thanks.
Here’s a couple of shots of the connector, the tool and how it pushes the tangs you can see inwards (you can use flat blade screwdrivers) and the final disassembly.

Click on the pictures and they will rotate to correct orientation
IMG_7769.jpeg
IMG_7767.jpeg
IMG_7768.jpeg
Hope that helps !
asjp100
Posts: 4
Joined: Wed Apr 19, 2023 2:32 pm

Yes that made it nice and easy. Now connected to my Pi via RS485-USB and picking up all the sensor data in Home Assistant :) Thanks for the help.
calum
Posts: 389
Joined: Fri Feb 24, 2023 11:00 am
Location: Stockport

asjp100 wrote: Thu Apr 20, 2023 7:06 pm Yes that made it nice and easy. Now connected to my Pi via RS485-USB and picking up all the sensor data in Home Assistant :) Thanks for the help.
<hannibal>I love it when a plan comes together :D </hannibal>
H1-3.7 / 6xHV2600 / 14x400W / RS485 Modbus->HA
FoxESS Modbus HA Integration
Contact Fox here
canton7
Posts: 42
Joined: Sun Oct 23, 2022 12:17 pm

Dave Foster wrote: Thu Apr 20, 2023 11:46 am Here’s a couple of shots of the connector, the tool and how it pushes the tangs you can see inwards (you can use flat blade screwdrivers) and the final disassembly.

Click on the pictures and they will rotate to correct orientation

IMG_7769.jpeg

IMG_7767.jpeg

IMG_7768.jpeg

Hope that helps !
Mind if I steal those to put on https://github.com/nathanmarlor/foxess_ ... ring-Guide ?
Dave Foster
Posts: 824
Joined: Thu Oct 13, 2022 7:21 pm

canton7 wrote: Wed Apr 26, 2023 6:47 am
Mind if I steal those to put on https://github.com/nathanmarlor/foxess_ ... ring-Guide ?
Not at all :)
ChrisH
Posts: 4
Joined: Fri Jun 23, 2023 12:15 pm

Does anyone know who makes this connector and how to get a replacement?

It appears my installer stripped the thread for one of the meter connections. When I opened up the connector the wire dropped out and I can't tighten it in. I tried one of the spare screws but no joy. Maybe I can wedge it for a while but it looks like I need a new connector. I found one on AliExpress with 22 day delivery (marked as Gorewatt Inverter Communication Terminal 485 terminal) but I'd like it sooner than that. I can't see anything like it anywhere else.
Dave Foster wrote: Thu Apr 20, 2023 11:46 am
asjp100 wrote: Wed Apr 19, 2023 5:05 pm I don't appear to have such a tool in the spares the installers left behind, so I guess it'll have to be the screwdrivers method.

Not sure which slots you're referring to on the connector. A picture would be very helpful, thanks.
Here’s a couple of shots of the connector, the tool and how it pushes the tangs you can see inwards (you can use flat blade screwdrivers) and the final disassembly.

Click on the pictures and they will rotate to correct orientation

IMG_7769.jpeg

IMG_7767.jpeg

IMG_7768.jpeg

Hope that helps !
Dave Foster
Posts: 824
Joined: Thu Oct 13, 2022 7:21 pm

Unfortunately they aren’t readily available and appear to be bought by solar manufacturers in bulk, they are very tricky to get hold of - you could try Foxess support and see if they can help.

But here’s a quick tip, if you remove the screw from an unused pin, it will drop out (be careful when you do it so you don’t lose it), you can then swap it for the dodgy one you have stripped and you’ll be good to go.
ChrisH
Posts: 4
Joined: Fri Jun 23, 2023 12:15 pm

Thanks Dave,

Funnily enough I stumbled across that after I removed one of the screws, so I have indeed swapped a spare pin for the damaged one. I just need to work out why emails alerts aren't working from this topic so I can see helpful comments more quickly!

So the next thing...

I'm hoping to use the solar data in the custom controller for my oil boiler, so I can intelligently heat water either with the immersion heater or the oil, as a starting point.

I naively hoped that data would be streamed out on the RS485 and all I had to do was to listen. I see nothing on my oscilloscope except about 20V of 50Hz, and nothing at all as a differential measurement - basically 0V. I did attach an RS485 USB adapter and took a look with a terminal emulator in case the data is very intermittant, but there's nothing at 9600 baud. I'm thinking this is a polled interface, or maybe isn't even enabled (otherwise I'd expect either a positive or a negative differential voltage of 4V or so). The inverter menu gives the RS485 device ID but there's no option to enable or disable so I'm not sure. Maybe it's listening for commands.

Any ideas for how to get data out of the inverter easily? My controller has TTL RS232 so I was hoping to use an RS485 to TTL converter. Having said that, my controller is WiFi enabled and the inverter installation has a WiFi stick fitted for communication with FoxCloud, but I haven't worked out how to get data from it. Either interface would be good but probably R485 is more reliable.

Any advice would be very welcome. Meanwhile, perhaps I'd better read up on ModBus!
Post Reply