hay there i got an ultrasone sensor hooked up to an esp32 and it should detect the water level of my aquarium right now my tank is emptey not a drip of water in it and the sensor reads ultrasonic.sensor:040]: ‘Ultrasonic Sensor’ - Got distance: 0.352 m when i fill the tank up to what i want to be 100% it reads ultrasonic.sensor:040]: ‘Ultrasonic Sensor’ - Got distance: 0.034 m how would i go about turing this into % i got this
- platform: ultrasonic
trigger_pin: 32
echo_pin: 35
name: "Ultrasonic Sensor"
unit_of_measurement: "%"
accuracy_decimals: 0
update_interval: 5s
filters:
- lambda: return ((0.36 - x + 0.006264) / (0.36 - 0.352)) * 100;
i want
where 0% = distance: 0.352 m
and 100% = distance: 0.034 m