I have an esp32 with an HC-SR04 to measure distance. I got a notification to update it to the latest esphome (2022.12.x) and once I did, the sensor stopped updating. It shows the distance as 0.01m no matter how close/far something is to it. All the other sensors still update fine, wifi, uptime, etc. If I unplug the SR04 the distance goes to unavailable, so it seems to be reading the pins, but the values are not updating.
Here is my esp code.
esphome:
name: garage-car-presence-sensor
esp32:
board: esp32dev
framework:
type: esp-idf
# WiFi connection, correct these
# with values for your WiFi.
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_pwd
# use_address: 10.0.86.82
# Enable Bluetooth Proxy
#bluetooth_proxy:
# active: true
# Enable logging
logger:
# Enable Home Assistant API
api:
# Enable over-the-air updates.
ota:
# Enable Web server.
#web_server:
# port: 80
# Sync time with Home Assistant.
time:
- platform: homeassistant
id: homeassistant_time
# Text sensors with general information.
text_sensor:
# Expose ESPHome version as sensor.
- platform: version
name: Car_position_sensor ESPHome Version
# Expose WiFi information as sensors.
- platform: wifi_info
ip_address:
name: Car_position_sensor IP
ssid:
name: Car_position_sensor SSID
bssid:
name: Car_position_sensor BSSID
# Exposed switches.
# Switch to restart the Car_position_sensor.
switch:
- platform: restart
name: "Car_position_sensor Restart"
# Sensors getting the distance between ceiling and car
# and converting them to the car height
sensor:
# Uptime sensor.
- platform: uptime
name: Car_position_sensor Uptime
# WiFi Signal sensor.
- platform: wifi_signal
name: Car_position_sensor WiFi Signal
update_interval: 60s
- platform: ultrasonic
id: rawdist
trigger_pin: GPIO5
echo_pin: GPIO18
name: "Left Garage Car Distance Raw"
update_interval: 1s
timeout: 4.0m