Counting Rainwater Pump Cycles

Gary recently left a comment against the Rainwater Harvesting – Summary after 4 Months of Operation post suggesting it would be a good idea to log the number of times the rainwater pump gets started. This would monitor the effectiveness of the expansion vessel in avoiding the need to start the pump for every water draw-off and could indicate when that vessel needs maintenance.

The most robust way to do this would be to connect a 230V sensor in parallel with the pump’s switched electrical input and then use a microcontroller to count the number of times the sensor sees a transition from no voltage to mains voltage. A 230V KNX Binary Input module such as the MDT BE-04230 can be configured as a ‘counter’ and could automatically present a count of pump start cycles to the KNX Bus, for onward processing by Home Assistant – but those modules are expensive (about £100). It would also be challenging to connect to the switched electrical input for the pump, since this is via a European-style electrical socket integrated into the pump controller unit in an environment which is prone to getting splashed with water.

Given that this is a nice-to-have rather than an essential metric (and so 100% accuracy is not required) a better solution is probably to infer the number of pumps starts from one or more of the other metrics already being collected for the rainwater harvesting system:

  • The water level in the rainwater tank
  • The volume of water drawn off from the tank, separately in the House and the Outbuildings
  • The electricity usage by the rainwater pump
  • The pressure in the rainwater pipework generated by the pump and maintained by the expansion vessel (and the non-return valve on the pump outlet)

Of these, it is the pressure sensor which looks most promising as a source of data to infer the number of pump starts:

  • The electricity and water meters are ‘polled’ every minute – which is fine for tracking the incrementing counters for kWh and volume but no good for spotting something like the pump current draw suddenly increasing as the motor starts
  • The pressure sensor is connected to a KNX Analogue Input-Output module which is constantly checking the reading but which only publishes an update to the KNX Bus when the reading changes
    • This is the most efficient way of handling unpredictable updates such as this, rather than constantly polling just in case the value has changed
  • From looking at the graph of pipework pressure over time it is clear when the pump runs, so it should be relatively straightforward to create some logic to automatically check for that ‘signal’

A sample graph for a couple of days in late October is shown below, with each tall vertical ‘step’ corresponding to a pump run. Toilet flushes gradually reduce the pressure in stages as those get serviced by the expansion vessel – until that is empty – whereas larger draw-offs from the washing machine or an outside tap typically require the pump to start almost straight away. In every case, it is the sudden increase in pressure to about 4.5 bar which signifies the pump has been running.

Graph of rainwater pipework pressure against time

Home Assistant includes features which were presumably intended for creating thermostat-type controls – spotting when a metric passes a threshold value (e.g. a temperature gets too low) and triggering an action (like turning on a heater). The generic trigger for Numeric State Threshold Crossed looks ideal for monitoring the pressure reading, especially since the documentation states:

This trigger fires when a value crosses a threshold. It does not keep firing while the value stays on the same side of the threshold.

and

If you use an entity in Above (above) or Below (below), Home Assistant compares the value of the watched entity against the value of that entity only when the watched entity updates.

So, in summary:

  • Whenever an updated pressure reading arrives in Home Assistant (by being published to the KNX Bus) this can be checked by a Numeric State Threshold Crossed automation
  • If that reading is above a threshold – say 4.0 bar – a counter for the number of pump starts can be incremented

The YAML code for the Home Assistant automation (generated from the visual editor) looks like this:

alias: Count RWH Pump Starts
description: >-
  Look for increases in the pressure sensed within the rainwater distribution
  pipework and count the number of times the pressure increases above the
  defined threshold
triggers:
  - trigger: numeric_state
    entity_id:
      - sensor.rwh_pump_pressure_bar
    above: 4
conditions: []
actions:
  - action: counter.increment
    metadata: {}
    target:
      entity_id: counter.rwh_pump_start_count
    data: {}
mode: single

The counter is just a ‘virtual entity’ – what Home Assistant calls Helpers – that can be included in a dashboard or used in further calculations. Gary mentioned either pump starts per day or pump starts per litre of water delivered as being useful derived metrics; those are not yet defined, but could be.

It’s early days but the automation has successfully spotted two ‘simple’ pump start cycles. The more challenging ones are when the washing machine takes in a lot more water but does that in several short bursts (while it works out how absorbent a particular load of laundry is) which makes the pump start a few times over the course of a few minutes.

Powerwall Grid Import Limit and Voltage Drop

Before the Tesla Powerwall 3 was installed, prior approval had to be obtained from the local Distribution Network Operator using the “G99” procedure, since the system exceeded the 16A-per-phase limitation of the notify-after-install “G98” procedure. The DNO reviewed the constraints of the electrical supply to the site and specified a maximum Export limit of 5.5kW – the same as they had specified in 2016 for the original solar PV system. Since the generation capacity is now large enough to be able to exceed that limit, there needs to be a device within the installation to ‘enforce’ the limit to the required standards, which the Powerwall 3 is certified to be able to do without relying on third-party components. The limit is configured at commissioning time and can be seen but not updated by the home owner, in the Tesla App. (Post installation it can only be changed by Tesla Technical Support, who presumably need evidence that the DNO has agreed a different limit – which might happen if the local grid infrastructure gets upgraded.)

The Powerwall 3 is also able to enforce an Import limit. This was not set at commissioning time but – given that the feature exists – it seemed prudent to make use of it. The supply is a ‘standard’ UK single phase connection with a nominal capacity of 15kVA, fitted with an 80A main fuse. Some simple calculations showed that simultaneous charging of an electric car (at 7kW) and the Powerwall battery (at up to 8kW) coupled with the GSHP running a heating cycle (at 2kW) and a modest 1kW of consumption by other appliances – coupled with no solar generation – would result in an import of 18kW, or 78A at 230V, which is too close to the 80A fuse limit for comfort. (These fuses will tolerate quite a bit of overload but having a main fuse blow is highly inconvenient.)

At my request, my installer had Tesla Technical Support configure a 17.5kW Import limit which has been in effect since December 2025. (17.5kW equates to 76A at 230V.) The expected behaviour is that the Powerwall will reduce its charge rate to stay within this import limit – which of course only works if Powerwall battery charging is a significant component of the total load. I’ve not been aware of this limit ever being reached, but it came very close today when Intelligent Octopus Go scheduled a car charging slot from 11:30 – 12:00 and the Powerwall took advantage of the temporary off-peak tariff to charge its battery. This happened to coincide with the GSHP running a heating cycle while there was also surprisingly little solar generation, given that it was so close to noon. (The IOG scheduling of the car charging at 11:30 was surely done with the expectation of significant solar generation – though not necessarily on-site.)

Screenshot from the Tesla app showing 17.2kW of Grid Import

These heavy loads only actually overlapped for about 15 minutes but – given the time of day – there was plenty of scope for a brief additional load too (such as one of the instantaneous water heaters or a cooking appliance). It’s good for peace of mind to have the 17.5kW Import limit in place.

The myenergi Zappi EV charge point has a CT clamp on the main supply cable and is also able to adjust its charge rate to stay within a site Import limit – assuming EV charging is contributing to the load. This is primarily intended for when multiple Zappi chargers are operating simultaneously but also works when only one is in use.

One thing I’d not previously considered is the effect of such a large import current on the voltage drop in the supply cabling. Within the House the voltage measured 225V at 11:52 whereas it was 242V at both 11:25 and 12:15. 225V is still within the permissible limits (currently 216V – 253V) but that’s still a significant and quite sudden swing in voltage. Setting an Import limit is probably worthwhile just to manage the voltage drop, even if there is no risk of overloading the main fuse.