Automate Fronius Soft Limit

Hey tux43, can you please confirm what the names of the registers you used?

Cheers

@tux43 - Do you have a step by step guide how how to set my inverter to not send power to the grid when it is negative for amber? I am just totally lost on this post as there are several people doing several type of things? Like how do I add a monitor to monitor ambers prices for negative feedin :frowning: Iv never used home automation and I just have my Pi4 installed and added my inverters as a device to HA. But now what do I do? Thank you kindly in advance.

1 Like

Welcome to the community @matt86 ! Time to feel :smiley: !! So, HA takes a little bit of time to get your head around, once you have it you will love it like the rest of us! I don’t have a step by step guide, and automating Amber does require an intermediate understanding of the basics otherwise you will get lost. I recommend seeking out some getting started tutorials, examples only below.

However, here is a quick, off the top of my head way to get started with automating restricting your inverter feeding in when price <$0.00

  1. Install Amber Electric integration (this will answer your question about monitoring Amber’s prices)
  2. Setup your inverter to receive Modbus calls via TCP (do you have a Fronius)? (Refer first post)
    2a. The modbus section needs to be configured including Sunspec model type
  3. Create an automation that will trigger when Amber feedin price is negative - Example is here

Just a hint, this forum is brilliant. You need to ask something specfic and show what you have tried via copy & paste of yaml automation to get the most out of it. Everybodies configuration is different therefore you need to have pseudo logic planned out, at least in your head!

Good luck, we are all here for you!

Yes, I think you are refering to my answer here

Thanks tux43, I have everything sorted with HA installed in a docker container etc.

But my brain is just freezing on how to do the modbus and the solar etc.

My system consists of 1 x 6kw Fronius, 1 x 4kw, and Tesla Powerwall 2. I have a Fronius smart meter connected to the 6kw inverter. The 4kw is not linked and just outputs, but I could still control its output via modbus.

So what I want is if the Amber negative prices are in effect, check to see if I am exporting excess power and if I am only allow the inverter to feed the house.

I had added my fronius and powerwall into HA and see the sensors, but now im stuck at what to do with modbus and combine with the fronius. Even if we just start with the 6kw that would be helpful?

Can you let me know what I need to do next?

This is my modbus and thats it.

modbus:

  • type: tcp
    name: 6_fronius
    host: 192.168.12.6
    port: 502
    retry_on_empty: true
    retries: 3
  • type: tcp
    name: 4_fronius
    host: 192.168.12.4
    port: 502
    retry_on_empty: true
    retries: 3

Oh yep missed it my bad.

My setup - Gen24 Symo 10kw + BYD and a Gen24 Primo 5kw.

Fronius smart meter connected to the Symo 10kw.

Following @juande logic (nice one!)

Node Red Implementation (based on: https://community.home-assistant.io/t/fronius-symo-gen-24-plus-batteries/466417/5
Modbus set to FLOAT

[{"id":"e1cb980bcd6214d7","type":"modbus-response","z":"082d1a6d7f9f4ee6","name":"","registerShowMax":20,"x":1790,"y":540,"wires":[]},{"id":"224fb674de7802e3","type":"modbus-flex-write","z":"082d1a6d7f9f4ee6","name":"Fronius5kw","showStatusActivities":true,"showErrors":true,"showWarnings":true,"server":"ecd41b68db8d4254","emptyMsgOnFail":true,"keepMsgProperties":true,"delayOnStart":false,"startDelayTime":"","x":1570,"y":540,"wires":[["e1cb980bcd6214d7"],[]]},{"id":"b3d3f6ceb63b1cc8","type":"group","z":"082d1a6d7f9f4ee6","name":"Export Limit Off - Max POWAA!!","style":{"label":true},"nodes":["e1e602a44d1387e2","9ce71460445f91f2"],"x":674,"y":579,"w":572,"h":82},{"id":"e1e602a44d1387e2","type":"inject","z":"082d1a6d7f9f4ee6","g":"b3d3f6ceb63b1cc8","name":"ExportLimitOFF","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payload":"","payloadType":"str","x":800,"y":620,"wires":[["9ce71460445f91f2"]]},{"id":"9ce71460445f91f2","type":"function","z":"082d1a6d7f9f4ee6","g":"b3d3f6ceb63b1cc8","name":"100% Max Power","func":"var values = [(10000),(0),(0),(0),(1)];\n\nmsg.payload = { \n    'value': values,\n    'fc': 16,\n    'unitid': 1,\n    'address': 40242,\n    'quantity': 5\n} \n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1130,"y":620,"wires":[["224fb674de7802e3"]]},{"id":"56765446a7f28420","type":"group","z":"082d1a6d7f9f4ee6","name":"Export Limit On To Value Set by Inverter","style":{"label":true},"nodes":["38c121ea0fb3729f","a61799f15d25dc5b","94b32d1487ea309d","3dc5fd7c82dfed11"],"x":674,"y":419,"w":592,"h":142},{"id":"38c121ea0fb3729f","type":"inject","z":"082d1a6d7f9f4ee6","g":"56765446a7f28420","name":"ExportLimitOn","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payload":"","payloadType":"str","x":790,"y":460,"wires":[["94b32d1487ea309d","3dc5fd7c82dfed11"]]},{"id":"a61799f15d25dc5b","type":"function","z":"082d1a6d7f9f4ee6","g":"56765446a7f28420","name":"WMaxLim_Ena = 0","func":"msg.payload = { \n    'value': 0,\n    'fc': 6,\n    'unitid': 1,\n    'address': 40246,\n    'quantity': 1\n} \n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1110,"y":520,"wires":[["224fb674de7802e3"]]},{"id":"94b32d1487ea309d","type":"delay","z":"082d1a6d7f9f4ee6","g":"56765446a7f28420","name":"60s","pauseType":"delay","timeout":"60","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":950,"y":520,"wires":[["a61799f15d25dc5b"]]},{"id":"3dc5fd7c82dfed11","type":"function","z":"082d1a6d7f9f4ee6","g":"56765446a7f28420","name":"100-1% Power Over 60s","func":"var values = [(100),(0),(0),(60),(1)];\n\nmsg.payload = { \n    'value': values,\n    'fc': 16,\n    'unitid': 1,\n    'address': 40242,\n    'quantity': 5\n} \n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1130,"y":460,"wires":[["224fb674de7802e3"]]},{"id":"ecd41b68db8d4254","type":"modbus-client","name":"fronius5kw","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":true,"queueLogEnabled":false,"failureLogEnabled":true,"tcpHost":"192.168.0.173","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","serialAsciiResponseStartDelimiter":"0x3A","unit_id":1,"commandDelay":1,"clientTimeout":1000,"reconnectOnTimeout":true,"reconnectTimeout":2000,"parallelUnitIdsAllowed":true,"showWarnings":true,"showLogs":true}]

Send values to multiple registers in 1 payload using fc = 16 https://stevesnoderedguide.com/modbus-writing-data

This reduces WMaxLimPct from current value to 1% (100) over 60 seconds (Although it reduces at a much slower rate than specified.)

var values = [(100),(0),(0),(60),(1)];

msg.payload = { 
    'value': values,
    'fc': 16,
    'unitid': 1,
    'address': 40242,
    'quantity': 5
} 

return msg

I have the soft export limit set to 0 on both inverters, however the soft export limit will only adjust the Symo 10kw output, it won’t dynamically adjust the Primo 5kw.

So at midday when both inverters are generating maximum output (10kw + 5kw) -
Exports set to 0
No load(0kw)
The Symo 10 will reduce down to 0 but leaves the Primo 5kw at exporting at full blast.

Unfortunately @juande solution will only work for 1 inverter in the system.

I haven’t really decided how to attack this problem yet.

Option 1) Let the Symo 10kw do it’s own calculations on how to reduce it’s own power for 0 export, then if there is still export have a formula to reduce the Primo 5kw output

Option 2) Set up a formula to reduce both the Symo 10kw and Primo 5kw at the same time similar to @tux43 @MichaelBach @robi

I think Option 2) might be better so both inverters share the “load” of curtailment but then HA will become the single point of failure and increases risk…

Hey Murphy do you have a Tesla Powerwall? or are you just working on your inverters only?

Hey @matt86 no Tesla Powerwall here but some of the above solutions will help to curtail your inverter production at least! Not sure about Powerall management with HomeAssistant…

No, but I’m positive HA will do whatever you need it to do. Dump power to grid, charge when price is low etc….

Hey mate, thank you for your guide - I got mine to work based of yours.

You may need to re-set the WMaxLim_Ena to 1 to restart the operating mode.

From the Gen24 Modbus doco.

To change values in an active operating mode (e. g.
to set a different power limit or a different return time), proceed as follows:
:arrow_forward: Enter the new value into the relevant register
:arrow_forward: Restart the operating mode using register WMaxLim_Ena by setting a 1

Hey man, I have gone through your code and you must not have included something, because how are you accounting for the current watts that the inverters are producing to equate to your limits. I see your maximum export limiter which is all very well and good, but your calculations are assuming that inverter is always producing 100%, which we know it doesn’t.

For example what if one inverter is producing more solar than the other, but you have capped them all based on a equal 3 division.

Thank you for going into detail about your code - I do appreciate it.

No need to change back to 0 and to 1 again, it’s enough to just simply write 1 after changing the limit value.

Due to popular demand I’ve had a go at writing up a blog on how this works for me.

As I mention I have had to reverse engineer the solution, please let me through via the comments if anything isn’t working for you!

https://www.smartmotion.life/2023/09/12/home-assistant-and-amber-electric-your-pathway-to-smarter-energy-management/

Do you have a Fronius Gen24 by chance? I have seen the same behaviour.

My primo 501 snaps to the new requested value
My Primo Gen 24 does 100w every 5 seconds.

I have the installer combining tomorrow to see if they can change the PV ramp control other wise I will replace the inverter with a Primo 501.

Have 3 phase power and 2 5KW systems

I would be looking at the following modbus commands since they seem to indicate a time period for the power change (WMaxLimPct_RvrtTms & WMaxLimPct_WinTms)

Please let me know if this fixes it and I’ll update my blog.

Yeah I’m using those commands and it works fine on the Primo 501.

But on the Primo Gen24 inverter it only does 100w every few seconds.

Here is the gauges from home assistant.

Ok just had my installer out.

On the Primo Gen24 the Grid profile must be set to International 50hz not AUS C
On the Primo 501 snap inverters AUS C does not control ramp rates

My Gen24 now snaps to the new rate instantly.

Grid profiles are locked out on the Gen24 only licensed installers can get in to these settings as you can fry your inverter if you dont know what you are doing.

I don’t have the service password for my inverter so I can’t enable the dynamic load control. I’ve contacted my installer to get that sorted out.

In the interim I’ve tested being able to read the current house load and then set the % based off that. That load will fluctuate a fair bit, especially if the aircon is on. Does anyone know if there are any limitations on how often the modbus registers can/should be updated? I.e. would it cause issues if I changed the % every 5 seconds.

I have the same issue with the Primo Gen24 even when setting ramp time to 0, might be worth a try setting other values to see?