Modbus Commands
Hi,

Anyone with experience from the Modbus Commands API (/op/v0/module/modbus/commands)?

It is not very well documented, but with the help from ChatGpt it seems it takes a body with a data part such as [slave id][function][payload][crc low][crc high] which is then base 64 encoded.

Read functions to get registers are then 0x03 and 0x04, so an example before base 64 encoding for reading a quantity of two, start register 11000, with modbud address 247 would be: f7 03 2a f8 00 02 59 74.

Is that somewhat correct?

Where can I find information for modbus address for my particular Inverter (H3 SK-HWR-12), including information of the registers that I can query?

BR,
Peter
Re: Modbus Commands
I'm not sure how use this will be, but I have a Python project that uses modbus to query my inverter - you can find the configuration for the registers here -https://github.com/andrewjw/foxessprom/ ... sh1.py#L86.

I also uploaded the documentation about modbus to my repo - https://github.com/andrewjw/foxessprom/tree/main/docs.

Hope this helps,
Andrew
Re: Modbus Commands
Thanks, the documentation may come in handy, and possibly also how you use them in your code logically (I am developing in Rust though).

Reason for why I wanted to check out possibilities going through the Modbus Commands API is that I want to be able to check during a mode scheduler time segment for Force Charge whether the inverter is indeed force charging or not. And the normal working mode get setting doesn't get me that information. Tony Matthews explained to me in another thread that Force Charge isn't really a work mode per see but rather a remote control register setting happening behind the scene. So I kind'a hope that those registers would be possible to read using the more low level modbus commands API.

Why do I really need to check Force Charge? Well, it's more of an annoyance that I can't do it easily rather than a nececity :-)
Re: Modbus Commands
One place to get some of the Modbus mappings from is probably here:

https://github.com/TonyM1958/HA-FoxESS- ... ESS-Modbus

These are the HA modbus definitions for various inverters / connections as described by the file names. Not all 100% tested but largely complete.

I think the function code (0x03) you are using will read Input registers at 1xxxx (which is what the mapping also referenced describes) but most of the changes made by Fox ESS recently have been to access Holding registers using function code (0x04) with addresses 3xxxx. It should be the other way around according to the Modbus manuals, but it seems this is the way that works.

Settings you can change are generally input registers with addresses 4xxxx.

If you have worked out the coding for the Modbus commands data via the API, please post some example code that you think works?
H1-6.0-E hybrid inverter
6 x HV2600 v2 batteries
16 x JA Solar 405w panels
7 x Tigo TS4-A-O optimisers
Post Reply