Huawai SUN2000-5KTL-L1 Installation Advice

Hi there,

I am a complete HA noob, so please be patient with me.

I am due to get a SUN2000-5KTL-L1 installed tomorrow and am looking to do some cool home automation with it. Before I invest a whole load of energy into trying to get things to work, I thought I would check with the community that my aspirations were reasonably achievable, and that there were existing plugins available. Any advice and suggestions would be hugely appreciated.

As I say, I will be getting a SUN2000-5KTL-L1 installed tomorrow, with a Luna battery and some solar cells. I have an electric car, which charges using Intelligent Octopus and am keen to benefit from very cheap night time rates, whilst also helping the grid, by feeding back to the grid when there is a high demand. I want to try to do this dynamically, with HA, to minimise my energy costs, etc.

Is the following setup reasonable using HA (assuming I build up the complexity of the system over time, as I learn more about it):

  • Interface with the SUN2000-5KTL-L1 to get inverter (battery/solar/usage) information (I presume I can do this over my LAN, or will I need a special interface - I think I may need a WAN to LAN bridge?)
  • Interface with Intelligent Octopus to establish when the low-cost car charging windows are, and tell the SUN2000-5KTL-L1 to charge my house battery during these times
  • Make some fairly simple decision making regarding my battery charge state, my energy usage, and my solar power output, and tell the SUN2000-5KTL-L1 to switch modes from Time of Use mode to Fully Fed to Grid mode, to help the grid needs, where it is sensible for me to do so (i.e. if I have excess battery remaining).
  • Do some other other automation later, once I have worked the above setup out.

Is this do-able, or super difficult?

1 Like

I forgot to say, that I intend to use a Raspberry Pi 4 (4Gb RAM) for HA

I will comment on my own thread as I go, as I discover useful information, and achieve different things with the setup.

From what I can, the Sun2000 wifi defaults to an ip address of 192.168.200.1, which is on a different subnet.

It looks like my easiest options, are to bridge the two subnets from two different wifi networks (doable), or, to connect the RPi to my main subnet using an ethernet cable, and then use the wifi adaptor on the RPi to connect to the Sun2000’s subnet as shown in this video: https://youtu.be/6VTQXk01cWY?si=0YBRCPa3aFjJY7VV

I hope to be able to try this tomorrow night, or on Thursday.

So, as promised, I thought I would come back, to report how my project is going. Hopefully, it will help others to achieve the same thing, in the future, by bringing the various sources of help I have used. I make no apologies for this being a bit of a noob guide. It has been quite a lot of work to understand how to do all these things, so hopefully an explanation in layman’s terms is useful for others.

Objective: Install HA on a Raspberry Pi 4, and use it to control my solar, battery and Air Source Heat Pump (ASHP isn’t installed yet), to maximise the financial benefit of the system in various scenarios in particular:

  • Taking advantage of charging battery when Intelligent Octopus (EV charging) is providing 7.5 p/kWh off-peak rates (which can happen randomly during the day, whenever Octopus has excess energy)
  • Pushing excess battery charge to the grid to benefit the grid daytime usage
  • Saving and pushing battery to the grid during Octopus Energy “Saving Sessions”, to take advantage of £2 to £4 per kWh bonus payments.

Why? - I think I can make an extra £600 to £1000 per year, by simply using my battery to shift energy to and from the grid in off-peak and on-peak times, whilst helping the grid manage energy better.

Currently, I have managed to receive data from all the required systems and servers, and use that to make decisions as to which mode to put the SUN2000 inverter in. However, I have yet to connect the output of the automations to actually switch the SUN2000 inverter mode, as I want to spend a few days, checking that it makes the right decisions, before I make the system fully live.

Connecting the RPi to the SUN2000 inverter
The Huawai SUN2000 has 2 WiFi adaptors inside it. One connects to your home WiFi network to gain access to the internet for the Huawai mobile phone control app. The other WiFi connector is for connecting to the maintenance app, used by the installer. It is this second WiFi connector, which needs to be connected to the RPi, in order to connect it to HA.

This second (maintenance) WiFi, has its own DHCP server, and only allows one connection, or 192.168.200.2 (with 192.168.200.1 being the IP of the SUN2000 inverter maintenance interface). There are a few options, such as creating a bridge between the two subnets of your home WiFi, and the inverter maintenance WiFi, but by far the simplest option (which I used), was to connect the RPi to my main LAN using an ethernet card, and then connect the WiFi interface on the RPi, to the SUN2000 maintenance WiFi (so the RPi is connected to two different networks.

I did this, by following the instructions in this video - it was super easy, once I had found it: https://www.youtube.com/watch?v=6VTQXk01cWY

The above video requires the Integration found here to be installed via HACS, before connecting to the SUN2000 WiFi (GitHub - wlcrs/huawei_solar: Home Assistant integration for Huawei Solar inverters via Modbus) - Thanks to @wlcrs for this amazing Integration!

@luciandf asked me on a different thread, whether it was possible to both monitor the SUN2000 parameters AND control the inverter. From what I have discovered, it is possible to fully control the inverter, but you need to select “Elevated Permissions” (see 1m37sec in the video), which will then require you to enter the Installer’s password for the SUN2000 inverter.

Note: If you don’t have the installer’s password, then it is possible to reset the passwords really easily, and instructions are on the Huawai website.

Getting Intelligent Octopus charging slot data from Octopus energy
It would of course, be completely acceptable to just charge the battery between 23:30 and 05:30, and all work work fine, but there are times when Octopus gives 7.5 p/kWh EV rates for the whole house, in the middle of the day. So, I was keen to be able to see these occasions, and give the house battery a little burst of charge, (and take from the grid), when this happens.

In order to do this, I used this Integration from @megakid: GitHub - megakid/ha_octopus_intelligent. This integration connects to your Octopus Energy account, and provides various parameters for controlling and monitoring the status of your account.

By using the binary_sensor.octopus_intelligent_slot parameter, I was able to use this to change the mode of the inverter, from “releasing to the house” to “charging”. Super simple, and super effective.

Pushing energy to the grid during “Saving Sessions”
A bit of background… The grid gives bonus payments for how much energy you save during their “Saving Sessions”, to help them manage the grid. They measure the saving, by calculating the average amount of energy you use during the day (at the time of the saving session), and comparing it to the amount of energy you save (or even better, feed-in to the grid), during a saving session. So, if you have an ASHP and normally cook at 18:00hrs (which is usually when the saving sessions occur on a very cold day), your savings will be the difference between a normal day (maybe +6 kWh used from cooking, lighting, heating, etc), and the saving session (maybe -4.5 kWh, if you load-shed and push the battery back to the grid). This is a difference of >10 kWh, which, on a day when they are unusually low on power, could result in 1.5 hours at that power, at £4 per unit, which is £60!!! (half my months electricity costs)!

@kamilb has a great thread here, where he talks through his version of the same idea: Automated Octopus Saving Sessions with Solax X1 Hybrid G4 - #6 by robbo100, which is where I found the Blueprint for automatically joining the Octopus Energy Saving Sessions: Services - Home Assistant Octopus Energy by @BottlecapDave.

I am yet to fully test this at the moment, because we haven’t had a Saving Session for a while, and the parameters all show as null until an event is “announced”, but I am fairly sure I have been able to use one of the parameter to trigger discharging the battery to the grid (binary_sensor.octopus_energy_[Octopus_ID]_octoplus_saving_sessions)

This bit of automation, does the following:

  • I have a switch that enables me to pause the battery discharge between 16:30 and 18:30 (the most likely time for a saving event). On most days my battery won’t last this far into the day anyway). This switch will be turned off during the summer, when there are no saving events, so that I maximise the use of solar.
  • 3 hours before an saving event, I stop the battery discharge, and if it is below 55%, I charge it back up to 55%, whilst there isn’t a grid shortage
  • When the saving session starts, I discharge the battery into the grid at max rate possible (and turn off the ASHP etc).
  • At the end of the event, I return the system to normal mode (discharging to the house), or turning it off (if it is at or below 10% SOC.

Other saving opportunities
Since I charge the battery at 7.5 p/kWh, and I get paid 15 kWh for pushing power to the grid, there are small amounts of money to be made (and benefit to the grid) for pushing any excess battery, back to the grid in the early evening (between 19:00 at 22:00).

Throughout the day, I track the average power used by the house, and then extrapolate that to the end of the day by means of a “Battery State of Charge needed to make it to the end of the day” After 19:00 hrs, if this parameter is above the actual battery state of charge, I push energy to the grid, and once below, I stop (which a bit of time-based hysteresis, to avoid constant mode flip-flopping).

This might seem really tiny, but on a summer’s day, this could be an extra £1.50 of battery, which could add up to an extra £300 per year.

Thoughts on the above
I will look to connect this all up to actively control the inverter in the next week or two, once I am happy that it is all behaving.

I am in two minds about whether this is “gamifying” energy savings, but using the battery to manage demand periods (if implemented by lots of people), could make a dramatic impact on grid energy management, and help to turn off a number of coal powered generators, so it feels generally a good thing. It is down to the grid and energy companies to direct us as to the most effective timings of release, by financial incentivisation (e.g. peak vs off-peak, and energy saving sessions). Hopefully these invcentives will adapt as the national home battery storage changes.

Other learn points from a noob
If you have got this far, then well done, and thanks for reading. :rofl:

My main pointers for anyone starting out as a noob HA user, are:

  • “Helpers” are your friend. “Templates” continually update as parameters and are really useful to use as triggers. It took me a while to work out how to create Templates, but they have been a massive help!
  • Internet parameters can be flakey. For various (not yet known) reasons, my Octopus Energy account parameters seem to occasionally switch to “Unknown”. In order to fix this and stop unexpected mode triggering, I have created some automations which “smooth” the values, to ignore when the parameters go to an unknown state. This made a massive difference
  • Start simple, and don’t make your system live, until you are confident that they work. Be aware that “closing the loop” around your automations may create unexpected results, so keep an eye on it (I am yet to hit this phase of testing, but am looking forwards to it).
  • I found setting up power-flow-cards super confusing, because some of my energy parameters weren’t in the correct units (and so weren’t selectable in the power cards), and some just didn’t exist. For example, I needed to create a Helper to calculate “Power used by the house” (from Inverter Power, and Grid Power). It took me a while to work this out, and create helpers to convert units etc.
  • Enjoy the process of learning as you go. For someone like me, who only knows some basic coding (and never practice the skill), it isn’t easy to understand some of the information. But you will get there with perseverance.

Thanks for reading!

1 Like

Great guide!!! Thank you

But you have to substitute my name with @wlcrs :sweat_smile:
I can’t write a single row of coding :joy:

1 Like

Ah, thanks for pointing that out, and sorry @wlcrs.

I think @alexdelli had made the last comit to your project and I wrongly took their username as the author.

I have made some really good progress with the integration of the SUN2000 and LUNA2000 system, with Octopus Energy. I don’t want to spam the site with repeated messages, so here is a link to explain how I have controlled the battery charging/discharging: Integration Solar inverter huawei 2000L - #2807 by robbo100

The system seems to work well and will charge automatically, whenever my car is charging using an Intelligent Octopus charging slot, whenever in the day it occurs.

The only function I haven’t checked, is the Saving Sessions, since there haven’t been any since I got my system installed. I will update later when that is shown to work.

My Air Souce Heat Pump arrives this week, so the next step is to integrate that into the system, which I think will be much easier than the SUN2000!

Hello, I’m trying to create an automation that sends a Telegram notification when the inverter goes offline/off-grid.
I’m using the entity sensor.inverter_alarm but when setting up the automation I can’t see the offline state to chose and to trigger the notification.
I only see this weird states:

  • Any state
  • Not available
  • Unknown

Any idea or someone has made this automation? Am I using the wrong entity?

Hi there,

Thanks for the write up! I also have the 15kWh Luna / 6kW Sun 2000. It’s very interesting as I had the very same challenges and the huawei forums just seem to be full of bots saying “great post” etc so not much help there either lol. So like you, I pretty much had to learn all the same stuff with little to no support! A baptism of fire I guess :smiley:

It would be great to set up a small community for those who have similar set ups!

Xander