esphome / esphome/feature-requests

Temperature compensation for Ultrasonic Component

Open
#2,296 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
No language data
Stars
450
Forks
29
PR merge metrics
No merged PRs in 30d

Description

**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
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.