This article addresses a common scenario: you own an electric vehicle and a home wallbox, but prefer to charge your car exclusively with surplus solar energy or directly from the grid, avoiding the use of energy stored in your photovoltaic battery. I’ll try to showcase how I automated this using Loxone home automation. 

If you have photovoltaic system installed on your house and are also keen to use electric or plug-in hybrid vehicle, you might want to solve similar problem as I did.  

Using Loxone home automation, I wanted to prevent my electric vehicle, charged via a KEBA wallbox, from drawing power from my Wattsonic home storage battery. This was crucial because discharging the storage battery to charge the car is inefficient due to energy losses and accelerates battery wear, making it uneconomical. Also, in my setup this meant depleting the photovoltaic battery storage very quickly. 

KEBA wallbox P30
KEBA KeContact P30

Normally, when solar production falls short of the wallbox’s demand, the inverter supplements the deficit by drawing from the storage battery, similar to how it would for any high-demand appliance. 

One for instance might be to have your Wallbox connected outside of the smart-metered section, so your inverter won’t notice that load when car is being charged, ensuring that only the surpluses from energy production can be used. 

Until very recently, I have been fiddling with the Work Mode, switching it from “General” to “Economic mode” every time I wanted to preserve the energy in the home storage from being used for re-charging the car. While automated, this approach had limitations. The “Economic Mode” is meant for something a bit different and thus it didn’t play well and solved my goal only partially. The “Economic Mode” primarily focuses on power limits, leading to either unnecessary grid exports or unintended grid purchases, depending on the set limit. 

My idea was rather to have something like the “Hold Charge” function in hybrid vehicles. This ideal solution would instruct the Wattsonic inverter to refrain from discharging the battery while utilizing any surplus solar energy to charge the battery itself. In essence, this approach prioritizes using all available energy sources except the stored energy within the Wattsonic battery. 

Mandatory disclaimer: The information provided in this post is for informational purposes only and should not be considered professional advice. Any actions you take based on this information are entirely at your own risk. I assume no responsibility for any damage, misconfiguration, or any other issues that may arise from implementing the suggestions or instructions provided in this post.

To successfully implement this, I needed: 

  1. To know when a vehicle is connected to a wallbox, or better when energy is drawn.
    • This obviously depends on a wallbox type and connection/control options. Keba P30 offers the ability to talk to the wallbox over LAN, details can be found in the Loxone library.  Over that API it is possible to read the charging current, pause and resume charging and few more.  
  1. I need to know how to talk to the inverter over Modbus, writing registers that store minimal SOC value.
  1. Create an additional Loxone config section controlling this behavior.
    • And finally, this was pretty straightforward, but I will elaborate more on this below. 
Car plugged in and charging
Car plugged in and charging

The simple logic behind 

Whenever a car gets plugged-in to the wallbox and starts drawing some energy I read the current SOC (state of charge) value from the inverter and set that as the minimum SOC for on-grid. This is basically telling the inverter that the current charge level (percentage) is also the minimum value for now, so it cannot draw any energy from the battery beyond that limit. This setting lasts until the car is fully charged and then I return the minimum SOC register variable back to the previous value. 

Getting data from wallbox to see how much energy is drawn
Setting the right SOC minimum value to preserve the battery while the car is charging

The first config line is just to get the current power that is drawn from the wallbox. KEBA tells me only the current taken for each phase so I have to do the math to get the total Watts which I am providing to Meter block to have some consumption statistics and also to have that visualized in the atomium chart. The total power is then fed to the Status block (I3) on the second config line to decide if we are locking the solar battery for discharge or not.

The Status block look the following:

  • I1 is current SOC reading from Inverter BMS
  • I2 is Virtual Input in the Loxone GUI, where user can set the On-Grid SOC minimum. Normally you would probably not touch this at all, but during winter you might want to have higher number as the battery would be sitting too long almost discharged.
  • I3 is connected to the output from wallbox providing the energy draw

Please note the two Analog MinMax Limiter blocks that are there as a protection for not supplying wrong value in case of error (for instance in case the read from Modbus fails SOC would be zero!). Both limiters are set from 20 to 100 just for safety reasons.

Based on the two rules in the Status block the Wattsonic inverter gets the value that is written over Modbus into register 52503. This sets the On-Grid Battery End SOC value either to the Virtual Input user preset or to the current SOC in case a car is being charged.

In reality this can look like this: 

Let’s say we have Wattsonic battery SOC default on-grid limit set to 20%, at this moment it is charged at 60% level and the sun is charging it at 3kW. 

Once we plug-in a car that draws 6kW, normally it would start discharging the Wattsonic battery at around 3kW to get the required power. But what happens instead is that Loxone once detects the charging request it sets the SOC minimum to 60%, which prevents taking any further energy from the battery (and locks the 60% stored in). At that moment the inverter can only provide the 3kW from the direct sun production and the rest is taken from the grid. 

Should the car request less energy (for instance at the final stage of the charging) or the sun provides more than the car needs, the surplus is being stored in the storage battery as usual. 

Once the charging event finishes (in my implementation it means when the car takes less than 0.5kW), Loxone re-sets the SOC register to the initial value 20% and the energy from the battery storage can be used as before. 

Is this useful?

Using this Loxone can help you to preserve your energy stored in a battery storage in a moment when some big consumption device gets connected. Obviously the usefulness is fully at your disgrace, and there might be situation where this tweak not make sense. Key factors to consider are the capacity of the main battery storage, the estimated solar production, the capacity of EV battery and so on.

Someone could argue that it does not really matter how the energy in the battery storage is used throughout the day and that in the end the total consumption (home + EV) is almost the same.

There might be also additional complexity integrated, like in my case I am not charging EV when the grid tariff (HDO) is high. But I can override that in the Loxone UI in case I really need to charge the car now at any costs. Anyway, any comments are welcome.

Leave a Reply

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