esphome / feature-requests

ESPHome Feature Request Tracker
https://esphome.io/
411 stars 26 forks source link

Temperature compensation for Ultrasonic Component #2296

Open ghost opened 1 year ago

ghost commented 1 year ago

Describe the problem you have/What new integration you would like

Ultrasonic sensor are quite sensitive to environment temperature, in reality when temperature delta is huge distance shift by +-10cm. It's is more ideal when ultrasonic have temperature compentation feature:

Screenshot 2023-06-29 at 6 42 29 PM

Please describe your use case for this integration and alternatives you've tried:

Current config to resolve this issue

  - platform: ultrasonic
    ...
    id: ping_sensor
    filters:
      - lambda: |-
          return x / 343.0 * (331.3 + 0.606 * id(temp_sensor).state);

Additional context

 - platform: dallas
    address: 0x17020b9177583c28
    name: "Internal Temperature"
    resolution: 12
    id: temp_sensor

  - platform: ultrasonic
    trigger_pin: D5
    echo_pin: D6
    name: "Ping Sensor"
    update_interval: 100ms
    accuracy_decimals: 3
    timeout: 1.5m
    pulse_time: 20us
    id: ping_sensor
    compentation_source: temp_sensor
Rudd-O commented 1 year ago

Continue to use the filters to solve the issue, compadre. It would be strange to have a "compensation sensor" (plus all the parameters it may need) for every component.

ghost commented 1 year ago

okay, this feature was an optional improvement rather than force implement

drahdiwaberl commented 1 year ago

thanks for sharing, though