Hello,
I've made an ESPHome project to measure a water level:
# Board: Wemos D1 Mini (ESP8266) (Wemos)
# Definition: definitions/boards/d1_mini/manifest.yaml
esphome:
name: levelkelder1
friendly_name: LevelKelder1
esp8266:
board: d1_mini
logger:
api:
encryption:
key: "xxxxxxx"
ota:
- platform: esphome
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
ssid: LevelKelder1 Fallback Hotspot
password: "********"
captive_portal:
# Availability
binary_sensor:
- platform: status
name: "levelkelder1 Status"
i2c:
- sda: GPIO4 # pin D2
scl: GPIO5 # pin D1
scan: true
id: i2c_1
sensor:
- platform: tof10120
name: levelkelder1
i2c_id: i2c_1
id: sensor_tof10120_1
update_interval: 5sec
accuracy_decimals: 0
unit_of_measurement: "%"
device_class: water
icon: "mdi:car-coolant-level"
filters:
- calibrate_linear:
# - meter_value -> percentage
- 0.05 -> 100
- 0.21 -> 0
- lambda: |-
if (x < 0.0) return 0.0;
if (x > 100.0) return 100.0;
return x;
The ESP works because I get this in the logs:
![]()
For some reason, I can't find the sensor in Home Assistant.
I have a similar project that works perfectly, but this new one doesn't.
Can anyone spot the problem?
Thanks
E.