Efficient water management is crucial for extended voyages. Let’s explore how to set up a smart system to monitor your water tanks, calculate consumption and refill rates, and provide real-time insights into your water usage, assuming you already have a sensor reporting your tank level in liters to Home Assistant.

Home Assistant Configuration

Let’s start by creating sensors to calculate the water usage rate and a rolling average. Add these to your configuration.yaml:

sensor:
  - platform: derivative
    name: "Water Usage Rate"
    source: sensor.water_tank_liters
    unit_of_measurement: "L/h"
    time_window: "00:10:00"

  - platform: statistics
    name: "Water Usage Rate Average"
    entity_id: sensor.water_usage_rate
    state_characteristic: mean
    sampling_size: 10
    max_age:
      minutes: 10
    unit_of_measurement: "L/h"

The derivative sensor calculates the rate of change of the water tank level, effectively giving us the usage rate. The statistics sensor then creates a 10-minute rolling average of this rate to smooth it out a bit as the values are sometime a bit noisy.

Raw derivative values from tank Liters.

Creating Insights

With these sensors in place, you can now create useful automations and notifications. Here are a few examples:

1. High Consumption Alert

automation:
  - alias: "High Water Consumption Alert"
    trigger:
      - platform: numeric_state
        entity_id: sensor.water_usage_rate_average
        above: 70  # Adjust based on your needs
    action:
      - service: notify.mobile_app
        data:
          message: "High water consumption detected: {{ states('sensor.water_usage_rate_average') }} L/h"

2. Refill Detection

automation:
  - alias: "Water Tank Refill Detected"
    trigger:
      - platform: numeric_state
        entity_id: sensor.water_usage_rate_average
        below: -5  # Negative value indicates filling
    action:
      - service: notify.mobile_app
        data:
          message: "Water tank refill detected at {{ states('sensor.water_usage_rate_average')|abs }} L/h"

I have that one disabled, the one I kept is “Tank Full” because when we’re refilling in a marina it’s great to know when to go stop before it overflows !

3. Low Water Level Warning

automation:
  - alias: "Low Water Level Warning"
    trigger:
      - platform: numeric_state
        entity_id: sensor.water_tank_liters
        below: 40  # Adjust based on your tank size
    action:
      - service: notify.mobile_app
        data:
          message: "Water tank level is low. Current level: {{ states('sensor.water_tank_liters') }} L"

Visualization

To visualize our water usage, I created a custom Lovelace card. Here’s my take on it using the ApexCharts Card (available through HACS) to show both the water level and usage rate:

type: custom:apexcharts-card
header:
  show: true
  title: Water status
  show_states: true
  colorize_states: true
series:
  - entity: sensor.victron_eau_remaining_20
    type: area
    stroke_width: 0
    group_by:
      func: min
      duration: 10min
  - entity: sensor.eau_derivee
    name: Usage Rate
    type: line
    stroke_width: 1
    curve: smooth
apex_config:
  chart:
    height: 300px
  yaxis:
    - min: 0
      max: 300
      title:
        text: Liters
    - opposite: true
      title:
        text: L/h
  xaxis:
    type: datetime
    labels:
      format: HH:mm
  stroke:
    curve: smooth

Advanced Usage Tracking

To gain more insights into your water usage patterns, you could create additional sensors:

sensor:
  - platform: integration
    name: "Total Water Used Today"
    source: sensor.water_usage_rate
    unit_of_measurement: "L"
    method: left
    round: 2

  - platform: history_stats
    name: "Water Usage Time Today"
    entity_id: sensor.water_usage_rate
    state: "> 0"
    type: time
    start: "{{ now().replace(hour=0, minute=0, second=0) }}"
    end: "{{ now() }}"

These sensors will track the total amount of water used and the duration of water usage each day, providing valuable data for long-term water management. Unless you forget you have them.

Conclusion

Can you tell I absolutely use HASS for everython on the boat ? This setup allows you to track consumption rates, detect refills, and receive timely alerts about our water usage.

Remember to adjust the thresholds and tank sizes in the configurations to match your specific setup. With this system in place, you’ll have a much clearer picture of your water usage patterns, helping you to conserve water and plan your trips more effectively.

Happy sailing and efficient water management!

By Romain

Leave a Reply

Your email address will not be published. Required fields are marked *