I’ve successfully set up my Modbus project, but I’m encountering an issue with the config.yaml file. When I include the Modbus sensors directly in the config.yaml, everything works perfectly. However, when I try to use an include file with the same configuration, it doesn’t work, and I see the blue circle indicating a connection issue. Here’s what my setup looks like:
Working Configuration (Directly in config.yaml):
yaml
modbus:
- name: waveshare
type: tcp
host: 192.168.1.250
port: 502
delay: 0
timeout: 5
sensors:- name: gym2_pv1_power
address: 186
input_type: holding
scan_interval: 5
slave: 1
- name: gym2_pv1_power
Non-Working Configuration (Using Include File):
yaml
modbus: !include modbus.yaml
modbus.yaml File:
yaml
modbus:
- name: waveshare
type: tcp
host: 192.168.1.250
port: 502
delay: 0
timeout: 5
sensors:- name: gym2_pv1_power
address: 186
input_type: holding
scan_interval: 5
slave: 1
- name: gym2_pv1_power
I’m not sure what’s missing here. The include file method worked for other configurations like automations and scripts, but not for Modbus. Could it be a syntax issue or a problem with how the include directive is handled for Modbus? Any insights would be greatly appreciated!