Battery Storage Integration

265 views
Skip to first unread message

Will Bishop

unread,
Apr 6, 2025, 2:05:38 PM4/6/25
to Loxone English
I'd like to add some home battery storage.
Looking for any feedback on brands and integration into Loxone.

My current set up has a 6kWp solar PV with a Loxone modbus energy meter

AO extension and SSR which diverts excess PV to hot water (Sunamp)

Loxone wall box

Modbus would be my preferred protocol for integration. Any pointers greatly appreciated

Jonathan Dixon

unread,
Apr 6, 2025, 2:12:46 PM4/6/25
to Will Bishop, Loxone English
What is your current inverter, and does it support a DC tied battery?
I have solaredge hybrid PV/battery with modbus integration and it largely works well. The Loxone integration certainly does work well (after fixing the exponent race conditions in the published template) but the inverter occasionally looses sight of the battery and needs a reboot, think this is generic solaredge battery flakiness. If buying again I'd survey pylontech batteries and generic inverters like solax to work with it. 

One thing that's much more complex is if you want control of the battery charge profile rather than just monitoring state, e.g for dynamic pricing response. Solaredge does apparently allow this over modbus - I've not yet attempted to use it - I think support for this varies widely 

HTH

--
You received this message because you are subscribed to the Google Groups "Loxone English" group.
To unsubscribe from this group and stop receiving emails from it, send an email to loxone-englis...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/loxone-english/6e6a7aa0-9f7f-4451-8904-dc39ac20134en%40googlegroups.com.

Will Bishop

unread,
Apr 6, 2025, 3:36:34 PM4/6/25
to Loxone English
Thanks Joth, that's helpful

PV inverter is a Solis 1P6K Not sure if this would support a DC coupled battery, unlikely I suspect

Thinking about controlling the battery charging, I would like to configure Loxone to charge the battery on cheap rate electric overnight if no expected solar excess the following day (month, weather forecast)

David

unread,
Apr 7, 2025, 2:10:54 AM4/7/25
to Loxone English
Yes your inverter doesn’t appear to support DC coupled batteries. That means you’d need an AC coupled battery, which is a point of inefficiency as you’re converting back from AC to DC.
Quite a few battery manufacturers offer an API too, which could be an option as long as they offer control as well as reading data.

Joth, could you share what you fixed with the SolarEdge template from Loxone?
I setup my SolarEdge system at the start of March and noticed some odd monitoring data for short bursts, such as wildly high consumption and incorrect export.
I’d be curious to know if there’s a tweak to the settings that might help avert these anomalies.

I have looked at power control with Solaredge, but whilst there’s information, there are no real world examples. I think there’s a home assistant integration for battery control, so I may delve into that to see what modbus registers are being used to control charging and discharging.

David
On Sunday, 6 April 2025 at 19:12:46 UTC+1 Joth wrote:

Jonathan Dixon

unread,
Apr 22, 2025, 9:24:13 AM4/22/25
to David, Loxone English
On Mon, 7 Apr 2025 at 07:11, David <da...@dles.uk> wrote:
Yes your inverter doesn’t appear to support DC coupled batteries. That means you’d need an AC coupled battery, which is a point of inefficiency as you’re converting back from AC to DC.
Quite a few battery manufacturers offer an API too, which could be an option as long as they offer control as well as reading data.

Joth, could you share what you fixed with the SolarEdge template from Loxone?


The issue is the scaling factors (suffix _SF) are polled separately to the values they apply to, so when they update you get a race condition and see a transient junk value that appears as a spike in the data stream. To work around this I used two different approaches:

1/ for M_AC_Power (the main grid power) I read 4 16-bit registers together as a single 64-bit value, and then crack open the parts (power per three phases, and scale factor) and do the math to calculate the correctly combined values. As they're all read together it is atomic, no chance to race. I sample this a 1Hz so it's pretty fast responding to changes in grid demand; good enough for PV redirect use cases in my experience.

Here I am exporting 4kW (single phase grid connection)

image.png

2/ for M_Exported_Energy and M_Imported_Energy I sample the scaling factor at a higher frequency than the underlying values (8s period vs 30s), and then impose a 12s settle delay before committing any updated value as valid.  This is messier than the atomic read used in #1 above, but the registers are too far apart in the register map to use that approach.  Fortunately the import/export energy registers are slower updating and not so latency sensitive so this approach works very well in practice.

image.png

After inventing all this I discovered someone on the internet had already done something similar in German https://loxwiki.atlassian.net/wiki/spaces/LOX/pages/1544520402/Solaredge+Wechselrichter but of course I prefer my version :-)




 
I setup my SolarEdge system at the start of March and noticed some odd monitoring data for short bursts, such as wildly high consumption and incorrect export.
I’d be curious to know if there’s a tweak to the settings that might help avert these anomalies.

I have looked at power control with Solaredge, but whilst there’s information, there are no real world examples. I think there’s a home assistant integration for battery control, so I may delve into that to see what modbus registers are being used to control charging and discharging.

David
On Sunday, 6 April 2025 at 19:12:46 UTC+1 Joth wrote:
What is your current inverter, and does it support a DC tied battery?
I have solaredge hybrid PV/battery with modbus integration and it largely works well. The Loxone integration certainly does work well (after fixing the exponent race conditions in the published template) but the inverter occasionally looses sight of the battery and needs a reboot, think this is generic solaredge battery flakiness. If buying again I'd survey pylontech batteries and generic inverters like solax to work with it. 

One thing that's much more complex is if you want control of the battery charge profile rather than just monitoring state, e.g for dynamic pricing response. Solaredge does apparently allow this over modbus - I've not yet attempted to use it - I think support for this varies widely 

HTH

On Sun, 6 Apr 2025, 19:05 Will Bishop, <bisho...@gmail.com> wrote:
I'd like to add some home battery storage.
Looking for any feedback on brands and integration into Loxone.

My current set up has a 6kWp solar PV with a Loxone modbus energy meter

AO extension and SSR which diverts excess PV to hot water (Sunamp)

Loxone wall box

Modbus would be my preferred protocol for integration. Any pointers greatly appreciated

--
You received this message because you are subscribed to the Google Groups "Loxone English" group.
To unsubscribe from this group and stop receiving emails from it, send an email to loxone-englis...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/loxone-english/6e6a7aa0-9f7f-4451-8904-dc39ac20134en%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Loxone English" group.
To unsubscribe from this group and stop receiving emails from it, send an email to loxone-englis...@googlegroups.com.

David

unread,
Apr 23, 2025, 5:20:08 PM4/23/25
to Loxone English
Thank you for the detailed post with your solution!
This is exactly the situation I'm seeing with my install at random times. I did wonder if the scaling factor being read at a different time may be causing the issue.

I'll give this a try over the weekend, but I have no doubt it will fix this issue I've been having!

David

David

unread,
May 10, 2025, 9:18:57 AM5/10/25
to Loxone English
I've just given your solution a try Joth, and have run into an unusual issue.
This relates to the grid power flow calculation, which I've screenshot below.

Screenshot 2025-05-10 at 14.09.08.png
I'm on a single phase supply, and the wattnode is definitely wired for phase one, yet the data appears to be coming from phase three. The scaling factor also appears to be identical to the phase power draw.
Comparing this with the default SolarEdge template from Loxone, if I apply a 100000 divider to the number, it matches the export correctly.

Screenshot 2025-05-10 at 14.09.16.png

Screenshot 2025-05-10 at 14.14.15.png

I'm curious to know what inverter you're working with in your install? I'd imagine the sunspec logging should be identical, but maybe there's a difference.
I've got a SE5000H inverter, 10kw 400v battery and the wattnode meter.

David

Paul Watkin

unread,
May 10, 2025, 1:00:00 PM5/10/25
to Loxone English
for the new build I have a single phase supply and have a Solaredge inverter with 28 panels on east west with optimisation and then two Givenergy AC coupled inverters with a 9.5Kwh battery on each - when I bought the batteries a few years ago nobody had the AIO concepts and 20Kwh of DC battery from SolarEdge was ridiculous even at cost, so its a bit of an odd setup.

Whilst the Solaredge Inverter, Givenergy EMS etc have their own power meters I have put a Loxone Power Meter in the garage consumer unit prior to all other switchgear with a view to using that as my definitive "am I importing or exporting and how much measure" within Loxone, from which I am then going to derive any logic for utilsation of export by the heating buffer tank, car charger etc (Hot water cylinder is a Mixergy Solar diverter tank and is self contained).

I am assuming the issue above only affects Loxone when you are trying to read values from SolarEdge, i.e. the same strange spikes don't appear in the Solaredge App? 

Has anyone tried using the approach I am thinking about rather than taking the data from Solaredge and is there any reason it wouldn't work?

There is an integration for Givenergy inverters/batteries that works with spot price optimisation and automated control of charging from Loxone - I have it half configured from the previous house but need to change it to support the Givenergy EMS and work out if i can get it working with Eon Next rather than Octopus - It is based on Virtual Inputs and Outputs connecting to the Givenergy Cloud, there is also another integration that was about previously that got data locally, I think based on an old HA integration.

Loxone Library also has a bunch of inverter / battery control options and device templates etc

Paul

David

unread,
May 10, 2025, 6:20:54 PM5/10/25
to Loxone English
The above just references the direct Loxone integration to the SolarEdge inverter. My SolarEdge app appears to show mostly correct information, although they did admit to a bug which means importing to charge the battery overnight isn’t logged correctly on their graphing.

Your solution will work, but you’ll not get the true solar generation unless you link into your SolarEdge inverter or via their API. If you just need the data and it isn’t time critical, you could use the API which I believe is updated more slowly than direct connection via modbus TCP.

For reference, Mixergy have an API you can tie into to extract top/bottom temperatures and “charge” status. You could use this data to help with the solar export logic for diverting into the buffer tank.

David

Jonathan Dixon

unread,
May 11, 2025, 9:07:26 AM5/11/25
to David, Loxone English
Hi David

Sorry, I had a bug which I fixed in the installs I have using this (SE8000H and SE6000H inverters, with 1x and 2x  10kWh energybank respectively) but I never recreated the template with this fix
The M_AC_Power_combined register has off-by-one error, it should be 40207

image.png

Please try that and let me know how you get on


Paul Watkin

unread,
May 11, 2025, 4:33:43 PM5/11/25
to Loxone English
Hi David,  

I plan on integrating the SolarEdge inverter via Modbus TCP but want to avoid needing to implement work arounds to correct for strange data anomalies where I can.

My idea is to have any energy diversion activities controlled by the MiniServer take import/export data from the same meter, obviously all of these systems will be pulling their own data from CT's etc to use internally but I want anything I do to always be based on the same source data.

The plan with the Mixergy Tank is purely to bring monitoring data into Loxone and may be some boost control but from what I can tell it is better to let it learn and do its own thing rather than fiddling with it via an external control source.

The buffer tank is in the ASHP primary loop to add water capacity (we want zoning as one floor of the house will effectively be unused most of the time, so the buffer is there mainly to stop short cycling), the plan being to use excess solar PV energy to boost the tank temp such that we get some "free" heat for the UFH in the wet rooms without the need to have the ASHP on from about April to October.

My heating manifolds have 1 wire temp sensors in the flow and return and I am also looking at motorised blending valves so i can dynamically change the loop temps with the idea to optomise all of this and get faster response times in the manifolds connected to radiators.

The one area I haven't been had time to play/think about thus far is how get Loxone to make decisions on whether it would be better to export the energy rather than try to use it - i.e. if i have SEG at 15p/Kwh I would be better off not heating the buffer tank et al and waiting until midnight and then using my cheap electric then but that will need some more thought once I have the weather station and weather service and I start playing with weather compensation.

Sorry to stray off topic somewhat  

Paul

Jonathan Dixon

unread,
May 11, 2025, 4:58:31 PM5/11/25
to Paul Watkin, Loxone English
You can ignore modbus integration with solaredge completely, and just rely on a standalone grid import/export meter (like the Loxone tree meter) if you're using the solaredge inverter purely for solar generation. The complication is if you have integrated DC coupled battery storage with it. Then you need to know how much is going from PV to battery, and how much from battery to/from grid, and the battery state of charge, as this greatly influences the decisions you'll be wanting to make in the Loxone logic.
You can of course mix the two: use the Loxone meter for main grid import/export (avoiding the worst of the issues needing my workarounds), and another Loxone meter for the inverter AC side,  and then modbus integration just to pull the PV generation power and battery state of charge. 
YMMV!

Also fwiw pre charging a buffer tank based on energy price is probably minimal value, you can get about 1 kWh stored in the buffer so barely moves the needle. A large amount of underfloor heating set into concrete acts as an effective storage heater though so if you have it definitely worth timing to batch heat that at the optimum time. (About 1 - 2kWh storage per m2 of floor area)
I've done 3 winters with all heating coming from 4 - 6 hours overnight cheap electricity, actually works out more financially beneficial to do heating overnight and sell any daytime self generation through export. 

Paul Watkin

unread,
May 11, 2025, 6:29:27 PM5/11/25
to Loxone English
Thanks Joth, My inner geek is probably going to want the generation number displayed in some form on the app or in HA dashboard so I will get that from SolarEdge - although I do have a bunch of spare Modbus meters lurking around somewhere....

I think we are signed up for 7 hours of cheap electric with Eon, if the manufacturer of the house (flatpack home built in factory) is to be believed then it is so well insulated we will barely need heating as its not far off passive house spec, the ideal would be as you say to export solar and use the cheap off peak slot to pre heat the house, we are coming from a 90's developer built house which was a nightmare to keep warm so time will tell

David

unread,
Jun 22, 2025, 5:17:33 AM6/22/25
to Loxone English
This is working well Joth, thank you!

I have come across one anomoly, which I think it specific to the charging circumstances I'm using very occasionally.

Example is: Octopus are offering negative pricing on energy, so I set the battery to charge via SolarEdge app. My PV is still generating as its a sunny day.
What I see in the Loxone app is the battery charging at 5kW, import of 2.7kW from the grid, but also "import" from the "Other" of 3.3kW.

IMG_9CD32813F411-1.jpeg

I suspect this is to do with the formula for calculating PV production, which is assuming the AC import to be a positive number and not less than 0.

I know it's an odd use case, but thought I'd share!

David

Jonathan Dixon

unread,
Jun 24, 2025, 4:30:34 AM6/24/25
to David, Loxone English
Ha, yes I see. I only charge my battery from grid overnight, when PV production is nil, so obviously never hit this.

I believe you're referring to the "PV Production" formula that I have put as:

IF(I2 < 0; 0; MAX(I1; I2) - I3)


To clarify, this is not clamping the AC import to be non-negative, but the AC output of the inverter. The issue I found was that when charging from grid the power readings for the DC side of the inverter and the power going into the battery would never exactly match so it would incorrectly show some residual value of PV production throughout the night (The SolarEdge does not have a register to report PV output so I just take the difference between inverter output and battery storage contribution to calculate it).


As a simple experiment I suggest disconnecting I2 input from that formula block, so it is always zero, and that formula will devolve to being effectively "I1 - I3" i.e. calculating PV as inverter total output less battery, and see how you get along.

Another option is change the formula to

MAX(0; MAX(I1; I2) - I3))

i.e. PV is difference between inverter output power and battery contribution, but clamped to never go negative.


Either way you will likely get the some incorrect residual PV production values if charging battery at night.


A more brutal but logically sound workaround would simply be to take the "Daylight" time function and squash down the PV Production output to be zero whenever the sun is below horizon.









JohnnyLoxville

unread,
Feb 12, 2026, 2:53:13 PM (8 days ago) Feb 12
to Loxone English
Hi guys,
I just came over this thread. Reading about your issues I just wanted to point to two articles with potential solutions to your problems.

Downside: Your Browser will have to translate the German articles…

Hope it still helps. 

Reply all
Reply to author
Forward
0 new messages