Modbus TCP for EV charger

Hi there
I’m new to MODBUS-TCP and would therefore like some guidance for a start-stop function (eventually with a scheduler) for my EV charger.

I can communicate with the charger with MODPULL - all working fine however I’m having difficulties with the yaml file. The address for the start-stop charging is 76 (16-bit signed); 1 = Off, 2= On.

Can you help?

Br. Lars

Try something like this:

modbus:
  - type: tcp
    host: IP_ADDRESS
    port: 502
    switches:
      - name: EV charger
        address: 75
        command_on: 2
        command_off: 1

See Modbus - Home Assistant

I assume you mean the modpoll command-line program. If so, please share the full command that works.

Hi ondras

Your right. I use the Modpull.exe cmd program.

I tried your input to the yaml. file however I doesn’t work when I try to execute with a “button card”. It reads the off position however when I try to switch it on it becomes unavailable immediately and returns to off.

Hereby the exe that works with Modpull. I hope you have another suggestion.

start charging:
modpoll.exe -r 76 192.168.1.211 2

stop charging:
modpoll.exe -r 76 192.168.1.211 1

If it goes unavailable, there should probably be some error messages in your log.

I have edited my previous post to correct the command_on and command_off values.
I believe address: 75 is correct, because modpoll uses 1 as the first reference while Home Assistant uses 0.

Super. I wasn’t aware that I had to substract 1 from the modpull value. Now it works. Thanks for your help!