I am trying to run both Modbus type serial and also read a separate USB port using serial at the same time but when I do, I don’t get anything from the serial connection, but I do from Modbus.
When I run them separately both USB devices work fine. Below is my config.
sensor:
- platform: serial
serial_port: /dev/ttyUSB0
baudrate: 9600
- platform: command_line
name: CPU Temperature
command: "cat /sys/class/thermal/thermal_zone0/temp"
unit_of_measurement: "°C"
value_template: "{{ value | multiply(0.001) | round(1) }}"
template:
sensor:
- name: deviceXDHWT1
unit_of_measurement: "°C"
state: "{{ states('sensor.serial_sensor').split(',')[0].split(' ')[1] | float(default=0) }}"
- name: deviceXDHWT2
unit_of_measurement: "°C"
state: "{{ states('sensor.serial_sensor').split(',')[1].split(' ')[2] | float(default=0) }}"
- name: deviceXDHWT3
unit_of_measurement: "°C"
state: "{{ states('sensor.serial_sensor').split(',')[2].split(' ')[2] | float(default=0) }}"
modbus:
name: "deviceX"
type: serial
method: rtu
port: /dev/ttyUSB1
baudrate: 9600
stopbits: 1
bytesize: 8
parity: N
binary_sensors:
- name: "HEATER_RLY"
scan_interval: 5
slave: 100
address: 0
input_type: discrete_input
Nothing obvious in the logs apart from the template being unable to process due to sensor.serial_sensor being empty.
Any suggestions welcome.