Ultrasonic UART sensor

The readings were very stable. Since I have moved to another setup over NMEA2k but I also tried the UART one. Could not get it to work for some reason.

Code for a02yyuw UART controlled. You could play with filters if needed.

uart:
    rx_pin: 20 # ESP32 C3 super mini
#    tx_pin: 21 # ESP32 C3 super mini used by switch to trigger 
    baud_rate: 9600

sensor:
  - platform: a02yyuw
    id: a02yyuw_sensor  # UART Controlled
    name: "Water level"
    unit_of_measurement: 'm'
    accuracy_decimals: 2
    filters:
      - multiply: 0.001
#      - throttle: 5s
#      - heartbeat: 5s
#      - quantile:
#         window_size: 7
#         send_every: 4
#         send_first_at: 3
#         quantile: .9
#      - debounce: 0.1s

switch:
  - platform: gpio
    name: "GPIO21 Switch"
    pin: GPIO21
    id: GPIO21_switch
    internal: true

interval:
  - interval: 3s
    then:
      - switch.turn_on: GPIO21_switch
      - delay: 100ms
      - switch.turn_off: GPIO21_switch
      - delay: 50ms