Maximize your solar to keep your home warm — Part 1

pascal boudalier
6 min readMar 2


Automatically feed all excess solar energy, and only excess, into existing electric heaters.

See Part 2.

This project is a Blynk contest’s award winner

Sunny days don’t always mean solar production.

Your solar installation may send energy to the power company.

When you add solar to your grid-connected home, with the intend to consume your own production (i.e. self consumption), you will quickly realize that any solar energy not consumed by your home will go to the grid.

This is called “injecting”, or “exporting”. The energy injected is called “surplus” or “excess” solar.

There is nothing that can be done about it. Produced solar energy has to go somewhere.

A grid-tied solar system is designed to maximize the solar panels ‘s production capability. Some do implement specific features to “slow down” , but this is not always the case.

Regulations about injection are country dependent.

Injection can be allowed, tolerated, or strictly forbiden. In some countries you can get some money for the exported energy, in others you do not, and in some others you even have to pay to export!

The electricity grid was not designed with the idea of millions of tiny generation points, all injecting power at the same time (noon on sunny days). Grid operators are cautious about any effect of such injection on grid stability.

In France, where I live, injection from self-consumption installation is disallowed (there is some kind of tolerance for small amount of power).

Beside any regulatory issues, it is also a pity. Why invest in a solar installation to end up providing part of the production for free to the electricity company?

So how to maximize self-consumption?

Maximizing self-consumption

There are various ways to maximize self-consumption:

  • Manually turn-on energy-hungry appliances (eg washing machine, dryers, iron ..) when it is sunny. This requires a bit a discipline, change of habits, and also some level of mental strength (ever felt the urge to start the dishwasher as soon as it is filled with filthy content ?)
  • Use surplus solar energy to heat the water tank, as opposed to using grid energy at night. This is by far the most common use of solar surplus and this requires the installation of a “solar router” (more on that later).

Of course, my family has been trained (brainwashed ?) to have the above discipline.

However, we are not always at home and moreover, my water tank is already heated with “thermal” solar (i.e. sun energy directly converted to heat water).

I live in the French Alps, and for half the year I need to heat the house. But what I want is a way to automatically feed all excess solar energy, and only excess, into existing electric heaters.

Here comes this automation application: solar2heater (Python on Raspberry PI. Available on github)

Solar router is good, but not enough.

Solar routers are devices which read the power flow between your house and the grid. As soon as energy is being exported, they divert it to a specific device, to consume exactly this amount of energy (no more, no less).

Those devices are typically used to power water heaters’ electrical resistance; thereby heating water with energy that , otherwise, would have been exported.

There are many models of solar routers. I am using the eddi from myenergi. I choose this device because it works hand in hand with my Solar Electric Car charger, but this is a subject for another article.

The eddi connects to the home electric panel, like any other appliance. It provides a AC output on which to connect, for example, a water heater. Myenergi insists on resistive-only load.

However, this device alone does not fulfill my need:

  • I want to be able to use existing electric heaters. Unfortunately, solar routers only power devices connected on their dedicated AC output. Rewiring existing heaters is a NO GO.
  • Solar routers have a maximum power output. Even if mine is adequate for a water tank, it is below the production capability of my solar array.
  • Solar routers are designed to produce a variable power (i.e. the value of excess solar at any point in time). This is achieved by modifying the AC voltage (e.g using 100 Volt instead of the traditional 230 Volt) or by distorting the AC sinusoidal wave. A pure resistive load would not mind this, but modern electric heaters may not work with such funky input voltage.
The AC sinusoidal wave (50/60hz) is modified to vary power.

Adding automation to existing heaters.

I decided to combine the flexibility of a solar router powering one dedicated heater (*) with on/off automation of multiple electric heaters already installed in my house.

(*) I removed all electronic from that heater to directly connect to its resistance.

The existing heaters are controlled using wifi-enabled relay. Adding those only requires very modest rewiring and therefore is easy.

Why still using a router ? why not using existing heaters only?

Because the existing heaters are controlled using on/off commands, and they have a fixed power rating. So a 1kw heater will either consume 1kw or 0kw. With such step function, it is not possible to only consume a surplus of , let’s say, 800w.

A very simplified wiring diagram

With this combination of eddi and on/off automation, a typical automation scenario is:

  • The sun rises, the eddi start powering its (eg 1kw) heater with 400w, 600w, 800w …
  • As solar production ramps up, at one point the eddi is providing 1kw to its heater and cannot divert anymore. Solar will start injecting into the grid.
  • This is detected by the application (more on this later), which will turn one of an existing (eg 1.5kw) heater on, using a wifi relay.
  • At 2kw solar production, the existing heater will consume 1.5kw, and the eddi 0.5kw.
  • When the solar production surpasses 2.5kw, the application will turn on a second existing heater.
  • As the solar production drops (cloud, sunset), the application will turn existing heaters off
  • and so on ..

The existing heaters will add loads in a discrete manner (by increments of their power rating), whereas the eddi will always consume the “rest” of the surplus.

Excluding some transient states in the automation loop, no energy should ever be injected into the grid.

The system in action

The graphs below are from my solar monitoring application.

The first one is before the automation described above. Only the eddi is installed.

the grey zone correspond to power injected into the grid
  • The blue curve on top represents the daily solar energy production.
  • The orange curve at the bottom represents the daily energy consumption of the house.
  • The eddi is diverting as much as possible into its heater, but there is too much solar production and some surplus appears.
  • This surplus (the gray zone at the very bottom) is what gets exported into the grid.

So, on that day, 27Kwh were produced from solar, out of which 9kwh got exported.

With automation in place, the consumption curve (orange) nicely follows the production curve (blue), meaning very little energy is left on the table (i.e. exported)

Automation in place

A monthly view:

Prior automation. Notice the 160Kwh exported for that month
Automation in place. Much less export.

In the next article, we shall look at the automation application itself.



pascal boudalier

Tinkering with Raspberry PI, ESP32, RiscV, Solar, LifePo4, IoT, Zigbee, energy harvesting, Python, MicroPython, Keras, Tensorflow, tflite, TPU. Ex Intel and HP