Two devices on the uart

I want to use two ultrasonic devices (a02yyuw). They work on UART. One works well. During verification, it constantly generates an error. Where is my mistake?

esphome:
  name: esphome-web-42c958
  friendly_name: ESPHome Web 42c958

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "gbSyzGUByBjwNawfHn/Iwf+UycI7y9+hZ3cL0ARpzFw="

ota:


wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esphome-Web-42C958"
    password: "KsLpqELRTG4f"


captive_portal:
 
web_server:
  port: 80     

i2c:
    sda: 21
    scl: 22
    scan: True
    id: bus_a

uart:
  - id: uart_1
    tx_pin: GPIO12 #blue
    rx_pin: GPIO13 # green
    baud_rate: 9600

  - id: uart_2
    tx_pin: GPIO17 # blue
    rx_pin: GPIO16 # green 
    baud_rate: 9600


dallas:
  - pin: GPIO23 

sensor:

 
  - platform: dallas
    address: 0x1C0000031EDD2A28
    name: "температура зовня"

    
  - platform: "a02yyuw"
    name: "Distance_1"  

  - platform: "a02yyuw" 
    name: "Distance_2







    










    







Which are lines 68 and 83?

I think you need a " at the end of line 68.

1 Like

But now it’s gotten worse. There are even more mistakes

Failed config

sensor.a02yyuw: [source /config/esphome/esphome-web-42c958.yaml:64]
  
  Too many candidates found for 'uart_id' type 'uart::UARTComponent' Some are 'uart_1', 'uart_2'.
  platform: a02yyuw
  name: Distance_1
  disabled_by_default: False
  force_update: False
  unit_of_measurement: mm
  icon: mdi:arrow-expand-vertical
  accuracy_decimals: 0
  device_class: distance
  state_class: measurement
sensor.a02yyuw: [source /config/esphome/esphome-web-42c958.yaml:67]
  
  Too many candidates found for 'uart_id' type 'uart::UARTComponent' Some are 'uart_1', 'uart_2'.
  platform: a02yyuw
  name: Distance_2
  disabled_by_default: False
  force_update: False
  unit_of_measurement: mm
  icon: mdi:arrow-expand-vertical
  accuracy_decimals: 0
  device_class: distance
  state_class: measurement

You haven’t specified uart_id for each a0yyuw

Do read the docs please.

2 Likes