Feature to set power limit of SMA STP inverter from Home Assistant

Hi,

I use the integration SMA Solar - Home Assistant. It works great for reading out a lot of data from the inverter. However, I would like to be able to dynamically set the power limit of the inverter from Home Assistant and at the moment that does not seem to be possible.

The background for the request is that I live in Denmark where the power cost changes every hour according to the prices on Nordpool. In the summer time we routinely have hours where the production of renewable energy exceeds demand so that we have negative power price where we are charged money for supplying power to the grid. Some times you are even paid money to consume power :slight_smile:

During these hours with negative power prices I would like to limit the production from my SMA-STP8.0-3AV-40 so that it exports little or no power to the grid and only produces what we need for our household. I got as far as calculating the setpoint for the power limit based on power prices and measured power consumption in my home before I realized that the stpā€¦inverter_power_limit in the SMA integration is a sensor and not a number that can be set.

I use a similar approach to dynamically control the charging current of my ABB Terra ev charger to only charge with excess solar power, but in the OCPP integration GitHub - lbbrhzn/ocpp: Home Assistant integration for electric vehicle chargers that support the Open Charge Point Protocol (OCPP). the current limit is a ā€œnumberā€ and not a sensor.

Thank you in advance for any feedback.

Did you ever find a solution to your question? looking for the same thing

Same for me. I am also looking to solution.

Iā€™m also looking for a solution to this. The documentation from SMA shows that it is possible to set the power limit using modbus. I donā€™t think it is possible using webconnect.
I think this feature will be more requested as the prices of electricity becomes more volatile. As an example, the lowest price of electricity in my area was -31.6 EUR/MWh on 2024-04-13. In that case it would be nice to create an automation that adjusts the power limit so that no electricity is exported or imported.

The only solution I have found is logging on to the inverter directly and setting the power limit there. I have requested from SMA that they make this parameter more easily accessible, for instance in the SMA Energy app.

1 Like

Which model do you have? I have the Sunny Tripower 8.0 (i.e. STP-8.0) and I cannot find any place to configure power limit in the web ui on the inverter.

A small update: I asked SMA support about how to set power limit on my inverter and they refered me to my installer. I asked my installer for help and they replied that they had now given me administrator rights. Now I can configure device parameters through the ennexOS sunnyportal and have successfully configured a power limit on my inverter. It seems like I can enable the modbus server through ennexos but have not tried it yet. It does not seem possible for me to set the power limit in the local web interface on the inverter, just through the cloud service. (But I suspect that I might be able to give more permissions to the ā€œuserā€ in the local interface through the cloud).
As a first step I would be happy to just set the power limit to a low value, like 500 W when an hour has a negative price. Unfortunately it is a lot of steps to change the value and I donā€™t understand if it would be possible to do it using e.g. cURL.

I found out my SMA webportal has an endpoint to set the ā€˜Currently set active power limitā€™. This can be done after logging in and doing a HTTP Post:

This sets it to 1000w.

Url: https://[my-sma-ip-or-dns]/dyn/setParamValues.json?sid=[mySID]
Body: {"destDev":[],"values":[{"6802_00832B00":{"1":[1000]}}]}
Cookie: tmhDynamicLocale.locale="en-gb"; deviceClass443="1"; user443={"role":{"bitMask":4,"title":"istl","loginLevel":2},"username":862,"sid":"[mySID]"}

So my next questions to figure out is:

  1. Is 6802_00832B00 a fixed key for ā€˜Currently set active power limitā€™
  2. Can I also authenticate via Postman to get the cookie
  3. Can I run the same as cUrl in python :smiley:

I can now set my Sunny Tripower 4.0 Inverter power via http calls. Technically, this means I can integrate this into HA. Next step is to figure out HA automationā€™s.

Checkout Postman for my collection.
image

2 Likes

@johanbos looks really promising. Do you know if this will also work for SMA Sunny boy inverters?

I donā€™t know (yet). My tripower inverter uses Webconnect Software version 1.5.0.R.

I do assume SMA uses the same web portal for all appliances. This is because the web portal seems generic and it costs less to maintain one web portal instead of one per type.

Great to see that you are making progress! As I understand it you are doing this on local web interface for your inverter. Do you login as ā€œuserā€ or ā€œinstallerā€? I only have the password for the ā€œuserā€ user and relevant settings like power limit are read only.

I have the installer credentials. This comes with risk of course, so i have a backup of the configuration etc.

At this moment Iā€™m analysing the shell commands within HA. These should be able to invoke http requests. Pretty technical, so not very user friendly.

But if I achieve something, Iā€™ll let you know.

3 Likes

@ johanbos Nice work.

I will try to integrate this in one of the next release of my sma integration

I have already a service call for changing parameters. Currently it works only with the new generation of SMA inverters (ā€œennexos-based devicesā€)

1 Like

I see your integration has Active power limit sensor, is it possible to make this a parameter that can be adjusted?

1 Like