I have been using Modbus RS-485 with XRUSB adapter for reading data from solar charge controller with Home Assistant 0.107.4. Now I am trying to build the new version of this setup using the new Raspberry PI OS and Home Assistant 2022. The configuration is not working with this version. I don’t see any error messages in the home assistant log. I only see one message in the log file “modbus communication open”. There are no messages about the sensors.
Here is the modbus definition in the configuration.yaml
Thank you so much for the help. I made the change to the sensor definition. Yes, in the past versions, I used to have all modbus sensors including other sensors defined in sensors.yaml. Defining the sensors like that is not working anymore. I am wondering if this is due to a major architecture change in the configuration files across the board, not just Modbus. I separated the whole Modbus definition to a separate file called modbus.yaml and added the include for the Modbus file.
Additionally, I had to change "register" to "address" and "register_type" to "input_type" and add input_type for all sensors. On my charge controller, the holding registers start with 0x9... and the input registers start with 0x3...
I changed from:
register: 0x3104
register_type: input
to:
address: 0x3104
input_type: input
configuration.yaml
modbus: !include modbus.yaml
modbus.yaml
- name: modbusdevice
type: serial
baudrate: 115200
bytesize: 8
method: rtu
parity: N
port: /dev/ttyXRUSB0
stopbits: 1
message_wait_milliseconds: 5000
retries: 20
retry_on_empty: true
close_comm_on_error: false
sensors:
- name: Battery Voltage
unit_of_measurement: V
slave: 1
address: 0x3104
input_type: input
precision: 2
scale: 0.01
scan_interval: 30
- name: PV Power
unit_of_measurement: W
slave: 1
address: 0x3102
input_type: input
precision: 2
scale: 0.01
scan_interval: 30
- name: Load Power
unit_of_measurement: W
slave: 1
address: 0x310E
input_type: input
precision: 2
scale: 0.01
scan_interval: 30