Modbus Integration - Control Over Function Code

Hi All,

I am currently working on a community energy project and trying to integrate the Solis inverter via direct modbus connection RTU, not over TCP.

In discussions with the manufacture it would appear that I need to be sending modbus commands using different modbus function codes not just the standard ones specified in the doc below.

Modbus - Home Assistant (home-assistant.io)

Would some genus be able to update the modbus integration to allow for the specifying of the function code?

Thanks,
Richard.

Yes please, got the same issue with some Chinese modbus RTU’s

what code do you need to send to modbus rtu?

modbus address

example:

read code function 1 = coil,

    switches:
      - name: switch1
        slave: 1
        address: 128
      - name: switch2
        slave: 1
        address: 129

if you need custom preference, you can use cover and device_class

or maybe you need HMI ( Human Machine Interface ) or SCADA

Modbus TCP has Format
Slave ID; Function Code; Adress, num of coils

so function code is a must have

  • name: power
    slave: 1
    Function: 2
    address: 1002
    coils: 5

that is the goal

Data send to ip: 01 02 03 ea 00 05

see About Modbus TCP | Simply Modbus Software

Voting for this one. My use-case is to send PDUs with the function code 0x6F as that is what the documentation of my device says. The rest of the documentation relies on standard stuff like input and holding registers, working with which is perfectly fine using the current Modbus integration. It is these special commands that are not possible as of now. Some examples:

01 6F 00 00 00 00 D5 C3
01 6F 00 00 00 0F 95 C7
01 6F 00 00 00 FF 95 83

In my case the device mirrors these commands back as a response value if they were successful. Which means that for custom functions the parsing of response values should probably also be possible in a custom way (a template perhaps?).

For now, in order to run these commands, I have to stop the Modbus integration as a precautionary measure to avoid conflicts on the wire. Then I can send them using a serial terminal from the command line.

If it helps, below are a couple more links to similar feature requests:

click
click
click