Skip to content

Commit

Permalink
fix esphome config
Browse files Browse the repository at this point in the history
  • Loading branch information
zanix committed Mar 5, 2024
1 parent bec0664 commit 8ce8602
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions esphome/water-softener-salt-monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ sensor:
trigger_pin: D1
echo_pin: D2
name: "Salt level raw"
id: "${name}_raw"
id: raw_level
update_interval: 1min
unit_of_measurement: "m"
filters:
Expand All @@ -97,7 +97,7 @@ sensor:
unit_of_measurement: "%"
# ((Salt Height - Bottom) * 100 / (Max - Bottom)
# Bottom should be the lowest level, usually the brine level.
lambda: return ((id(${name}_raw).state - 0.72) * 100) / (0.21 - 0.72);
lambda: return ((id(raw_level).state - 0.72) * 100) / (0.21 - 0.72);

- platform: template
name: "Salt level cm"
Expand All @@ -107,4 +107,4 @@ sensor:
update_interval: 5min
unit_of_measurement: "cm"
# (Tank Height - Salt Height) * 100
lambda: return (0.93 - id(${name}_raw).state) * 100;
lambda: return (0.93 - id(raw_level).state) * 100;

0 comments on commit 8ce8602

Please sign in to comment.