Hi everybody!
Taking first steps in HA and decided to connect solar inverter directly to HA Modbus integration.
Seems so easy, if you read the HA manual but in reality there is something I missing.
Inverter has RS 485 connector, which is connected to HA host (Odroid) with RS485 to USB serial connector.
Code:
modbus:
- name: Sofar
type: serial
method: rtu
baudrate: 9600
bytesize: 8
parity: N
port: /dev/ttyUSB0
stopbits: 0
When trying to restart the HA to get connection working there will be error, states Key error type
I really have no idea what am I doing wrong.
Logger: aiohttp.server
Source: components/modbus/validators.py:232
First occurred: July 23, 2023 at 22:39:19 (7 occurrences)
Last logged: 13:50:11
Error handling request
Traceback (most recent call last):
File “/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py”, line 433, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py”, line 504, in _handle
resp = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py”, line 117, in impl
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/http/security_filter.py”, line 85, in security_filter_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/http/forwarded.py”, line 100, in forwarded_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/http/request_context.py”, line 28, in request_context_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/http/ban.py”, line 80, in ban_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/http/auth.py”, line 236, in auth_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/http/view.py”, line 148, in handle
result = await handler(request, **request.match_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/api/init.py”, line 329, in post
await hass.services.async_call(
File “/usr/src/homeassistant/homeassistant/core.py”, line 1965, in async_call
response_data = await coro
^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/core.py”, line 2005, in _execute_service
return await cast(
^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/hassio/init.py”, line 565, in async_handle_core_service
errors = await conf_util.async_check_ha_config_file(hass)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/config.py”, line 978, in async_check_ha_config_file
res = await check_config.async_check_ha_config_file(hass)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/helpers/check_config.py”, line 183, in async_check_ha_config_file
config = config_schema(config)
^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py”, line 272, in call
return self._compiled([], data)
^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py”, line 595, in validate_dict
return base_validate(path, iteritems(data), out)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py”, line 387, in validate_mapping
cval = cvalue(key_path, value)
^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/voluptuous/validators.py”, line 229, in _run
return self._exec(self._compiled, value, path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/voluptuous/validators.py”, line 353, in _exec
v = func(path, v)
^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py”, line 818, in validate_callable
return schema(data)
^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/modbus/validators.py”, line 232, in duplicate_modbus_validator
if hub[CONF_TYPE] == SERIAL:
~~~^^^^^^^^^^^
KeyError: 'type`