so it seems, there is a problem in modbus rtu component and has suddenly stopped working in 0.108.0. This problem has been observed by many users. I also tried 108.1 & 108.2 but the component is still broken. This shows in logs.
WARNING (MainThread) [pymodbus.client.asynchronous] Not Importing deprecated clients. Dependency Twisted is not Installed
ERROR (MainThread) [homeassistant.setup] Error during setup of component modbus
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 171, in _async_setup_component
hass, processed_config
File "/usr/src/homeassistant/homeassistant/components/modbus/__init__.py", line 139, in async_setup
await hass.async_add_executor_job(start_modbus)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/modbus/__init__.py", line 111, in start_modbus
client.setup()
File "/usr/src/homeassistant/homeassistant/components/modbus/__init__.py", line 207, in setup
loop=self._loop,
File "/usr/local/lib/python3.7/site-packages/pymodbus/client/asynchronous/serial.py", line 75, in __new__
yieldable = factory_class(framer=framer, port=port, **kwargs)
File "/usr/local/lib/python3.7/site-packages/pymodbus/client/asynchronous/factory/serial.py", line 104, in async_io_factory
client = AsyncioModbusSerialClient(port, proto_cls, framer, loop, **kwargs)
File "/usr/local/lib/python3.7/site-packages/pymodbus/client/asynchronous/asyncio/__init__.py", line 689, in __init__
self._connected_event = asyncio.Event()
File "/usr/local/lib/python3.7/asyncio/locks.py", line 249, in __init__
self._loop = events.get_event_loop()
File "/usr/local/lib/python3.7/asyncio/events.py", line 644, in get_event_loop
% threading.current_thread().name)
RuntimeError: There is no current event loop in thread 'SyncWorker_3'.
my config:
modbus:
name: binu1
type: serial
method: rtu
port: /dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0
baudrate: 9600
stopbits: 1
bytesize: 8
parity: N
-switch:
- platform: modbus
scan_interval: 5
coils:
- name: geyser
hub: binu1
slave: 1
coil: 0
registers:
- name: first_ac
hub: binu1
slave: 2
register: 0
command_on: 1
command_off: 0
- name: second_ac
hub: binu1
slave: 2
register: 1
command_on: 1
command_off: 0
on starting a notification says this:
Invalid config
The following integrations and platforms could not be set up:
* [modbus](https://www.home-assistant.io/integrations/modbus)
* modbus.switch
Please check your config.
I am running on Ubuntu 18.04.4 LTS docker
Anyone found the fix yet? kindly suggest?