Modbus TCP

I want to read the venus modbus from victron (ccgx). My config is

modbus:
  name: victron
  type: TCP
  host: 192.168.93.101
  port: 502  

.
.
.

sensor:
  - platform: modbus
    registers:
      - name: Battery
        hub: victron
        unit_of_measurement: "%"
        slave: 100
        register: 843   

I am getting the response:

No response from hub victron, slave 100, register 843

What am I doing wrong?

1 Like

You just need to tweak your modbus hub a little you missed the ( - ) precedes name

modbus:
  - name: victron
    type: TCP
    host: 192.168.93.101
    port: 502

Should be good then I think.

Thanks for your response.

No improvement, still the same error.

1 Like

can you post the error please?

Log Details (ERROR)
Sat Aug 31 2019 14:04:54 GMT+0200 (Midden-Europese zomertijd)
No response from hub victron, slave 100, register 843
1 Like

Try next to remove the double quotes around your unit of measurement …that’s about all I can see?

from the modbus sensor docs

# Example configuration.yaml entry
sensor:
  platform: modbus
  registers:
    - name: Sensor1
      hub: hub1
      unit_of_measurement: °C
      slave: 1
      register: 100

Still no difference. I also removed the line ’unit_of_m...' No result.

Thanks anyway for your help.

1 Like

Well thanks but I haven’t been much help really unfortunately.

Do you have any other modbus devices, switches, binary sensors, etc that are being read?
Other hubs being read?

no, this is my first attempt. In my config there where more sensors bud I deleted them for this test

If that is the case incorrect syntax may be the issue.

If you have only one hub then you dont need the ( - ) in front of name. My mistake not to check…sorry.

Also do you have other sensor platforms?

If you don’t then you dont need the ( - ) in front of platform.

Apart from that double check all syntax is as per the config examples shown in the modbus integration acvice.

I have multiple hubs and multiple sensor platforms so used to seeing things that way.

I happen to be working on this issue myself too and ran into the same issue. I’ve never been able to get 843 to properly read any usable data either. A couple of questions first.

  1. Are you successful in getting other data to pull out? IE: is your Modbus config good?
  2. What device/solar charger are you connecting to? (you’ve named it ‘victron’). what Victron product is it?
  3. What type of battery measurement are you trying to take? and how have you defined it within the product mentioned in q1 above?

In my case I’ve got a 75/15 hooked up to the CCGX via USB with their usb cable.
my Modbus config looks like this:

modbus:
  name: victronsolar
  host: 192.168.23.2
  type: tcp
  port: 502

Here’s a sample of pulling battery voltage for my 75/15 charger

  - platform: Modbus
  scan_interval: 5
  registers:
    - name: Battery Voltage
      hub: victronsolar
      unit_of_measurement: "V"
      precision: 2
      scale: 0.01
      slave: 239
      register: 771
1 Like

Thank you for your response.

Q1: I am new to using modbus, I don’t know how I can test the modbus
Q2: My installation is on a boat. I use a Victron Quattro, a BMV602s and a CCGX
Q3: I want to get the relevant information of the status of the battery in my control panel (hadashboard) in my ‘cockpit’. I looked up the parameters in ’ CCGX-Modbus-TCP-register-list-2.31.xlsx’

The communicating with the CCGX is over ethernet (LAN).

Hi Mark

Have you enabled the Modbus option in the CCGX? It is under the Settings -> Services menu.

Also the “type: TCP” should be lower-case - i.e. type: tcp

Hi Nigel,

Thank for your response.

Yes, In my current version of the config ‘tcp’ is in lower-case. and yes, the Modbus/TCP is enabled on the CCGX

I suggest trying some other register values in case the problem is related to register 843. My sensors.yaml file has the following entries:

####################################################
#                                                  #
#                  SENSOR CONFIG                   #
#                                                  #
####################################################
  - platform: modbus
    scan_interval: 10
    registers:
      - name: "Grid Power"
        hub: victron
        unit_of_measurement: "W"
        slave: 100
        register: 820

      - name: "PV Power"
        hub: victron
        unit_of_measurement: "W"
        slave: 100
        register: 850

      - name: "AC Loads"
        hub: victron
        unit_of_measurement: "W"
        slave: 100
        register: 817

      - name: "Battery Power"
        hub: victron
        unit_of_measurement: "W"
        slave: 100
        register: 842

      - name: "Battery SOC"
        hub: victron
        unit_of_measurement: "%"
        precision: 1
        slave: 100
        register: 843

      - name: "Battery Voltage"
        hub: victron
        unit_of_measurement: "V"
        scale: 0.1
        precision: 1
        slave: 100
        register: 840

      - name: "Battery Current"
        hub: victron
        unit_of_measurement: "A"
        scale: 0.1
        precision: 1
        slave: 100
        register: 841

      - name: "PV Voltage"
        hub: victron
        unit_of_measurement: "V"
        scale: 0.01
        precision: 1
        slave: 247
        register: 776

      - name: "PV Current"
        hub: victron
        unit_of_measurement: "A"
        scale: 0.1
        precision: 1
        slave: 247
        register: 777
        
      - name: "Inverter State"
        hub: victron
        slave: 246
        register: 31       

3 Likes

@emence I see from the FAQ here that:-

Advanced debugging

If all unit-id’s and register-addresses have been checked and re-checked, and still the connection doesn’t work, you could try looking at the modbustcp log file on the GX device.

Follow these steps:

  1. Obtain root access

  2. Login with SSH (use for example Putty in Windows - or simply type ssh root@[ip address here] on a Linux or Mac terminal console.

  3. List the latest log file:

Is it possible for you to try that process and maybe you will be able to get some feedback to help get this sorted?

From what I read it seems you are on the right track with your settings so far…maybe the above process will help?

PS: I also looked here

@emence SOC is only available if you have a networked and connected BMV. The 6 series I don’t believe has that available by default (BT/Ethernet) Is there a VE.Direct port on it? This is what provides information back to get/calculate SOC.

Also, the quattro… that might be using a different register range though than @FXS and I. (700’s) Double check that. The slave 100 register 800 range pulls system stats only. Depends on how it’s connected

I have a BMV (BMV602s). I can read the value through mqtt, but I would prefer to read via the Modbus.

1 Like

I folowed your hint about ‘advanced debugging’ and this is a part of the logfile:

cat /log/dbus-modbustcp/current | tai64nlocal

2019-09-02 18:11:10.232971500 ERROR 2019-09-02T18:11:10.231 "Error processing function code 3, unit id 100, src 192.168.93.7, start address 817, quantity 1 :" "Unit id is available, but start address does not exist"
2019-09-02 18:11:10.266052500 ERROR 2019-09-02T18:11:10.265 Error finding service with device type "solarcharger" at device instance 256
2019-09-02 18:11:10.269226500 ERROR 2019-09-02T18:11:10.268 "Error processing function code 3, unit id 247, src 192.168.93.7, start address 776, quantity 1 :" "Requested device (service) does not exists"
2019-09-02 18:11:10.289978500 ERROR 2019-09-02T18:11:10.289 Error finding service with device type "solarcharger" at device instance 257
2019-09-02 18:11:10.293365500 ERROR 2019-09-02T18:11:10.292 "Error processing function code 3, unit id 246, src 192.168.93.7, start address 777, quantity 1 :" "Requested device (service) does not exists"
2019-09-02 18:11:10.312805500 ERROR 2019-09-02T18:11:10.311 Unkown modbus address:  820
2019-09-02 18:11:10.312805500 ERROR 2019-09-02T18:11:10.311 "Error processing function code 3, unit id 246, src 192.168.93.7, start address 820, quantity 1 :" "Unit id is available, but start address does not exist"
2019-09-02 18:10:38.695617500 ERROR 2019-09-02T18:10:38.694 "Error processing function code 3, unit id 100, src 192.168.93.7, start address 820, quantity 1 :" "Unit id is available, but start address does not exist"
2019-09-02 18:10:38.711975500 ERROR 2019-09-02T18:10:38.710 Unkown modbus address:  850
2019-09-02 18:10:38.711975500 ERROR 2019-09-02T18:10:38.711 "Error processing function code 3, unit id 100, src 192.168.93.7, start address 850, quantity 1 :" "Unit id is available, but start address does not exist"
2019-09-02 18:11:10.229736500 ERROR 2019-09-02T18:11:10.229 Unkown modbus address:  817
2019-09-02 18:11:10.232971500 ERROR 2019-09-02T18:11:10.231 "Error processing function code 3, unit id 100, src 192.168.93.7, start address 817, quantity 1 :" "Unit id is available, but start address does not exist"

No modbus address seems to exist

2 Likes

I think we’re getting somewhere…

If you go into your CCGX and navigate through the BMV device > Device > scroll down > Device Instance. What does it show?

Here’s what my 75/15 (used to supply power to my off grid Hot Tub) comes up with. It’s connected to the venus GX via a VE.Direct USB cable, so it shows up as a USB device at address ttyUSB0 or Modbus 239: GX-Solar-75-15

1 Like