modify esptank

This commit is contained in:
2025-01-22 14:11:05 +00:00
parent 45ec20201b
commit 7db8b5f8b6

View File

@@ -1,5 +1,7 @@
esphome:
name: esptank32
platformio_options:
board_build.flash_mode: dio
esp32:
board: esp32-c3-devkitm-1
@@ -43,8 +45,8 @@ mqtt:
password: !secret mqtt_espsalon
i2c:
sda: 6
scl: 7
sda: 1
scl: 0
scan: true
frequency: 300kHz
id: bus_a
@@ -56,4 +58,45 @@ sensor:
- platform: ads1115
multiplexer: 'A0_GND'
gain: 6.144
name: "ADS1115 Channel A0-GND"
name: "ADS1115 Channel A0"
id: ads0
update_interval: 5s
on_value:
then:
- component.update: waterlevel
- component.update: waterpercent
- component.update: watervolume
filters:
- sliding_window_moving_average:
window_size: 30
send_every: 10
# 0.74 volts à vide.
# 2.8 volts plein.
# linéaire
- platform: template
name: water level
id: waterlevel
lambda: return ( id(ads0).state - 0.74 ) * 0.9;
icon: "mdi:arrow-expand-vertical"
unit_of_measurement: "m"
accuracy_decimals: 2
- platform: template
name: water percent
id: waterpercent
unit_of_measurement: "%"
icon: "mdi:water-percent"
accuracy_decimals: 0
lambda: return ( id(ads0).state - 0.74 ) * 0.9 / 2.0 * 100;
- platform: template
name: water volume
id: watervolume
unit_of_measurement: "l"
icon: "mdi:gauge"
lambda: return ( id(ads0).state - 0.74 ) * 0.9 / 2.0 * 5000.0;
accuracy_decimals: 0