Hi Automateys,
New user, I’m trying to create my YAML to read and write MODBUS switches and relays.
Not yet a MODBUS problem as I cannot get past the configuration checker. The checker insists it sees a block end or start in unexpected places. I’ve tried numerous indent regimes, and examples cut and pasted from the web without ever getting an acceptable response from config checker.
Questions about MODBUS addressing will surely follow!
My YAML so far…
Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
Text to speech
tts:
- platform: google_translate
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
config paras
serial connection
modbus:
- name: “hub1”
close_comm_on_error: true
delay: 5
timeout: 1
type: serial
baudrate: 9600
bytesize: 8
method: rtu
parity: N
port: /dev/ttyUSB0
stopbits: 1
################################################
sensors:
- name: “top_stair_upper”
slave: 110
address: 7
scan_interval: 1
data_type: int16
#input devices to be scanned often
output devices
- platform: template
lights:
Office_Light:
name: "Office_Hall_Light"
turn_on:
service: modbus.write_register
data:
hub: "hub1"
unit: 115
address: 3
value: 1
# device workshop troffer 'ON'
and the config tester result…
Error loading /config/configuration.yaml: while parsing a block mapping
in “/config/configuration.yaml”, line 16, column 5
expected , but found ‘-’
in “/config/configuration.yaml”, line 181, column 5
Yes, I know you can’t see the line numbers, the errors seem to be wherever the script starts with a minus “-” sign, and it has moved about with each attempt at a new edit. It does not seem to be grumbling about the actual MODBUS setting anymore, I reckon they are o.k. now. I can find no reference to block starts and ends in the ref or help files. All suggestions welcome, Thank you.