Skip to content

Monitor water consumption and more with Home Assistant

Hanoh Haim edited this page May 23, 2019 · 5 revisions

Features

  1. Monitor total water consumption per day/week/month

  2. Realtime Notification in case of usage irregularity like

    1. Small leakage – e.g. 1 litter/hour

    2. Big leakage – e.g. you child forgot the water opened

58244093 96ad9e00 7d5a 11e9 81cf da9e28fecc29
Figure 1. per day report

Ingredients

  1. HA

  2. Appdaemon

  3. EV Pulse water meter for example water meter with pulse I’m using Arad with EV

58243664 bdb7a000 7d59 11e9 8d49 a9e39e34679e
Figure 2. water meter ev
  1. Wemo D1 mini with Tasmota firmware

Tasmota configuration

Configure the one of the GPIO to be Counter . Each pulse will increment the counter. However, hardware reset will reset the counter. Because of that there is a need for a custom component

Tasmota configuration (once)
CounterDebounce 1000
TelePeriod 60
SetOption36 20

Install HA custom component

Copy this project <config directory>/custom_components/ folder to your <config directory> directory make sure you are in sync with the the right version of hass (see above) after you copy the data you should reboot/restart HA

Enable counter component

Add this to your configuration file.

HA Custom Component
sensor:
  - platform: tasmota
    name: water_total
    stopic: water_out
    id: 1
    unit_of_measurement: 'l'
    icon: mdi:water-pump
    expire_after: 300
    value_template: "{{ (45497 + (value))|int }}"

 - platform: tasmota
    name: water_total_norm
    stopic: water_out
    id: 1
    unit_of_measurement: 'l'
    icon: mdi:water-pump
    expire_after: 300
    value_template: "{{ (37950 + (value/1.21))|int }}"

This will create two sensors, one counting native pulses and one with normalization to litter. My meter should give one pulse to each litter, but due to denounce (hardware) issues I found that there are 20% more pulses that it should be. So I defined two sensors. It would be important for the Appdaemon apps stage.

Appdaemon script

This app is responsible to notify of a real-time irregularity events. The app should get event from another app when there is somebody at home. Using this information the watermarks could be more sensitive to leakage when nobody at home.

This is an example for 2 taps

Appdaemon Irrigation configuration
water_monitor:
  module: heat_app
  class: CWaterMonitor
  sensor_water_total: sensor.water_total # input: sensor of water in pulses (not litter)
  sensor_water_leak_detector: variable.water_leak_detector # output: filter one pulse
  sensor_water_bursts: variable.water_bursts # output: filter burst in litters
  watchdog_duration_min: 50 # input: high watermark  in minutes to open a tap
  watchdog_leakage_ticks: 3 # input: how many pulses is a leakage?
  max_day: 2000 # input: max consumption a day
  max_burst_l0: 400  # input: max burst in litters
  max_burst_l1: 600  # input: max burst in litters  when garden taps are open
  taps_switchs: [ switch.wbi_p1, switch.wbi_p2] # when one of them is enabled move to burstl1

Grafana/Influx configuration

todo