Integrating a MODBUS installation with Home Assistant
MODBUS controller in the Gavazzi SH2WEB24
Home Assistant Configiguration.yaml:
modbus:
name: SmartHouse
type: tcp
host: <my_ip_addr>
port: 502
# SmartHouse Functions
switch:
platform: modbus
scan_interval: 10
registers:
- name: test1
hub: SmartHouse
slave: 1
register: 352
command_on: 1
command_off: 0
# SmartHouse Convert to light
light:
- platform: switch
name: Light_test1
entity_id: switch.test1
In the Home Assistant startup logs, we see this error:
Logger: pymodbus.client.sync Source: /usr/local/lib/python3.8/site-packages/pymodbus/client/sync.py:214 First occurred: 10:40:02 (1 occurrences) Last logged: 10:40:02
Connection to (<my_ip_addr>, 502) failed: [Errno 111] Connection refused
The modbus controller is working fine when used with the Gavazzi (windows) software. In that software, only IP and port need to be specified, no other credentials. So why would there be a "connection refused" error addressing it from Home Assistant?