Connecting to a plasmatronic solar charger via us usb to serial converter using modbus protocol
I’ve successfully talked to it with Python using minimalmodbus
sensor:
platform: modbus
registers:
- name: Voltagereg
slave: 8
register: 8370
modbus:
type: serial
method: rtu
port: /dev/ttyUSB0
baudrate: 9600
stopbits: 1
bytesize: 8
parity: E
log file returns the following error:
homemeassistant.bootstrap: Invalid config for [sensor.modbus]: required key not provided @ data[‘registers’][0][‘register’]. Got None. (See ?:?). Please check the docs at https://home-assistant.io/components/sensor.modbus/
In addition, have tried both but should the slave and register values be in decimal or hex?
Thanks,
Rob.
Post code using preformatted text so that we can tell if it’s a formatting problem.
See how that error is looking for “registers”? It looks like you’re not formatting the configuration correctly. You need to define each register under a registers: block like the example on the component page.
It was an alignment issue, mind you I did study the formatting pretty closely, think I just needed a good overnight sleep.
Of course it all makes sense when it works but frustrating when it’s not.
Is there something I could use to step through the YAML code to debug the formatting?
Guess it’s a learning curve but spending vast amount of time just getting the text alignment right. Using notepad ++
P…S , Tidying up the values but, happy to post code for reading the plasmatronic solar charger if anyone interested.