Huawei EMMA: add curtailment - #32006
Conversation
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The
curtailsequence’sswitchcase for 100% appears to nestsettwice (set: { source: const ... set: { source: modbus ... }}), which likely doesn’t match the usual template schema and may need to be flattened to a singlesetblock. - In the
curtailedGo block,percentis declared asintbut read withscale: 0.1, which may produce a non-integer value; consider either removing the scale and comparing the raw register value or changing the type/scale so they are consistent with the script’spercent == 100check.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `curtail` sequence’s `switch` case for 100% appears to nest `set` twice (`set: { source: const ... set: { source: modbus ... }}`), which likely doesn’t match the usual template schema and may need to be flattened to a single `set` block.
- In the `curtailed` Go block, `percent` is declared as `int` but read with `scale: 0.1`, which may produce a non-integer value; consider either removing the scale and comparing the raw register value or changing the type/scale so they are consistent with the script’s `percent == 100` check.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
Currently at work. I am gonna install a nightly instance when I come home and try to confirm what you need. |
|
This won't be in the nightly until it is merged into master. So you either have to build yourself or have a maintainer execute a Do you know how you want to test it? It is not super easy to test without a real controlbox or controlbox simulator. Alternatively you could try with the |
|
A build would be the best optíon for me. It seems good intentions don't suffice.... building my own is out of the question (when there a howto around i would try to). I thought this would be integrated into nightly or testing branch. Then I would have simply switched from the offical to testing and would have tried the controlbox-simluator or the curtail command. (F*** - I must be annoying as fuck to you guys ...) |
This comment has been minimized.
This comment has been minimized.
|
✅ Build finished.
|
|
Build installed on a separate pi - controlbox installed and running as well. |
|
@CiNcH83 with those values there is no indication in evcc that anything is limited. However the sun is not shining atm - so i dont know if evcc only shows indications when it really has to act accordingly?
No change with failsafe at zero or not.
|
|
Did you set nominal max? |
|
no - i think that was transfered by evcc after I corrected my 8550 to 8800 as in your screenshot as I have a 8k-map0 with a "scheinleistung" wiht 8800VA. |
|
I also have an 8KTL. 8800W is correct for max. active power (=reactive power at power factor 1.0). |











fixes #31959
Adds EEG §9 curtailment to the Huawei EMMA meter template. EMMA is the master gateway, so the limit has to be written to EMMA itself (unit ID 0) rather than to the underlying inverters. Its registers mirror the SUN2000 semantics, so this reuses the existing
curtail/curtailedpattern with EMMA addresses.curtailwrites the feed-in percentage to register 40109 (gain 10) and switches register 40100 between mode 7 (power-limited grid connection, %) and mode 0 (unlimited) at 100%curtailedreports curtailment unless mode is 0, or mode 7 at 100%curtailcapability to the templateRegister addresses and encodings are taken from the SmartHEMS V100R024C00 MODBUS Interface Definitions (section 3.1, "Limited feed-in"), attached to the issue. They have not been verified against hardware.
TODO
🤖 Generated with Claude Code