[Solved]HCSR04 2 sensor which one is getting value

I am using esphome

|11:14:45|[D]|[ultrasonic.sensor:040]|‘Water-Tank Lvl’ - Got distance: 0.13 m|
|11:15:45|[D]|[ultrasonic.sensor:040]|‘Water-Tank Lvl’ - Got distance: 0.13 m|
|11:16:45|[D]|[ultrasonic.sensor:040]|‘Water-Tank Lvl’ - Got distance: 0.13 m|
|11:17:45|[D]|[ultrasonic.sensor:040]|‘Water-Tank Lvl’ - Got distance: 0.14 m|
|11:18:45|[D]|[ultrasonic.sensor:040]|‘Water-Tank Lvl’ - Got distance: 0.14 m|
|11:18:45|[D]|[sensor:093]|‘Water-Tank Lvl’: Sending state 0.12399 m with 3 decimals of accuracy|
|11:19:45|[D]|[ultrasonic.sensor:040]|‘Water-Tank Lvl’ - Got distance: 0.14 m|

sensor:
  - platform: ultrasonic
    trigger_pin: D2
    echo_pin: D1
    name: "Water-Tank Lvl"
    accuracy_decimals: 3
    filters:
      - filter_out: nan
      - median:
          window_size: 15
          send_every: 5
          send_first_at: 3

I have only one sensor/hcsr04 installed but I am getting 2 value, but I want to increase frequency of [sensor:093]

the value of [sensor:093] listed in 192.168.1.215/ and Home-Assitanta

No you aren’t. This is ESPHome talking to the sensor:

|11:14:45|[D]|[ultrasonic.sensor:040]|‘Water-Tank Lvl’ - Got distance: 0.13 m|
|11:15:45|[D]|[ultrasonic.sensor:040]|‘Water-Tank Lvl’ - Got distance: 0.13 m|
|11:16:45|[D]|[ultrasonic.sensor:040]|‘Water-Tank Lvl’ - Got distance: 0.13 m|
|11:17:45|[D]|[ultrasonic.sensor:040]|‘Water-Tank Lvl’ - Got distance: 0.14 m|
|11:18:45|[D]|[ultrasonic.sensor:040]|‘Water-Tank Lvl’ - Got distance: 0.14 m|

and this is ESPHome talking to home assistant:

|11:18:45|[D]|[sensor:093]|‘Water-Tank Lvl’: Sending state 0.12399 m with 3 decimals of accuracy|

For this:

Change your sensor config as per the documentation:

Untitled

e.g.

sensor:
  - platform: ultrasonic
    trigger_pin: D2
    echo_pin: D1
    name: "Water-Tank Lvl"
    accuracy_decimals: 3
    update_interval: 10s  ## change this to what you want. It was the default, 60s. so this is 6x faster
    filters:
      - filter_out: nan
      - median:
          window_size: 15
          send_every: 5  # You will receive updates at 5 x 10s = 50 seconds.
          send_first_at: 3
1 Like