Write to Multiplus II from home assistant

I have just got a Home assistant system working with:

  1. Home assistant on a Raspberrt pi 4
  2. victron Venus OS on a raspbberry 3b

to venus OS I have connected a Multiplus II via mk3 interface and a Smart solar charger via the Vedirect output to USB. (everything seams to work fine)

I have also added some stuff in configuration.yamal so I can read stuff from the Multiplus (the smart solar does not work for some reason. )

So to my question. I now want to write to my Mutliplus.
On/off (Switch position adress 33)
Set the max current from grid. I know that I need to write an integer to Adress 22 but what is the syntax for that?

Can someone please advice me how to do this ?

I have just copy pasted examples when getting everything to work so far so I dont dare to figure it out by just guessing from other exaples …

Ok I will answer my own question, hope it will help someone else :slight_smile:

so simple once you know how it works…
So this script do the trick for setting max current limit .

new_script:
  alias: New Script
  sequence:
  - service: modbus.write_register
    data:
      hub: victron # victron is the name i have picked when defining  modbus in configuration.yaml 
      address: 22
      slave: 239
      value: 100 #scale x10 so this means 10A in the victron 
  mode: single
1 Like