Turning a dumb water heater into a smart hot water battery using excess solar power with off-the-shelf components

Hey everyone,

I’m excited to share my journey and solution for transforming a basic electric water heater into an intelligent hot water battery, primarily powered by surplus solar energy. Like many of you, I’ve been looking for efficient ways to utilize my excess solar generation, and this setup has proven to be incredibly effective.

The Problem: A “Dumb” Boiler and Unused Solar

My existing hot water setup consisted of a “dumb” electric boiler connected to a smart plug. This boiler has a simple mechanical thermostat (a physical dial) and no internal temperature sensor or smart controls whatsoever. It operates in an all-or-nothing fashion, drawing 1500W when active, or nothing at all.

Initially, my approach to utilizing solar surplus was straightforward: I had an automation that would turn the boiler on via the smart plug only when my solar export exceeded 1500W. While this worked to some extent, it had significant limitations:

  • Wasted Potential in Lower Export Scenarios: During periods of lower solar generation, particularly in winter, I often had a consistent surplus of, say, 500W or 1000W. Since this wasn’t enough to trigger the 1500W threshold, this valuable excess energy went unused, and my water wouldn’t heat.
  • Reliance on Grid Power: Consequently, I often found myself needing to supplement heating with electricity from the grid, even when there was some solar export that could have been partially utilized.
  • Basic Pre-heating Automation: I did have a basic automation in place that would look at the weather forecast and anticipated solar generation for the coming day. Based on this, it would pre-heat the water overnight during off-peak hours (when electricity prices were lower). While helpful, this didn’t address the core issue of dynamically using current solar surplus.

I realized I needed a more granular control over the boiler’s power consumption to truly maximize my self-consumption. I extensively researched alternatives, including dedicated hot water heat pump boilers and specific energy storage solutions like the Solyx Energy WaterAccu. However, these options were consistently very expensive, and in the case of the Solyx Energy system, not easily controllable or integrable with Home Assistant. This led me to the WPC3700 from Iammeter, a device designed to precisely control heating elements based on available surplus power, and crucially, perfectly integratable via MQTT into Home Assistant. This was exactly what I needed to make my “dumb” boiler smart.

The Solution: Integrating the WPC3700 with Home Assistant

Here’s how I integrated the WPC3700 with my existing Home Assistant setup and off-the-shelf components to create a robust and efficient hot water battery system.

I acquired the WPC3700 via Amazon, and its initial setup, including Wi-Fi connectivity, was straightforward. My objective was to use surplus solar energy for hot water heating by dynamically adjusting the WPC3700’s power target.

Imgur

Initial Integration Challenge: The Feedback Loop

As I don’t have an Iammeter smart meter, I opted to integrate the WPC3700 with my HomeWizard P1 meter. The P1 meter provides total energy export and import data. The intended logic was simple: set the WPC3700’s power target based on negative values from the P1 meter, indicating energy export. For example, a P1 meter reading of -500W (meaning 500W export) would correspond to a 500W target for the WPC3700.

However, a challenge arose with this direct integration: When the WPC3700 began consuming power (e.g., 500W), the P1 meter’s net export reading would immediately decrease, potentially dropping to 0W, as the exported power was now being consumed internally by the boiler. This would cause the WPC3700’s target to instantly drop to 0W, creating an unstable and unusable control loop.

Solving the Feedback Loop: Independent Boiler Measurement

To resolve this, it was crucial to independently measure the boiler’s power consumption. For this purpose, I implemented an Ikea INSPELNING smart plug on the boiler’s power supply. This plug provides real-time data on the boiler’s active power draw, completely independent of the P1 meter’s net reading.

With both the P1 meter’s total export/import data and the boiler’s individual power consumption available, a correction was required. I created a “helper” entity in Home Assistant to calculate the true net export. This helper subtracts the boiler’s current power consumption (from the Ikea smart plug) from the P1 meter’s export/import reading. This corrected value provides a stable and accurate input for the WPC3700, ensuring it only consumes power when there’s genuine surplus energy available for export to the grid.

The calculation is essentially: True Net Export = P1 Meter Reading (Export is Negative) - Boiler Consumption (from INSPELNING). So, if P1 is -1000W (1000W export) and the boiler is consuming 500W, the True Net Export passed to the WPC3700 would be -1500W.

Imgur

The blue line, “P1 meter Power,” is consistently near 0 W (specifically -2 W at the indicated timestamp). This is the desired behavior, as it signifies that virtually all generated surplus solar energy is being consumed internally by the boiler, preventing export to the grid when the boiler is active.

The yellow line, “Boiler Ikea Power,” shows the real-time power consumption of the boiler as measured by the Ikea INSPELNING smart plug. In the segment after the dashed blue line, it’s consistently consuming around 344.6 W (at the timestamp). This indicates the WPC3700 is actively regulating the boiler’s power.

The red line, “Netto Stroom Gecorrigeerd” (Corrected Net Power), represents the calculated “true net export”. As intended, this value is derived by subtracting the “Boiler Ikea Power” from the “P1 meter Power.” At the timestamp, it shows -344 W. This confirms that the corrected value accurately reflects the boiler’s consumption relative to the P1 meter’s reading, providing the stable input for the WPC3700’s regulation. The P1 meter remaining near zero, while the boiler consumes power, demonstrates the successful energy diversion.

Addressing Data Synchronization Issues

During implementation, I identified a potential issue related to the update frequency of the P1 meter and the Ikea INSPELNING smart plug. If the P1 meter updated its value (reflecting the boiler’s power consumption) before the INSPELNING plug had updated its reading, the calculated “true net export” helper could become temporarily inaccurate. This asynchronous updating could lead to unreliable control of the WPC3700, causing erratic power adjustments.

I addressed this in two ways to ensure maximum stability:

  1. P1 Meter as Master Update Trigger: Since the P1 meter is the primary source for overall grid interaction, I configured the “true net export” helper to only update its value when the P1 meter updates. In Home Assistant, a template sensor deriving its value from two entities (like P1_meter_export - Boiler_consumption) will typically update whenever either of the source entities updates. By specifically tying the helper’s update trigger to the P1 meter, I ensure the calculation is always based on the most recent P1 data, preventing the helper from updating on stale INSPELNING data if the P1 meter hasn’t changed. Prior to implementing this, the graph of the “true net export” was very erratic due to unsynchronized entity updates. Since this change, the corrected power graph is perfectly stable.
  2. Forced INSPELNING Updates during Operation: Additionally, through an automation, I’ve implemented a mechanism to force the Ikea INSPELNING smart plug to update its value every 1 second when the conditions are met for the WPC3700 to be actively regulating power. This ensures that when the boiler is expected to be consuming power, its consumption data is as fresh as possible, minimizing the window for desynchronization and maintaining the accuracy of the corrected export value.

Refining WPC3700 Setpoint Accuracy

While the initial setup with the corrected export and synchronization measures worked well, a second challenge emerged: the WPC3700’s actual power consumption often didn’t precisely match the setpoint it received, especially at higher wattages (from 1200W and above). This discrepancy could lead to the boiler drawing slightly more or less power than intended, affecting the precise utilization of surplus energy.

To tackle this, I implemented an offset helper. This helper is also configured to update only when the P1 meter updates, ensuring all relevant calculations remain synchronized. The offset is calculated by taking the boiler’s actual power consumption (from the INSPELNING plug) and subtracting the WPC3700’s last sent setpoint. This difference represents the current deviation between the commanded power and the actual power drawn.

This calculated offset is then applied to the next WPC3700 setpoint. By continuously adjusting the setpoint based on the observed difference, the system achieves a nearly perfect match between the WPC3700’s target and the boiler’s actual power consumption. This dynamic adjustment significantly improves the accuracy of energy diversion, ensuring optimal use of available surplus power.

This graph illustrates the effectiveness of the offset helper in precisely aligning the WPC3700’s target setpoint with the actual power consumed by the boiler.

The blue line, “Boiler Ikea Power,” represents the actual real-time power consumption of the boiler as measured by the Ikea INSPELNING smart plug. This is the measured power draw.

The yellow line, “Wifi controler boiler,” is a helper entity. This helper takes the value of the “corrected net export” (which indicates potential surplus power) and transforms it into an absolute value, constrained between 0 W and 1500 W. This “Wifi controler boiler” helper therefore represents the intended power target for the WPC3700 – how much surplus power would be exported if the boiler wasn’t consuming it, up to its maximum capacity.

The red line, “Wifi controler boiler - offset,” represents the adjusted setpoint that is actually sent to the WPC3700. This is the “Wifi controler boiler” value with the calculated offset applied.

The graph clearly shows that, with the implementation of this offset, the “Wifi controler boiler” (yellow line - the intended target) is brought into nearly perfect alignment with the “Boiler Ikea Power” (blue line - the actual consumption). This means that the power commanded by the WPC3700 almost exactly matches the power the boiler actually draws. The dynamic adjustment ensures the boiler efficiently consumes precisely the available surplus solar energy, maximizing self-consumption and minimizing grid interaction.

While the core system works exceptionally well, I did encounter and address a couple of additional edge cases for optimal performance:

  • Low Setpoint Behavior: I observed that at very low setpoints (e.g., below 20W), the WPC3700 sometimes unpredictably caused the boiler to draw maximum power. To prevent this, I implemented a safety mechanism: when the true net export falls below 50W, the WPC3700’s setpoint is explicitly set to 0W. This ensures stable operation and avoids unintended grid imports during low-surplus conditions.
  • Intelligent Update Control: To further optimize system efficiency and reduce unnecessary updates, I created a Home Assistant conditional helper. This helper determines when the WPC3700 should actively receive setpoint updates. For instance, if there’s no surplus power (0W export), there’s no need for the Ikea plug and WPC3700 to constantly update their readings. This conditional logic ensures that the system only actively regulates and updates when it’s genuinely useful for surplus energy diversion.

These refinements have contributed to the robust and reliable operation I now experience.

Conclusion and Results

I hope this detailed breakdown of my WPC3700 integration, including the solutions for data synchronization and setpoint accuracy, is helpful for others in the community. My goal was to create a robust system that efficiently uses my surplus solar energy to heat my hot water, transforming a simple appliance into a crucial component of my smart home’s energy management. I’m very pleased with the results so far, as I can now utilize even small amounts of excess solar, significantly reducing my reliance on grid power for hot water.

Feel free to ask any questions or share your own experiences and improvements. I’m keen to hear your thoughts and continue refining this setup!

8 Likes

For a first time poster, you sure know how to make an entrance :grinning::muscle:t3:. Thank you for sharing!

4 Likes

Great job! I’ve mucked about with an ESP board to handle some automated logic on my solar water heater a few years ago, but not at this level of control.

A few things I had to deal with which you might wanna look into:

  • Overheating logic: I don’t see any mention of the current water temperature in your post. You certainly don’t want to be heating your water (no matter the excess production) if it’s already close to boiling point.
  • Legionella protection: Basically the opposite of the above point. You’re gonna need to ensure that the water is safe, irrespective of production. Off the top of my head, something like 60C for an hour daily should do it.
  • Low temperature threshold + boost heating: Similar to the above, but this is for comfort, not safety. You’ll need a way to make sure the temperature is sufficiently hot in the colder months. A basic check an hour or 2 before the time you usually shower should do it. Boost heating is identical, but triggered manually (on a timer) for when you know the current temperature is not sufficient for eg. 2 consecutive showers.

Hope the above gives you enough ideas and keeps you busy for the rest of the year :wink:

2 Likes

Thanks for the great feedback and insights!

Overheating Logic: Appreciate the concern! My boiler’s mechanical thermostat is wired in series after the WPC3700. This means the thermostat will always cut power to the heating element if the water reaches its set temperature, regardless of the WPC3700’s output. So, while the WPC3700 controls how much power is supplied (based on surplus), the boiler’s thermostat is the ultimate safety cutout for temperature. So even if the WPC has a setpoint of e.g. 350W, the boiler will draw nothing if its thermostat determines it doesn’t need heat.

Legionella Protection & Low Temperature Threshold + Boost: Both excellent points, thanks! I already have a temperature measurement directly on the boiler’s outer shell using a Shelly device from a previous project. I plan to integrate both of these functionalities (Legionella prevention, especially for winter, and comfort-based boost heating) using this existing temperature measurement.

Cheers!

1 Like

I do something similar using a pyscript blueprint from this forum and a Tesla T-Smart. Has been working for well for 2 years without issue :+1:

Nice work! When the ‘salderingsregeling’ in the Netherlands will be stopped around 2027, I probably want to integrate a system in my boiler well. Only thing is that the boiler currently is fed by a woodstove in winter and heatpipes in summer. So it will probably get a little complex to make sure all systems can put their energy in the boiler :slight_smile: I’ll keep this one in mind!