Modbus stopped working with rel 2021.7

after a (quick) test: Modbus seems working again! Thanks

hi tested with new update but still get either: entity not available or cant find entity, thanks
(querying Victron GX controller for modbus )
Francois

hi
I tested again and after updating my code to the config style all is working :slight_smile:

Oh, it was not me who repaired it, I just wanted to point to the update that should fix the issue and was interested in the results. Sorry if there was some confusion.

Just wondering what others have as settings for how often to read via modbus? Trying to find a balance between speed of reaction and not overloading the system

so, Modbus is working again :star_struck:

BUT…

the sensor-readings are a bit out of scale… are there changes to the scaling?

Instead of 600W at the same time the day before i got 12000000W… so 10000x … :crazy_face: :roll_eyes:

i had to set the scale from …

scale: .01
…to…
scale: .000001
…to get in the same ballpark and i am still searching for the “times 2”-thing…

does anyone else have the same problems?

#EPEver eBox-Wifi-01 modbus
modbus:
  - type: rtuovertcp
    host: 10.0.0.63
    port: 8088
    name: "Solar2EP"
    delay: 5
    close_comm_on_error: false
    retry_on_empty: true
    retries: 10
# Modbus sensors for EPever Charge Controller 4 (4310 AN)
    sensors:
    - name: "Sol2 Battery Array Capacity 4"
      unit_of_measurement: '%'
      slave: 1
      address: 12570
      input_type: input
    - name: "Sol2 Solar Power Watts 4"
      unit_of_measurement: W
      slave: 1
      address: 12546
      input_type: input
      scale: .000001
      count: 1
      precision: 2
      reverse_order: true
    - name: "Sol2 Solar Amps 4" 
      unit_of_measurement: A
      slave: 1
      address: 12545
      input_type: input
      scale: 0.01
      precision: 2
    - name: "Sol2 Solar Voltage 4" 
      unit_of_measurement: V
      slave: 1
      address: 12544
      input_type: input
      scale: 0.01
      precision: 2
    - name: "Sol2 Battery Charging Watts 4" 
      unit_of_measurement: W
      slave: 1
      address: 12546
      input_type: input
      scale: .000001
      count: 1
      precision: 2
      reverse_order: true
    - name: "Sol2 Battery Charging Amps 4"
      unit_of_measurement: A
      slave: 1
      address: 13083
      input_type: input
      scale: 0.01
      precision: 2
      count: 1
      reverse_order: true
    - name: "Sol2 Battery Voltage 4"
      unit_of_measurement: V
      slave: 1
      address: 13082
      input_type: input
      scale: 0.01
      precision: 2
    - name: "Sol2 Load Watts 4"
      unit_of_measurement: W
      slave: 1
      address: 12558  # low 12550  high 12551 #12558
      input_type: input
      scale: 0.01
      precision: 2
    - name: "Sol2 Load Amps 4"
      unit_of_measurement: A
      slave: 1
      address: 12549
      input_type: input
      scale: 0.001
      precision: 2
    - name: "Sol2 Load Volts 4"
      unit_of_measurement: V
      slave: 1
      address: 12548
      input_type: input
      scale: 0.01
      precision: 2
    - name: "Sol2 Battery Temperature 4"
      unit_of_measurement: °C
      slave: 1
      address: 12560
      input_type: input
      scale: 0.01
      precision: 2
    - name: "Sol2 Controller Temperature 4"
      unit_of_measurement: °C
      slave: 1
      address: 12561
      input_type: input
      scale: 0.01
      precision: 2
    - name: "Sol2 Energy Generated Today 4"
      unit_of_measurement: KWh
      slave: 1
      address: 13068
      input_type: input
      scale: 0.00001
      precision: 2
      count: 2
      reverse_order: true
    - name: "Sol2 Energy Generated this Month 4"
      unit_of_measurement: KWh
      slave: 1
      address: 13070
      input_type: input
      scale: 0.00001
      precision: 2
      count: 2
      reverse_order: true
    - name: "Sol2 Energy Generated this Year 4"
      unit_of_measurement: KWh
      slave: 1
      address: 13072
      input_type: input
      scale: 0.00001
      precision: 2
      count: 2
      reverse_order: true
    - name: "Sol2 Total Energy Generated 4"
      unit_of_measurement: KWh
      slave: 1
      address: 13074
      input_type: input
      scale: 0.00001
      precision: 2
      count: 2
      reverse_order: true   

I’m using 10s for reading PV power and net power from the inverter, 300s for “static” values and 60s for my ventilation system (could increase that interval some time… but doesn’t make any problems).

You find my modbus settings here, if you are interested:

3 Likes

OK, Scaling seems to be correct now, without me changing anything…
just restarted the pi instead of just reloading the core and supervisor

i changed scaling back to 0.01 and introduced scan_intervals - i only need minute-values here

Just wanted to say my modbus is working again with 2021.7.4. And actually better/more reliable than it ever did before. Don’t know if it is some kind of coincidence or something changed with my wifi or something else. But there you go.

1 Like

So i switched back to the original scaling of 0.01
so you can see

  1. the day before the update to 2021.7.4
  2. the with crazy high values - i deleted them from the timeseries btween 9:00 and 10:30 then hat the 0.000001-scaling in place
  3. yesterday with the 0.1-scaling and a complete raspberry-reboot

what i can not wrap my head around is:

  • what is the correct scaling now?
  • have there been changes in the processing of recieved values?
  • how are there even negativ values?

i never had negative values before:

for today - to have a reference - i will downgrade to 2021.6.6 again…
i consider purchasing another raspy as a staging- an testing-unit

any other ideas??

Silly me… the config still had

reverse_order: true

instead of the new swap-command…

so i read the wrong values…

thanks for the hint. changed now from

reverse_order: true

to

   swap: word   

everythins fine now :wink:

I just got my wallbe Eco 2.0 (without “S”) installed today but have troubles setting it up in in hass. Would you mind sending the working config incl. sensors for yours? Seems I’m using an old outdated syntax or something that is not accepted but also not throwing an error.

Thanks,
Tobias

Hello
My lines in configuration.yaml are:

modbus:

  • name: varta
    close_comm_on_error: true
    delay: 5
    timeout: 5
    type: tcp
    host: 192.168.0.14
    port: 502
    retry_on_empty: true
    retries: 10
    sensors:
    • name: ‘Scheinleistung’
      address: 1067
      unit_of_measurement: W

    • name: ‘Netz’
      address: 1078
      unit_of_measurement: W
      count: 1
      slave: 1

regards; Dieter

Thanks a lot! Seems I was just using an old, outdated syntax. Working perfectly now - see this post.

Tobias

I have the following configuration that was working with 2021.6.6 (if not mistaken) and worked perfectly until I upgraded to the latest (2021.8.8) and stopped receiving data from the registers.

   - name: victron
     type: tcp
     host: 192.168.1.XX
     port: 502

I’ve followed some of the recommendations here and upgraded my configuration to include some new properties

  - name: victron
    type: tcp
    host: 192.168.1.XX
    port: 502
    close_comm_on_error : false
    delay : 2
    retries: 10
    retry_on_empty: true

But still no success, unable to fetch data from the victron GX device.

nevermind, after updating to the new syntax (sensors below modbus definition) and replacing registers to address did fix it.

I just upgraded from 4.4 to 9.3 and my connection to victron inverter is no longer working

My configuration.yaml section is below with the added 4 lines for delay and such, all my sensors are defined in rv.yaml which is included.

All my sensor are showing “Entity not available”

# Example configuration.yaml entry for a TCP connection
modbus:
  name: VenusGX
  type: tcp
  host: 10.0.0.187
  port: 502
  delay: 5
  close_comm_on_error: false
  retry_on_empty: true
  retries: 10

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

# sensors included by directory
sensor: !include_dir_merge_list sensor/

# switches included by directory
switch: !include_dir_merge_list switch/

I was able to get one test entry to work by moving it from my included rv.yaml file

Is it still possible to use an included file to define all the sensors?

modbus:
  - name: VenusGX
    type: tcp
    host: 10.0.0.187
    port: 502
    delay: 5
    close_comm_on_error: false
    retry_on_empty: true
    retries: 10
    sensors:
      - name: "Soc"
        data_type: uint
        unit_of_measurement: "%"
        slave: 245
        address: 266
        scale: 0.1
        precision: 1

did you put the modbus name into each sensor-entity definition?

ie

  sensors:
  - name: xyz
    hub: <name of modbus entity>