question

Jimmy Bergetun avatar image
Jimmy Bergetun asked

Modbus device ID for relay 1 and 2 on Cerbo

screenshot-2021-01-27-at-180710.pngI am trying to controll relay 1 and 2 from Home assistant with Modbus . In the Victron modbus tcp register it says com.victronenergy.system (Should be Device/slave id 100?) with address 806 and 807. In Home assistant i have added the following for this "switch"


switch:
  - platform: modbus
    coils:
    - name: "Victron relay 2"
      hub: victron
      slave: 100
      coil: 807

(All "Sensors" from victron works fine)


Anyone here been able to controll the relays on a Cerbo from HA ? Is the Slave ID and Address correct?


cerbo gxModbus TCPAssistants
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

1 Answer
wkirby avatar image
wkirby answered ·

You are writing to a coil. There no available coils to read or write (eg. Function code 1 or 5), only holding registers to read or write (eg. Function code 3 or 6 (single register)).
You need to write to a holding register.
If you just want to control the relay 2 with a request, then write 807 to holding register using Function code 6 (write single holding register). Unit ID 100 is correct also.

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Thank you !! :)

0 Likes 0 ·