Hi,
I find many examples in this topic of yaml configurations where absolute volume and relative volume are calculated in on single instnace. e.g.:
- platform: ultrasonic
trigger_pin: GPIO1
echo_pin: GPIO3
name: "Water Tank Level"
unit_of_measurement: "%"
accuracy_decimals: 0
update_interval: 5s
filters:
- lambda: return ((((x*100)-20)-(123-20))/(123-20))*-100;
- filter_out: nan
- platform: ultrasonic
trigger_pin: GPIO1
echo_pin: GPIO3
update_interval: 5s
name: "Water Tank Volume"
unit_of_measurement: "l"
accuracy_decimals: 0
filters:
- lambda: return ((((x*100)-20)-(123-20))/(123-20))*-1000;
- filter_out: nan
When I do so, I get an error that I just cannot fix?
As if it is not allowed to use the same pins twice to calculate absolute and relative volume?
Can anyone point me in the right direction?
My complete yaml:
esphome:
name: ibcsensor002
friendly_name: IBC
area: Tuin
platform: ESP8266
board: d1_mini
# Encryptie sleutel: "QEDjdbLjPr7ZosmBBCvYWA="
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
manual_ip:
static_ip: 192.168.31.132
gateway: 192.168.31.99
subnet: 255.255.255.0
ap:
ssid: "Ibcsensor002 Fallback Hotspot"
password: "be"
logger:
api:
encryption:
key: "QEDjdbLjPr7ZnKfP9tBBCvYWA="
ota:
- platform: esphome
password: "1aa73b1d97c3d8eee005c11992ce8573"
web_server:
port: 80
time:
- platform: homeassistant
id: homeassistant_time
text_sensor:
- platform: version
name: ibcsensor002 ESPHome Versie
- platform: wifi_info
ip_address:
name: ibcsensor002 IP
ssid:
name: ibcsensor002 Wifi
bssid:
name: ibcsensor002 MAC
switch:
- platform: restart
name: "IBC Aan/Uit"
sensor:
- platform: uptime
name: IBC Uptime
filters:
- sliding_window_moving_average:
window_size: 15
send_every: 15
- platform: wifi_signal
name: IBC WiFi
unit_of_measurement: '%'
filters:
- filter_out: nan
- sliding_window_moving_average:
window_size: 10
send_every: 4
send_first_at: 3
- delta : 5
- lambda: |-
if (x <= -100) {
return 0;
} else {
if (x >= -50) {
return 100;
} else {
return 2 * (x + 100);
}
}
- platform: ultrasonic
trigger_pin: D1
echo_pin: D2
name: "Inhoud [l]"
update_interval: 600s
unit_of_measurement: "l"
icon: 'mdi:water'
accuracy_decimals: 0
filters:
# delta : 1
- lambda: return ((((x*100)-4)-(98-4))/(98-4))*-900;
- offset: -17.0
- filter_out: nan
- median:
window_size: 15
send_every: 4
send_first_at: 1
- platform: ultrasonic
trigger_pin: D1
echo_pin: D2
name: "Inhoud [%]"
update_interval: 600s
unit_of_measurement: "%"
icon: 'mdi:water'
accuracy_decimals: 0