Skip to content

FNN: no export limit for S1/S2 without generator power - #36544

Merged
andig merged 2 commits into
masterfrom
fnn-production-nominal-max
Nov 28, 2026
Merged

andig merged 2 commits into
masterfrom
fnn-production-nominal-max

Conversation

@premultiply

@premultiply premultiply commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

refs #36515

Without productionnominalmax, an active S1 or S2 signal made the FNN HEMS report a 0 W production limit, which the optimizer applies as a hard zero-export cap instead of 60% or 30% of the installed power. The parameter is optional in all FNN templates, so this affects existing setups.

  • S1 or S2 without productionnominalmax now fails at startup instead of silently applying a wrong limit.
  • W3 alone still works without generator power, since 0% is 0 W regardless.
  • Breaking for setups using S1/S2 without productionnominalmax; the deprecated maxproductionpower/maxcurtailpower still count as generator power.

🤖 Generated with Claude Code

@github-actions github-actions Bot added infrastructure Basic functionality load management Load Management labels Nov 23, 2026
@premultiply
premultiply requested a review from andig November 24, 2026 04:59
@premultiply
premultiply marked this pull request as ready for review November 24, 2026 04:59

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="hems/fnn/fnn.go" line_range="292-293" />
<code_context>
 	}

+	// without generator power a partial limit cannot be converted to watts
+	if c.productionPercent > 0 && c.productionNominalMax <= 0 {
+		return nil
+	}
+
</code_context>
<issue_to_address>
**Session history shows false zero cap**

When an S1 or S2 signal is active while `productionNominalMax` is missing, `setProductionLimit` computes a zero `limit` and passes it to `smartgrid.UpdateSession`, which stores it as `GridSession.LimitPower`; returning nil from `MaxProductionPower` only removes the optimizer input, so session history and exports report a zero-watt cap that was not applied.

Prevent `setProductionLimit` from storing a zero-watt cap when the nominal production power is missing.
</issue_to_address>

### Comment 2
<location path="hems/fnn/fnn.go" line_range="99" />
<code_context>
 	}

+	if w3G != nil && productionNominalMax <= 0 {
+		c.log.WARN.Println("productionnominalmax not configured, S1/S2 feed-in limits are not applied to the grid export")
+	}
+
</code_context>
<issue_to_address>
**W3-only setups get irrelevant warning**

When W3 is configured without `productionNominalMax`, while S1 and S2 are both unconfigured, the warning is emitted even though no S1/S2 feed-in limits are configured, so W3-only setups see a warning about limits they do not use.

Emit the warning only when S1 or S2 is configured and `productionNominalMax` is missing.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread hems/fnn/fnn.go Resolved
Comment thread hems/fnn/fnn.go Resolved
@andig
andig merged commit 74bec96 into master Nov 28, 2026
15 checks passed
@andig
andig deleted the fnn-production-nominal-max branch November 28, 2026 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure Basic functionality load management Load Management

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants