Hello everyone,
I’m currently having an issue setting up a Modbus RTU sensor with Home Assistant. I’ve connected my Modbus-USB converter to my Raspberry Pi (after trying it on my PC with success), where I have Home Assistant OS installed.
Here’s my current configuration.yml:
modbus:
- name: modbus_hub
type: serial
port: /dev/ttyUSB0
baudrate: 9600
bytesize: 8
method: rtu
parity: N
stopbits: 1
sensor:
- platform: modbus
scan_interval: 60
registers:
- name: "Temperatura"
hub: modbus_hub
unit_of_measurement: '°C'
slave: 1
register: 0
scale: 0.01
precision: 2
- name: "Contenuto d'acqua volumetrico"
hub: modbus_hub
unit_of_measurement: '%'
slave: 1
register: 1
scale: 0.01
precision: 2
After adjusting my configuration and rebooting, I still can’t see the device in my list of devices in Home Assistant. I’ve ensured the correct USB port is set in the configuration. I also tried enabling debug logging for Pymodbus and noticed an error related to the port /dev/ttyUSB1
, but I’ve since corrected it to /dev/ttyUSB0
. However, even after the correction, I still don’t see any device or errors in the log.
Any assistance or suggestions would be greatly appreciated. Thank you!