Hi,
My ESP Home has a salt level sensor and it outputs in meter (e.g. 0.13 m). I’d like to convert this to percentage for a gauge but need help!
My ESP Code:
sensor:
- platform: ultrasonic
name: "salt_level_sensor"
unit_of_measurement: "cm"
trigger_pin: D5
echo_pin: D6
pulse_time: 200ms
update_interval: 3s
accuracy_decimals: 2
timeout: 4m
filters:
- lambda: if (isnan(x)) { return 3.1; } return x;
My Gauge code via a template:
type: gauge
entity: sensor.salt_level_percent
name: Zout Niveau 80% = leeg)
min: 0
needle: true
max: 100
unit: '%'
severity:
green: 0
yellow: 80
red: 90
How to make it say 56% instead of 56.666666666667% ?