Modbus integration using the usb port
I have just got a FoxESS H1 Hybrid Inverter H1-5.0-E is there any way of just using the USB port to install Modbus for the Nathan Marlor Home assistant integration. What I would like to do is just plug into the USB port where the fox data logger is and then have a modbus to wifi connection in one? Is this possible? If not what should I use. I have read the posts on integrating but my invertor layout seems different. Many thanks,
Edmond
FoxESS H1 Hybrid Inverter H1-5.0-E
5kW of Inverter Power
Panels
Hengdian Group DMEGC Magnetics 4.950 kW Total Solar Power
11 x 450 Watt Panels (DM450M10RT-B54HBT) 4,844 kWh per year
Batteries
FoxESS EP5 x 4 20.72kWh of Battery Storage
Emlite 1-ph Bi-Directional generation meter 100A (1000 pulse/kWh) EM-ECA2-BI
Car Charger Zappi EV Charger 7 kW Single Phase Tethered White EV Charger ZAPPI-2H07TW
Re: Modbus integration using the usb port
No the USB port cannot be used for external ethernet connections.

To run modbus you need to get access to the RS485 communications of the inverter which can be found on the meter/ct connector.

If you have a new H1 inverter it will be a G2 and there are 2 possible connector configurations for the meter connection wiring, i've attached the schematic below - you need to connect to RS485 A/B pins (pins 3&4) - these need to be connected to an RS485 adapter.

Many people use the RS485 USB adapter which is cheap and easy to connect to a computer, my preference is the waveshare device which you connect to over ethernet.
Attachments:
g2ct.jpg
Re: Modbus integration using the usb port
Thank you for the clarification. That is very helpful.
Edmond
FoxESS H1 Hybrid Inverter H1-5.0-E
5kW of Inverter Power
Panels
Hengdian Group DMEGC Magnetics 4.950 kW Total Solar Power
11 x 450 Watt Panels (DM450M10RT-B54HBT) 4,844 kWh per year
Batteries
FoxESS EP5 x 4 20.72kWh of Battery Storage
Emlite 1-ph Bi-Directional generation meter 100A (1000 pulse/kWh) EM-ECA2-BI
Car Charger Zappi EV Charger 7 kW Single Phase Tethered White EV Charger ZAPPI-2H07TW
Re: Modbus integration using the usb port
Hello,

Sorry to jump on this several months on - but I'm in need of connecting a modus to the H1 inverter too.
Looking at the wiring on the wave share USB RS485 connector there is 3 wire connections and you mention connecting pin 3 & 4, which wire goes to where & where is the GND connected to please?


Thanks ;)
Re: Modbus integration using the usb port
It’s a balanced differential pair so you don’t need a ground, just 2 wires - the RS485A (pin 4) goes to the waveshare A connection, and the RS485B (pin 3) goes to the B connection
Re: Modbus integration using the usb port
That’s Fantastic thanks Dave,

So I just need to cut into the two wires that the fitter has done for the CT and take my feed into the usb adapter?
Then I can plug the usb adapter into the machine running home assistant ?

Just struggling to see how the machine running home assistant will recognise the usb?

Thanks
:?:
Re: Modbus integration using the usb port
L19YDC wrote: Sun Jun 22, 2025 2:52 pm That’s Fantastic thanks Dave,

So I just need to cut into the two wires that the fitter has done for the CT and take my feed into the usb adapter?
Then I can plug the usb adapter into the machine running home assistant ?

Just struggling to see how the machine running home assistant will recognise the usb?

Thanks
:?:
Not sure I understand the bit about cutting into the 2 wires for the CT, the CT itself will be wired to 2 different pins (usually pins 7 & 8), unless the installer has put in a multi core cable for you to tap into ?

On the USB adapter, once it is plugged into the home assistant it will be recognised by the OS and should be found when the integration is loaded.

This is for a different adapter but is very similar and describes the process https://github.com/nathanmarlor/foxess_ ... -Converter
Re: Modbus integration using the usb port
Ok Thanks ..... hopefully I can understand how to wire in the 2 wires to the RS485 connection on inverter.
Appreciate the links ........ now got to understand it all :shock:
Re: Modbus integration using the usb port
L19YDC wrote: Sun Jun 22, 2025 4:00 pm Ok Thanks ..... hopefully I can understand how to wire in the 2 wires to the RS485 connection on inverter.
Appreciate the links ........ now got to understand it all :shock:
No problem, if you need any help just shout.
Re: Modbus integration using the usb port
Hello Dave,

Sorry to bother you again ...... I have successfully added the modbus connection thanks to your guidance :D
Now I wonder if you are able to help with adding an automation on the modbus to stop my Ohme EV charger draining all the battery power and pull from the grid instead?


Thanks
Re: Modbus integration using the usb port
L19YDC wrote: Wed Jun 25, 2025 8:35 pm Hello Dave,

Sorry to bother you again ...... I have successfully added the modbus connection thanks to your guidance :D
Now I wonder if you are able to help with adding an automation on the modbus to stop my Ohme EV charger draining all the battery power and pull from the grid instead?


Thanks
Have you set up the Ohme integration as well ?, from what I can see the Ohme integration talks to the Ohme ‘cloud’ and gets it’s information from there like the app. When the EV is charging there is a status entity that will change to ‘charging’ and we can use that in an automation to trigger the battery protection.

The easiest way to protect the battery is to raise minsoc to 100% that will charge the battery slowly (usually around 1kW depending on the number of batteries in your stack) but the most important thing is that it will not discharge when your EV is charging.
Re: Modbus integration using the usb port
Hi Dave,

Thanks yes I have the Ohme integration on HA installed - so now I know what to look for.

Where do I need to set the 100% soc - is that in the foxess app or on HA?
Re: Modbus integration using the usb port
L19YDC wrote: Thu Jun 26, 2025 9:04 am Hi Dave,

Thanks yes I have the Ohme integration on HA installed - so now I know what to look for.

Where do I need to set the 100% soc - is that in the foxess app or on HA?
You need to set in in HA, there is an entity called number.min_soc_on_grid which can be set in an automation using an ‘action’ called ‘number:set’ if you have an automation that sees the state change of your ohme to ‘charging’ and then run an action to set the minsoc to 100%.

You’ll need to remember to set it back to 10% when the ohme status is anything other than charging.
Re: Modbus integration using the usb port
Hi Dave,

First run of the HA automation worked well last night thanks.

Further question: as I'm on the Octopus Intelligent Go + Drive Pack my charging slots can be anytime during the day. Is there a way to restrict the inverter when charging from the grid to its minimum so it's not costing me more in electric?

Thanks
Re: Modbus integration using the usb port
You can change the charge current limit, there is an entity called number.max_charge_current

this in A(mps) and to calculate the charge power you will need to know your battery volts, multiple them together and that will give you the maximum charge power.

If you reduce it to 0 the battery will not charge at all, but you must change it back to the default when you have finished or it won't charge from solar either !
Re: Modbus integration using the usb port
Ok thanks,

So if I use that option and set to zero would it default back to pulling the power from the battery?
Re: Modbus integration using the usb port
It will yes, if you have set your minsoc to 100% the inverter (BMS) will want to charge at a 5A maintenance setting but if you set the charge limit to 0 it will be limited to zero - so it will neither charge nor discharge (obviously you don't have to use 0 you could set a low value such as 2A which will only put a small amount of charge in the battery)

But perhaps the easier option, if you are sure you do not want to charge your battery when the EV is charging, then ignore setting the minsoc to 100%, and instead simply set the entity number.max_discharge_current to 0.
That would need just the one action to be performed and it will stop any battery discharge whilst it is set to zero.
Re: Modbus integration using the usb port
Many Thanks Again Dave,

You have been most helpful - I will have a play with the options to see what works best for me. :D
Post Reply