-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hoymiles switches off and on again when the battery is empty and DPL is on #193
Comments
Hi @Napizaki, I can confirm this behavior. And try to fix it today. I think it's related to PRs #164 #172 from @MalteSchm |
Perfect, thank you! |
Noted and thanks |
@MalteSchm It's the Battery charging cycle condition // Battery charging cycle conditions
// The battery can only be discharged after a full charge in the
// EMPTY_WHEN_FULL case
if (isStopThresholdReached(inverter)) {
// Disable battery discharge when empty
_batteryDischargeEnabled = false;
} else if (!canUseDirectSolarPower() ||
config.PowerLimiter_BatteryDrainStategy == EMPTY_AT_NIGHT) {
// Enable battery discharge
_batteryDischargeEnabled = true;
}
// This checks if the battery discharge start conditions are met for the EMPTY_WHEN_FULL case
if (isStartThresholdReached(inverter) && config.PowerLimiter_BatteryDrainStategy == EMPTY_WHEN_FULL) {
_batteryDischargeEnabled = true;
} _batteryDischargeEnable has to be always false until startThreshold is reached |
@helgeerbe Hm, from earlier conversations I understood that for: But maybe I misunderstood the behavior. @Napizaki : do you use the EMPTY_AT_NIGHT or the EMPTY_WHEN_FULL strategy? It would help to understand the issue. I suppose the issue is when the strategy is EMPTY_WHEN_FULL and direct solar power is OFF. This immediately re-enables the battery. It could be sufficient to delete "!canUseDirectSolarPower() || " Maybe you can quickly confirm your setting here so that I'm chasing the right issue... |
AND Not canUseDirectSolarPower
Correct
This seems to be the root cause. I think this should do it: // Battery charging cycle conditions
if (isStopThresholdReached(inverter)) {
// Disable battery discharge when empty
_batteryDischargeEnabled = false;
}
else if (isStartThresholdReached(inverter)) {
// enable battery discharge
_batteryDischargeEnabled = true;
}
else if (canUseDirectSolarPower() &&
config.PowerLimiter_BatteryDrainStategy == EMPTY_AT_NIGHT) {
// disable battery discharge
_batteryDischargeEnabled = false;
} |
I haven't quite understood "solar passthrough" yet - I haven't found anything clear in the doc either. I have tried it once, but have not been able to recognize any other behavior to disabled. Possibly someone can explain this again exactly or post a link where it is described. Thanks in advance |
@helgeerbe
and:
But then there is still an issue in calcPowerLimit as the required power may be more than what is supplied if consumeSolarPowerOnly is enabled. I somehow feel that the heart of the problem is the fact that calcPowerLimit has two energy sources available that can be independently enabled/disabled but there is only one energy source in the interface. @Napizaki |
I created a (drafty) PR #196 |
Well, one thought Malte after reading your comment - I sometimes want to use my HM-300 & its Battery to feed into my household, even tough there is still sun light / the sun is above horizon. So my question is, would your comment interfere my what I described? |
@swingstate Hence my comment that there are two energy sources that impact the power limit and my thought to enhance the interface of this function. This could simplify implementing additional usecases going forward. But right now this is not my intention |
Checked 6b437b5 into development branch. Test it tomorrow with the next sun cycle. |
OK, I have updated to 6b437b5 - the battery should be empty by tomorrow morning. I will report. THX |
@Napizaki my guess is that we're running into the condition copied below as the start threshold is reached and because the (invisible UI Drain Strategy) is set to Empty when full
|
@MalteSchm I left comments in #199 What I see so far:
|
My fix looks like this but I can't really test as our internet is buggy and I cannot update the ESP32 OTA :-(
|
You have to allow battery usage if start threshold is reached |
@helgeerbe I'll look at your other points now.
|
About your points:
--> Does this also apply to EMPTY_AT_NIGHT? Right now the battery is only used at night.
Ok sorry about that. I think you refer to this code here, right?
There is code currently in calcPowerLimit() to address said issue but I guess this conflicts with the check performed at the beginning of the PowerLimiterClass::loop()
First thing I noticed is that this needs an or statement
Also I changed this to disable the inverter. I saw the issue that a prolonged network outage would keep the inverter running with minimal power and this would eventually completely drain the battery. This would have occurred in my old code. The new code with the extended interface to calcPowerLimit() can actually handle this if the inverter is set to the lower limit. |
Yes as long voltage is above start threshold. Have a look at the state diagram. I'm fine to turn the inverter off or minimum power, if there is a problem instead to lower limit. |
@helgeerbe o.k. I did all of these changes and created #201 |
Yes, testing is actual a nightmare. I just think about to write a small unit test framework for the power limiter. Have to mock up the inverter a power meter. But for future changes this might increase the code quality. |
I will test what I can and then give you feedback. |
@Napizaki wait a little. I'll do some more minor changes and will merge it into the development branch. |
@MalteSchm Thanks for your work and support. And for not giving up. |
Merged it into development: c621f2d |
:-) Thanks. I feel responsible though after causing these issues in the first place. But we will get back to a stable state |
@MalteSchm Orange line is battery. If Power Limit is set to 300 (I see it in the icon), the invert is set to 0W. If I set the upper power limit to 299. Everything is fine. I see 299 in the icon, and inverter is set to 299. |
Good morning, unfortunately it still does not work with version c621f2d: |
Couple of things: @helgeerbe @Napizaki @helgeerbe |
@MalteSchm Of course, I can do the test and post the output of the console. |
@Napizaki
|
I think so, too. Good finding.
// UI: Solar Passthrough Enabled -> true && EMPTY_AT_NIGHT
if (config.PowerLimiter_SolarPassThroughEnabled && config.PowerLimiter_BatteryDrainStategy == EMPTY_AT_NIGHT) {
if(isStartThresholdReached(inverter)) {
// In this case we should only discharge the battery as long it is above startThreshold
_batteryDischargeEnabled = true;
}
else {
// In this case we should only discharge the battery when there is no sunshine
_batteryDischargeEnabled = !canUseDirectSolarPower();
}
} For solar passthrough and EMPTY_AT_Night. I also added if(!inverter->isProducing()) {
return PL_UI_STATE_CHARGING;
} to get the charging icon back. I have one more issue. |
Do you think, this will do the trick? // Make sure inverter is turned off if PL is disabled by user/MQTT
// Make sure inverter is turned off when low battery threshold is reached
if (((!config.PowerLimiter_Enabled || _disabled) && _plState != SHUTDOWN)
|| isStopThresholdReached(inverter)) {
if (inverter->isProducing()) {
MessageOutput.printf("PL initiated inverter shutdown.\r\n");
inverter->sendActivePowerControlRequest(config.PowerLimiter_LowerPowerLimit, PowerLimitControlType::AbsolutNonPersistent);
inverter->sendPowerControlRequest(false);
} else {
_plState = SHUTDOWN;
}
_batteryDischargeEnabled = false;
return;
} I could add the line without PR. |
I think we should just remove || isStopThresholdReached(inverter) here and not worry about the battery at this point I mean this part of the code:
|
PR is here: #209 @helgeerbe |
It looks like it works now, although the inverter still switched on 4 x after falling below 47.5V. But that was probably because the SOC was still at 20%. The low voltage at the battery and the high SOC can be explained by the high load that the inverter had to perform at that time. I'll check again tomorrow when the inverter draws less load - but it seems to work now. |
Thanks for the feedback @Napizaki |
Merged the PR and it is already in master release 2023.04.29 |
Keep this open and wait for further feedback. |
@helgeerbe And an upper limit is correctly handled. I only tested during daytime though. Was there solar power when you saw that? There are not many places in the code that actually check the upper limit so I'm not fully convinced yet that that we're on the right path here |
@MalteSchm Hadn't time. But I just set the upper limit to 300W. Voltage is above start threshold. I turned a water heater on, and power limit jumps to 300W limit in the inverter. So at the moment I can't reproduce it. Will wait and check again, when sun is down. By the way. I see that we calculate the limit as int. Inverter expects float, and we don't do a proper cast. |
@MalteSchm I could reproduce it now.
|
Ok I'll check. |
Hi @helgeerbe I also added the static casts |
I will check my logs in the evening. But I think the inverter delivers around 8 W, so no display error. |
@helgeerbe |
Hi @MalteSchm I think we can close this issue. I did a lot of tests, but couldn't find out why I have this behavior. At the end I rebooted the inverter and since then everything is fine. So it looks like it was the inverter. |
Should be fixed with 569edbe |
@helgeerbe |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion or issue for related concerns. |
What happened?
My Hoymiles HM-600 with DynamicPowerLimiter enabled keeps turning off and on when the battery is low, even though the restart voltage is set at 49V, and the restart SOC is set at 20%.
I only noticed this behavior with the latest "master version" - it worked with the previous ones.
The SOC of the battery at that time was constant at 11% and US2000c is connected to DTU..
At 5:52h, I disabled the DPL and switeched off the Hoymiles manually
To Reproduce Bug
Expected Behavior
The HM-600 should shut down when the voltage drops below 47.5V or 10% SOC, and turn back on when the voltage exceeds 49V or 20% SOC.
Install Method
Pre-Compiled binary from GitHub
What git-hash/version of OpenDTU?
83b42a3
Relevant log/trace output
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: