Hello everybody! I need your help!
My intended goal: Integration of DfRobot 4in1 soil sensor RS485 IP68 Soil Temperature Moisture pH And EC Meter for Precision Agriculture & Irrigation Solutions into home assistant by using a T-CAN485 – LILYGO® board.
Problem: I have managed to connect the T-Cab485 to HA, however the sensor is not responding... I have tried different things like swapping A and B or connecting the VCC of the sensor to the + Pin of the board's power supply, but nothing helped.
I have chosen a 12V 3A power supply because the sensor needs 5-30V and the board 5-12V.
Here is my yaml:
esphome:
name: tcan485-soil-sensor
friendly_name: T-CAN485 Soil Sensor
on_boot:
priority: 100
then:
- output.turn_on: enable_5v_pin
- output.turn_on: rs485_en
- output.turn_on: rs485_se
esp32:
board: esp32dev
framework:
type: esp-idf
wifi:
ssid: "********"
password: "*********"
ap:
ssid: "TCAN485Soil Fallback"
ota:
platform: esphome
web_server:
port: 80
logger:
level: DEBUG
logs:
modbus: WARN
modbus_controller: WARN
uart: WARN
output:
- platform: gpio
id: enable_5v_pin
pin: GPIO16
inverted: true
- platform: gpio
id: rs485_en
pin: GPIO17
inverted: true
- platform: gpio
id: rs485_se
pin: GPIO19
inverted: true
mqtt:
broker: 192.168.1.104
port: 1883
discovery: true
discovery_retain: false
uart:
id: uart_bus
tx_pin: GPIO22
rx_pin: GPIO21
baud_rate: 9600
parity: NONE
stop_bits: 1
modbus:
id: modbus_bus
uart_id: uart_bus
modbus_controller:
id: soil_controller
address: 0x02
modbus_id: modbus_bus
update_interval: 60s
sensor:
- platform: modbus_controller
name: "Soil Humidity"
address: 0x0000
unit_of_measurement: "%RH"
register_type: holding
value_type: U_WORD
accuracy_decimals: 1
lambda: "return (x / 10.0);"
- platform: modbus_controller
name: "Soil Temperature"
address: 0x0001
unit_of_measurement: "°C"
register_type: holding
value_type: U_WORD
accuracy_decimals: 1
lambda: "return (x / 10.0);"
- platform: modbus_controller
name: "Soil EC"
address: 0x0002
unit_of_measurement: "µS/cm"
register_type: holding
value_type: U_WORD
accuracy_decimals: 0
- platform: modbus_controller
name: "Soil pH"
address: 0x0003
unit_of_measurement: ""
register_type: holding
value_type: U_WORD
accuracy_decimals: 1
lambda: "return (x / 10.0);"
Here are logs:
[09:43:26][W][modbus:064]: Stop waiting for response from 1 274ms after last send
Can someone help me fix that?
