Skip to content

Conversation

@RustyDust
Copy link
Contributor

On testing with different Sonnenbatterie instances I found that each of those had a different limit of what is accepted as threshold_p_max when using ToU schedules. The range I found is from 11.000 (W) on a Sonnenbatterie eco 9 to 46.000 (W) on a Sonnenbatterie 10p.

Thus it makes no sense to set an artificial limit of 22.000 here but rather have the software using the lib decide. That said, I haven't as of yet found a way to calculate the actual threshold from the sensor values offered by the Sonnenbatterie API. Hints are welcome ;)

Signed-off-by: stefan <stefan@whocares.de>
Signed-off-by: stefan <stefan@whocares.de>
Signed-off-by: stefan <stefan@whocares.de>
Signed-off-by: stefan <stefan@whocares.de>
@weltmeyer
Copy link
Owner

could this be "inverter_capacity" in battery_system/system?

@RustyDust
Copy link
Contributor Author

Not on my system. There the inverter capacity is 8.000 whereas the threshold_p_max limit accepted is 46.000. On another system I have access to the inverter_capacity is 3.300 and the threshold_p_max limit is 11.000. So it's not even a multiplicator or something like that.
Myx suspicion is it is something set by the "Installer" during installation and depends on the size of the main fuses installed. For example my main fuses are all 80A (don't ask ;)) and that would give me a theoretical max. consumption of 55.200 W. Subtract the 8.000 of the inverter and some safety margin and you'll end up at roughly 46.000. Similarly, in the other location the fuses are only 30A which would give a max. consumption of 20.700 W but there the safety would be fairly large.

Either way, I haven't found any value in API v1 or API v2 that would somehow match the limits for threshold_p_max on either site or lend itself to an automatic calculation. And being obviously unable to query the main fuse amperage I decided to just drop the limit. Since the Sonnenbatterie will refuse to accept any value above its configured limit anyway there should be no harm in skipping the check.

@RustyDust
Copy link
Contributor Author

RustyDust commented Jan 13, 2025

While typing I hade an idea: It looks like the calculation actually is:

<main fuse amperage> * 225 * 3 - <inverter_max>

Still doesn't help much since we have no way to determine the value for <main fuse amperage> through the APIs provided.

…JSON-API

Thanks to @Prythi for reminding me.

Bump version to 0.6.0

Signed-off-by: stefan <stefan@whocares.de>
@weltmeyer
Copy link
Owner

How do you get to know you max value? Is there an error or response when setting a value above?

could it be P_max in /api/inverter ?
image
image

@weltmeyer
Copy link
Owner

More Data from the integrated inverter:

image

@weltmeyer
Copy link
Owner

Another Idea:
api/battery
measurements->battery_status:
chargecurrentlimit*nominalmoduledcvoltage

in my case that would be 200A*48V~9600W

(I should wait for you to tell me how to KNOW my 'threshold_p_max'...)

@weltmeyer
Copy link
Owner

image
Is this the Value we are searching for?

@weltmeyer
Copy link
Owner

There it is: /api/v1/commissioning_assistant/special_function
image

@RustyDust
Copy link
Contributor Author

Nice find, congrats! I'll check with my different batteries and will integrate that one if it's the one we were looking for on those as well. That said, I'd like to be able to change that one for 11000 at my parents house seems a bit low for a 22kW charger ... any hint on that?

@RustyDust
Copy link
Contributor Author

How do you get to know you max value? Is there an error or response when setting a value above?

Just send in a ToU schedule with a valid start and stop time and play with the threshold_p_max setting. It will tell you if the value is above the configured limit by sending back an error message.

@weltmeyer
Copy link
Owner

Nice find, congrats! I'll check with my different batteries and will integrate that one if it's the one we were looking for on those as well. That said, I'd like to be able to change that one for 11000 at my parents house seems a bit low for a 22kW charger ... any hint on that?

I dont know how the value is calculated at the moment..
also in installer mode - ther is no setting i could see that says anything about installation constraints. :(

@RustyDust
Copy link
Contributor Author

I dont know how the value is calculated at the moment..

My guess is that there are two methods:

  1. Use the certified thumb of the installer, i.e. take the max inverter power and add an educated guess about the potential additional usage of the house while charging. This seems to be what was done at my parents home by using max inverter power * 2
  2. Have a look at the main breaker fuse for the Sonnenbatterie, and do the math like this:
    main_sb_fuse_A * number_of_phases * 480V
    In my case this would be 32 * 3 * 480 = 46.080 ~= 46.000

…s the

configured limit for `threshold_p_max` when setting a ToU schedule.
Still, this library won't enforce the setting since this would require an
additional call on each invocation. Instead the checking / enforcing of the
configured limit is left to higher level routines in the calling code.

Signed-off-by: stefan <stefan@whocares.de>
@weltmeyer
Copy link
Owner

This works for me. Ready to publish as 0.6?

@RustyDust
Copy link
Contributor Author

Go for it! ;)

@weltmeyer weltmeyer merged commit a100930 into weltmeyer:master Feb 18, 2025
1 check passed
@RustyDust RustyDust deleted the sru_work branch February 19, 2025 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants