Modbus stopped working with rel 2021.7

Tags: #<Tag:0x00007fc40a4d96f0>

Modbus of extrnal device no longer working!

after Update from rel 2021.5.4 to 2021.7 modbus ends with error!

my configuration.yaml:
modbus:

  • name: varta
    type: tcp
    host: 192.168.0.14
    port: 502
    sensors:
    • name: ‘Wirkleistung’
      unit_of_measurement: W
      slave: 1
      address: 1066
      count: 1

    • name: ‘Scheinleistung’
      address: 1067
      unit_of_measurement: W
      ‘and some more’
      values are ‘unavalaible’ with error message:
      Logger: homeassistant.components.modbus.modbus
      Source: components/modbus/modbus.py:237
      Integration: Modbus (documentation, issues)
      First occurred: 19:30:16 (1 occurrences)
      Last logged: 19:30:16

Pymodbus: Exception Response(131, 3, IllegalAddress)

However:
modbus of another device is working without errors!
what is wrong?

1 Like

Please format your pasted configuration correctly. See point 11 here.

my configuration.yaml:

#################################################################
modbus:
  - name: varta
    type: tcp
    host:192.168.0.14
    port: 502
   sensors:
      - name: 'Wirkleistung'
        unit_of_measurement: W
        slave: 1
        address: 1066
        count:1
################################################`

`

type error in last reply!
correct:

modbus:
  - name: varta
    type: tcp
    host: 192.168.0.14
    port: 502
    sensors:
      - name: 'Wirkleistung'
        unit_of_measurement: W
        slave: 1
        address: 1066
        count: 1

      - name: 'Scheinleistung'
        address: 1067 
        unit_of_measurement: W

Hi all,

same here, Modbus TCP stopped after latest update.

Second playground system with old SW still catches data.

Please let us know how to get it back.

Thanks

Mike

My Modbus “serial” connection has also stopped working in 2021.7 and 2021.7.1. I believe that I am using the latest/correct syntax. The Modbus “tcp” connections are working fine.

My error is: Pymodbus: Exception Response(131, 3, GatewayPathUnavailable)

The problematic section in my modbus.yaml file is shown below:

# The following line is in the configuration.yaml file, so *not* repeated below
# modbus:
  - name: "em24"
    close_comm_on_error: true
    type: serial
    method: rtu
    # port: /dev/ttyUSB1
    port: /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AK08M9Q7-if00-port0
    baudrate: 9600
    stopbits: 1
    bytesize: 8
    parity: N
    timeout: 2
    sensors:
      - name: "Total Imported Energy"
        scan_interval: 30
        unit_of_measurement: "kWh"
        count: 2              # INT32/double-word value (otherwise values > 3276.7kWh go negative)
        swap: word            # EM24 uses reverse word order
        scale: 0.1
        slave: 1
        address: 62
        precision: 1

Note that I have tried both the “serial-by-id” and “/dev/ttyUSB1” options for the port, without success.

The problem goes away if I revert back to 2021.6.

Related issue here Unavailable Sensors

Same here. All devices (sensors, coils etc.) are no working. Checked the latest documentation which shows no change in syntax.

I have the same problem. After update to 2021.7.1 modbus no longer works. I have three devices running via modbus. All three interfaces are broken. An SDM630 electricity meter, a Corrigo ventilation unit and a Dimplex heat pump system. Pretty stupid, since all the important automatisms in the house are no longer running.
Someone knows what happened?

Same here. Out of three identical SMA solar inverters, set up identically with HA, one (not always the same one) stops receiving data after a few hours. Since update to 2021.7. Other setups with OpenHAB working without any problems. Seems mdobus in HA is broken now somehow.

Looks like modbus integration now stops on error.
Try adding this to modbus config:

    retry_on_empty: true
    retries: 10

I have downgraded to version 2021.6.6 and now the registers reading are OK but the coil writing is still faulty. I did not check @dknt recommendation yet.
BTW, I have 7 different TCP Modbus units, some are Advantech, some are King Pigeon and some are USR.
All act the same.
Correction - After fixing the code to the new syntax, all is working under 2021.6.6.

1 Like
No change with adding the 2 lines. Same error:

Pymodbus: Exception Response(131, 3, IllegalAddress)

Same issue on my Setup after upgrading to 2021.7.1.

Pymodbus: Exception Response(131, 3, IllegalAddress)

Modbus-TCP to Wallbox (Wallbe Eco 2s) → still working
Modbus-TCP to Energy-Meter (Siemens PAC2200) → still working
Modbus-TCP to Li-Ion Battery / Inverter (E3DC S10) → not working

####
# MODBUS Start
####
modbus:
  # E3DC S10
  - name: E3DC
    type: tcp
    host: 192.168.85.55
    port: 502
    retry_on_empty: true
    retries: 10
    sensors:
    - name: PV-Leistung
      slave: 1
      address: 66
      unit_of_measurement: W
      count: 2
      data_type: int
      device_class: power

    - name: hausverbrauch
      slave: 1
      address: 70
      unit_of_measurement: W
      count: 2
      data_type: int
      device_class: power
    
    - name: netzbezug
      slave: 1
      address: 72
      unit_of_measurement: W
      count: 2
      data_type: int
      device_class: power
      
    - name: batterieleistung
      slave: 1
      address: 68
      unit_of_measurement: W
      count: 2
      data_type: int
      device_class: battery
      
    - name: SoC
      slave: 1
      address: 82
      unit_of_measurement: '%'
      data_type: int
      device_class: battery
      
    - name: NEA-Status
      slave: 1
      address: 83
      data_type: int
    
    - name: ems-status
      slave: 1
      address: 84
      data_type: int

  # PAC2200 Wallbox Carport     
  - name: pac2200_carport
    type: tcp
    host: 192.168.85.93
    port: 502
    sensors:
    - name: pac2200_carport_spannungL1
      input_type: holding
      slave: 1
      address: 1
      unit_of_measurement: V
      count: 2
      data_type: float
      
    - name: pac2200_carport_spannungL2
      input_type: holding
      slave: 1
      address: 3
      unit_of_measurement: V
      count: 2
      data_type: float
      
    - name: pac2200_carport_spannungL3
      input_type: holding
      slave: 1
      address: 5
      unit_of_measurement: V
      count: 2
      data_type: float
      
    - name: pac2200_carport_stromL1
      input_type: holding
      slave: 1
      address: 13
      unit_of_measurement: A
      count: 2
      data_type: float
      
    - name: pac2200_carport_stromL2
      input_type: holding
      slave: 1
      address: 15
      unit_of_measurement: A
      count: 2
      data_type: float
      
    - name: pac2200_carport_stromL3
      input_type: holding
      slave: 1
      address: 17
      unit_of_measurement: A
      count: 2
      data_type: float
      
    - name: pac2200_carport_frequenz
      input_type: holding
      slave: 1
      address: 55
      unit_of_measurement: Hz
      count: 2
      data_type: float
    
    - name: pac2200_carport_wirkleistung
      input_type: holding
      slave: 1
      address: 65
      unit_of_measurement: W
      count: 2
      data_type: float
      
    - name: pac2200_carport_wirkarbeit
      input_type: holding
      slave: 1
      address: 801
      unit_of_measurement: Wh
      count: 4
      data_type: float
#####
# Modbus ENDE
#####

I have enabled the debug logs - which show the following errors:

2021-07-12 10:31:34 ERROR (SyncWorker_5) [homeassistant.components.modbus.modbus] Pymodbus: Exception Response(131, 3, GatewayPathUnavailable)
2021-07-12 10:31:34 DEBUG (SyncWorker_4) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:34 DEBUG (SyncWorker_0) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:34 DEBUG (SyncWorker_1) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:34 DEBUG (SyncWorker_4) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:34 DEBUG (SyncWorker_4) [homeassistant.components.modbus.modbus] Pymodbus: Exception Response(131, 3, GatewayPathUnavailable)
2021-07-12 10:31:34 DEBUG (SyncWorker_0) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:34 DEBUG (SyncWorker_3) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:34 DEBUG (SyncWorker_5) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:34 DEBUG (SyncWorker_0) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:34 DEBUG (SyncWorker_3) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:34 DEBUG (SyncWorker_5) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:34 DEBUG (SyncWorker_0) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:34 DEBUG (SyncWorker_3) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:34 DEBUG (SyncWorker_5) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:34 DEBUG (SyncWorker_0) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:35 DEBUG (SyncWorker_0) [homeassistant.components.modbus.modbus] Pymodbus: Exception Response(131, 3, GatewayPathUnavailable)
2021-07-12 10:31:44 DEBUG (SyncWorker_0) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:44 DEBUG (SyncWorker_0) [homeassistant.components.modbus.modbus] Pymodbus: Exception Response(131, 3, GatewayPathUnavailable)
2021-07-12 10:31:44 DEBUG (SyncWorker_4) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:44 DEBUG (SyncWorker_2) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:44 DEBUG (SyncWorker_1) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:44 DEBUG (SyncWorker_0) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:44 DEBUG (SyncWorker_5) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:44 DEBUG (SyncWorker_3) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:44 DEBUG (SyncWorker_3) [homeassistant.components.modbus.modbus] Pymodbus: Exception Response(131, 3, GatewayPathUnavailable)
2021-07-12 10:31:44 DEBUG (SyncWorker_4) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:44 DEBUG (SyncWorker_2) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:44 DEBUG (SyncWorker_5) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:44 DEBUG (SyncWorker_3) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:44 DEBUG (SyncWorker_1) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:44 DEBUG (SyncWorker_0) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:44 DEBUG (SyncWorker_4) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:45 DEBUG (SyncWorker_2) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:45 DEBUG (SyncWorker_2) [homeassistant.components.modbus.modbus] Pymodbus: Exception Response(131, 3, GatewayPathUnavailable)
2021-07-12 10:31:54 DEBUG (SyncWorker_2) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:54 DEBUG (SyncWorker_2) [homeassistant.components.modbus.modbus] Pymodbus: Exception Response(131, 3, GatewayPathUnavailable)
2021-07-12 10:31:54 DEBUG (SyncWorker_1) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:54 DEBUG (SyncWorker_0) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:54 DEBUG (SyncWorker_4) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:54 DEBUG (SyncWorker_2) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:55 DEBUG (SyncWorker_2) [homeassistant.components.modbus.modbus] Pymodbus: Exception Response(131, 3, IllegalAddress)
2021-07-12 10:31:55 DEBUG (SyncWorker_3) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:55 DEBUG (SyncWorker_5) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:55 DEBUG (SyncWorker_4) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:55 DEBUG (SyncWorker_2) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:55 DEBUG (SyncWorker_1) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:55 DEBUG (SyncWorker_0) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:55 DEBUG (SyncWorker_3) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:55 DEBUG (SyncWorker_5) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:55 DEBUG (SyncWorker_5) [homeassistant.components.modbus.modbus] Pymodbus: Exception Response(131, 3, IllegalAddress)
2021-07-12 10:31:55 DEBUG (SyncWorker_4) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:55 DEBUG (SyncWorker_2) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:55 DEBUG (SyncWorker_3) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:55 DEBUG (SyncWorker_5) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:55 DEBUG (SyncWorker_5) [homeassistant.components.modbus.modbus] Pymodbus: Exception Response(131, 3, IllegalAddress)
2021-07-12 10:31:55 DEBUG (SyncWorker_1) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:55 DEBUG (SyncWorker_0) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:55 DEBUG (SyncWorker_3) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:55 DEBUG (SyncWorker_5) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:55 DEBUG (SyncWorker_4) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:55 DEBUG (SyncWorker_4) [homeassistant.components.modbus.modbus] Pymodbus: Exception Response(131, 3, GatewayPathUnavailable)
2021-07-12 10:31:55 DEBUG (SyncWorker_2) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:55 DEBUG (SyncWorker_1) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:55 DEBUG (SyncWorker_5) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:55 DEBUG (SyncWorker_4) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:55 DEBUG (SyncWorker_4) [homeassistant.components.modbus.modbus] Pymodbus: Exception Response(131, 3, GatewayPathUnavailable)
2021-07-12 10:31:55 DEBUG (SyncWorker_0) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:55 DEBUG (SyncWorker_0) [homeassistant.components.modbus.modbus] Pymodbus: Exception Response(131, 3, IllegalAddress)
2021-07-12 10:31:55 DEBUG (SyncWorker_3) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:55 DEBUG (SyncWorker_3) [homeassistant.components.modbus.modbus] Pymodbus: Exception Response(131, 3, IllegalAddress)
2021-07-12 10:31:55 DEBUG (SyncWorker_2) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:55 DEBUG (SyncWorker_2) [homeassistant.components.modbus.modbus] Pymodbus: Exception Response(131, 3, GatewayPathUnavailable)
2021-07-12 10:31:55 DEBUG (SyncWorker_1) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:55 DEBUG (SyncWorker_1) [homeassistant.components.modbus.modbus] Pymodbus: Exception Response(131, 3, GatewayPathUnavailable)
2021-07-12 10:31:55 DEBUG (SyncWorker_5) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-12 10:31:55 DEBUG (SyncWorker_5) [homeassistant.components.modbus.modbus] Pymodbus: Exception Response(131, 3, GatewayPathUnavailable)

Same here, i downgraded to 2021.6.6 for the time beeing.

i had hoped to get a full month of reliabel data on my solar gain and solar battery performance… maybe in august then… :roll_eyes:
this upgrade also seems to have messed with automations… my inverter turned on 9,5h early which ran down the battery while charging at the same time… i exported more energy than i am allowed, so i guess i will get to hear from my utility next time they look at my energymeter :upside_down_face: :wink:

1 Like

Upgrade to “Home Assistant 2021.7.2” did not fix the issue.

1 Like

The same for me.
I have 5 PLC’s that use Modbus IP and a heat recovery unit that uses Modbus RTU.
Both protocols no longer work since update 2021.7.1 so for now I will stay on 2021.6.6

I’ve got it running, using this parameters on each Modbus Hub:

    delay: 5
    close_comm_on_error: false
    retry_on_empty: true
    retries: 10

Solved it for me!

Didn’t worked for long. At least now i become old frozen values instead of Zeros…

My issue has been fixed in 2021.7.3 :grinning: