Water tank

mail@pastecode.io avatar
unknown
yaml
a month ago
2.1 kB
4
Indexable
Never
esphome:
  name: esplan-water-tank
  friendly_name: esplan-water-tank
  comment: "Jímka na vodu"

esp32:
  #board: esp32dev
  board: nodemcu-32s
  framework:
    type: arduino

# Enable logging
logger:
  level: WARN

# Enable Home Assistant API
api:
  encryption:
    key: "XXX"

ota:
  password: "XXX"
    
ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO17_OUT
  phy_addr: 0
  manual_ip:
    static_ip: 192.168.1.117
    gateway: 192.168.1.1
    subnet: 255.255.255.0

web_server:

dallas:
  - pin: GPIO32
  
sensor:
  - platform: dallas
    address: 0x46012112a9907e28
    name: "Water Tank - temperature (down)"
  - platform: ultrasonic
    trigger_pin: GPIO13
    echo_pin: GPIO12
    name: "Water Tank - water distance (m)"
    device_class: distance
    unit_of_measurement: "m"
    id: weter_tank_measured_distance
    update_interval: 5s
    timeout: 5m
    pulse_time: 10ms
    filters: 
    - median:
        window_size: 600
        send_every: 30
        send_first_at: 1
  - platform: template
    name: "Water Tank - volume of water in liters"
    device_class: volume
    unit_of_measurement: "L"
    id: water_tank_volume_of_water_in_liters
    lambda: |-
      return round(id(water_tank_column_in_cm).state * 80);
    update_interval: 5s
  - platform: template
    name: "Water Tank - volume of water in m³"
    device_class: volume
    unit_of_measurement: "m³"
    id: water_tank_wolume_of_water_in_m3
    lambda: |-
      return round(id(water_tank_column_in_cm).state * 0.08 * 100) / 100;
    update_interval: 5s
  - platform: template
    name: "Water Tank - water column"
    device_class: distance
    unit_of_measurement: "cm"
    id: water_tank_column_in_cm
    update_interval: 5s
    # 162 = výška jímky, 25 = umístění senzoru nad jímkou
    lambda: |-
      return 162 + 25 - id(weter_tank_measured_distance).state * 100;
  - platform: template
    name: "Water Tank - filling the tank"
    device_class: battery
    unit_of_measurement: "%"
    lambda: |-
      return round(id(water_tank_wolume_of_water_in_m3).state / 0.13);
    update_interval: 5s
Leave a Comment