Page 1 of 1

How to configure additional RS485 sensor when Fox KH8 already connected via Waveshare RS485-USB?

Posted: Sat Aug 02, 2025 12:38 pm
by PaulDavey
Hi, this is my first post but have come a long way in 2 months and thanks to everyone for the amazing work on Integrations etc... very grateful.

My system is: KH8, 8kW, 20Ah Batts (all running well)

Problem:
I have a Fox KH8 connected by Waveshare RS485-USB working fine. How do I add another daisy-chained RS485 sensor to the system? When I add the sensor in the standard way through configuration.yaml, it knocks out the Fox ESS modbus (not unexpectedly). So, how can I define the additional external sensor so modbus picks it up?

Background:

Before installation, I created a home server and purchased a USB Waveshare RS485 in readiness for the new system. So that I could be sure I understood something about modbus in Home Assistant, I bought a cheap temperature sensor: https://www.amazon.co.uk/dp/B0DGTQT2F6

I used Modbus Poll to understand the values / addresses on the workbench and then felt confident to adapt the HA configuration.yaml file to:

Code: Select all

modbus:
  - type: serial
    method: rtu
    port: /dev/ttyACM0
    baudrate: 9600
    bytesize: 8
    parity: N
    stopbits: 1
    timeout: 2
    sensors:
      - name: hw_tank_temp
        unique_id: hw_tank_temp
        slave: 1
        address: 0
        input_type: holding
        unit_of_measurement: °C
        state_class: measurement
        scan_interval: 5
        scale: 0.1
        offset: 0
        precision: 1
        data_type: int16
... which worked

I am using the new sensor to measure my hot water tank...

I then removed the modbus code from configuration.yaml and installed the Fox HA Integration using the same serial usb Waveshare and everything went very smoothly.

Now, I would like to re-instate my temperature device to monitor HW tank temps so daisy-chained it to the modbus network using a termination resistor as is standard. The slave id for Fox = 247 and the temp sensor slave id = 1.

If I try to add back the temperature configuration.yaml modbus code, it knocks out the Fox modbus.

Does anyone know how to solve this issue? (I wonder how additional slave inverters are handled?).
I'm now thinking that as the Fox modbus connection is all internally generated with no .yaml file... somehow I need to reference the same modbus connection ID which probably doesn't exist at the point the yaml file is processed. But I am entirely guessing!

Any advice gratefullly received (probably "buy another waveshare-usb!")

Many thanks in advance....

Paul

Re: How to configure additional RS485 sensor when Fox KH8 already connected via Waveshare RS485-USB?

Posted: Sat Aug 02, 2025 5:02 pm
by Dave Foster
The Foxess modbus is using 9600 baud and whilst RS485 is a bus and you can share multiple devices on it, you can't share a modbus session with effectively 2 independent applications trying to control a single USB device, I would imagine the last one that connects might be the only one that would work but it could unsettle both and leave the adaptor in an unknown state.

If you had an IP waveshare device and had it enabled for multi-user it would work as the ethernet port will support multiple independent sessions, but the USB must only have a single application.

You could also get another USB adaptor and use one for Foxess modbus and the other for your temperature sensor with separate buses, but probably the best way would be to use an ethernet version of the adaptor.
Foxess modbus would establish it's own connection and your configuration.yaml would establish a second connection but even then you might have some trouble with multiple versions of pymodbus loaded.

In all honesty I would suggest getting a home assistant compatible wifi connected temperature probe (I use a Sonoff switch and probe on my aquarium).

Re: How to configure additional RS485 sensor when Fox KH8 already connected via Waveshare RS485-USB?

Posted: Sat Aug 02, 2025 5:58 pm
by PaulDavey
Thanks very much for the detailed answer Dave.

So, please could I make sure I understand:
=========================
If I wanted to connect say 5 sensors together, and let's remove Foxess completely. I could create a single modbus connection and access the 5 wired sensors (slaves) without issue provided I configured and addressed them correctly. The reason this works is because I create one modbus configuration file with the slaves included and this is therefore one application.

So, if somehow it were possible to add my temperature slave sensor within the Foxess application then it would actually work... because it is all within the same application. Trouble is, without getting stuck into the code and we are unable to do so. Clearly adding an additional .yaml connection is a non-starter and I can see that now.
=========================

I might well consider a wireless temperature probe but I've looked at the documentation and it looks like multiple modbus devices are catered for: https://www.home-assistant.io/integrati ... onnections
If you actually know it causes problems then I'll have a re-think but as the docs claim it is OK, then it might be that later HA releases have solved these issues. I did want to connect several more slaves to the RS485 network in the airing cupboard!

All the best and thanks again for your time.

Paul

Re: How to configure additional RS485 sensor when Fox KH8 already connected via Waveshare RS485-USB?

Posted: Sun Aug 03, 2025 9:22 am
by PaulDavey
Hi all,

So, I have been thinking more about what Dave was saying and it could be that a modbus connection created directly using pymodbus might not be aware it is part of a multiple modbus system.

In other words, if both modbus hubs are declared with respective slaves in the configuration.yaml file, all is well and good because the Home Assistsant core understands this.

If however, Foxess creates it's own modbus hub and we add a single additional hub through the configuration.yaml file, is Home Assistant intelligent enough to know it's a second hub? This could be a matter of timing... and the Home Assistant object model would need to incorporate hooks (or whatever these are in python - I have a PHP background) in order to successfully time the inclusion of a second modbus.

So there you have it! Dave was probably right and you should stay away from secondary modbus networks if your primary network has been created in Foxess. Probably does not mean definitely... and I would really welcome anyone else's actual experience here.

Thanks

Paul.

Re: How to configure additional RS485 sensor when Fox KH8 already connected via Waveshare RS485-USB?

Posted: Sun Aug 03, 2025 9:29 am
by Dave Foster
PaulDavey wrote: Sat Aug 02, 2025 5:58 pm Thanks very much for the detailed answer Dave.

So, please could I make sure I understand:
=========================
If I wanted to connect say 5 sensors together, and let's remove Foxess completely. I could create a single modbus connection and access the 5 wired sensors (slaves) without issue provided I configured and addressed them correctly. The reason this works is because I create one modbus configuration file with the slaves included and this is therefore one application.
Yes you can have 5 devices on the RS485 bus as long as they have individual addresses, when you use the modbus configuration file you are using the home assistant built in modbus layers which will create a single session.
PaulDavey wrote: Sat Aug 02, 2025 5:58 pm
So, if somehow it were possible to add my temperature slave sensor within the Foxess application then it would actually work... because it is all within the same application. Trouble is, without getting stuck into the code and we are unable to do so. Clearly adding an additional .yaml connection is a non-starter and I can see that now.
Yes that could work but as you say the code is complex, it would be easier to modify a sensor address and definition but not very clean and prone to errors.
PaulDavey wrote: Sat Aug 02, 2025 5:58 pm
I might well consider a wireless temperature probe but I've looked at the documentation and it looks like multiple modbus devices are catered for: https://www.home-assistant.io/integrati ... onnections
If you actually know it causes problems then I'll have a re-think but as the docs claim it is OK, then it might be that later HA releases have solved these issues.
With a separate adaptor you should be able to achieve what you are looking for, use one adaptor for the Foxess modbus and the other will be specified in your configuration file and this will create 2 separate sessions, one from the Foxess modbus integration using it's vendor specific modbus layers, and the other will be the home assistant generic modbus controller (any address specified in the configuration are all accessed by home assistant under the same session).

Re: How to configure additional RS485 sensor when Fox KH8 already connected via Waveshare RS485-USB?

Posted: Sun Aug 03, 2025 3:04 pm
by PaulDavey
With a separate adaptor you should be able to achieve what you are looking for, use one adaptor for the Foxess modbus and the other will be specified in your configuration file and this will create 2 separate sessions, one from the Foxess modbus integration using it's vendor specific modbus layers, and the other will be the home assistant generic modbus controller (any address specified in the configuration are all accessed by home assistant under the same session).
OK thanks again Dave, so the vendor specific modbus layer can live with the generic modbus controller, created through the configuration.yaml file.[/url]

I'm going to try this unit: https://thepihut.com/products/usb-to-2- ... -converter

Screenshot 2025-08-03 150836.jpg

I am hoping to see /dev/ttyACM0 and /dev/ttyACM1 in system hardware, representing virtual serial ports created by the above device. I'll select them manually in the Foxess setup wizard (see attachment... but it might work automatically on ACM0 without needing to re-run the setup). The ACM1 will then service the RS485 sensor slaves in the airing cupboard.

Screenshot 2025-08-03 145107.jpg

You might wonder why I'm doing all this... well I have made my own eddi using PWM and 40A solid state relay which does get warm. I have good heat dissipation + fan built-in but as you can imagine, I want the absolute cast iron, reliable way of controlling it. Using an industrial spec (opto-isolated) serial communication device is about as reliable as I can think of.

I'll post back here with my results.

Paul