core: Modbus error with 2021.5.0
The problem
Shortly after upgrading to 2021.5 my system becomes unresponsive and Lovelace won’t load. In the logs I see an error about modbus (see below). I use modbus for connecting to my solar inverter (see below yaml). restored and upgraded again to confirm this is caused by 2021.5.0
What is version of Home Assistant Core has the issue?
2021.5.0
What was the last working version of Home Assistant Core?
2021.4.6
What type of installation are you running?
Home Assistant OS
Integration causing the issue
modbus
Link to integration documentation on our website
https://www.home-assistant.io/integrations/modbus/
Example YAML snippet
modbus:
type: tcp
host: 192.168.8.1
port: 502
sensors:
- name: PV inverter model
address: 30000
count: 15
data_type: string
- name: PV inverter power max
address: 30075
count: 2
data_type: uint
device_class: power
unit_of_measurement: W
- name: PV voltage
address: 32016
data_type: int
scale: 0.1
precision: 1
device_class: voltage
unit_of_measurement: V
- name: PV current
address: 32017
data_type: int
scale: 0.01
precision: 2
device_class: current
unit_of_measurement: A
- name: PV input power
address: 32064
count: 2
data_type: int
device_class: power
unit_of_measurement: W
- name: PV daily active power peak
address: 32078
count: 2
data_type: int
device_class: power
unit_of_measurement: W
- name: PV active power
address: 32080
count: 2
data_type: int
device_class: power
unit_of_measurement: W
- name: PV total production
address: 32106
count: 2
data_type: uint
scale: 0.01
precision: 2
device_class: energy
unit_of_measurement: kWh
- name: PV daily production
address: 32114
count: 2
data_type: uint
scale: 0.01
precision: 2
device_class: energy
unit_of_measurement: kWh
Anything in the logs that might be useful for us?
2021-05-05 20:49:05 ERROR (MainThread) [homeassistant] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/modbus/sensor.py", line 232, in <lambda>
self.hass, lambda arg: self._update(), self._scan_interval
File "/usr/src/homeassistant/homeassistant/components/modbus/sensor.py", line 300, in _update
registers = self._swap_registers(result.registers)
AttributeError: 'ModbusIOException' object has no attribute 'registers'
Additional information
No response
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 35 (8 by maintainers)
English please…
I’m having a similar issue with modbus Serial RTU :
Traceback (most recent call last): File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/usr/src/homeassistant/homeassistant/components/modbus/switch.py", line 155, in <lambda> self.hass, lambda arg: self._update(), self._scan_interval File "/usr/src/homeassistant/homeassistant/components/modbus/switch.py", line 210, in _update self._is_on = self._read_coil(self._coil) File "/usr/src/homeassistant/homeassistant/components/modbus/switch.py", line 224, in _read_coil return bool(result.bits[0] & 1) AttributeError: 'ModbusIOException' object has no attribute 'bits'
My system becomes unstable, I can’t access the web ui, all integrations start to fail with timeouts (from what I see in logs).
La cosa es que en mi caso ha funcionado perfectamente durante meses sin parar recuperando datos cada segundo. Cuanto todo ha empezado a fallar ha sido tras instalar la actualización de Mayo de HA
The patches in 2021.5.2 will help some, hopefully many but not everybody. I am working a patch that will allow the frontend to be responsive, even when there are modbus communication problems.
@trancetornados pero tu problema es seguramente diferente que antes, la mayoría de problemas es porque que hay un desconexión. No puedo ayudarte sin ver un “debug log”. Por favor en futuro escribe en Inglés (vivo en España, pero este es un proyecto que habla Inglés). “but your problem is surely different than before, the majority of problems is because there are a disconnect. I cannot help you without a debug log”
No need to apologize your log is good. I will post in here when the newer PR is ready for test.