Map GECloud three-phase *_power_rate controls to percent-rate entities#3817
Map GECloud three-phase *_power_rate controls to percent-rate entities#3817springfall2008 merged 9 commits intomainfrom
*_power_rate controls to percent-rate entities#3817Conversation
Agent-Logs-Url: https://github.com/springfall2008/batpred/sessions/18b0f8c7-bac5-4f6a-9159-9baf8e187029 Co-authored-by: springfall2008 <48591903+springfall2008@users.noreply.github.com>
*_power_rate controls to percent-rate entities
|
@copilot you havne't fixed this code It needs to account for _power_rate being in percent |
Agent-Logs-Url: https://github.com/springfall2008/batpred/sessions/b8258764-acf4-4a79-9294-4dd5ae8ad39c Co-authored-by: springfall2008 <48591903+springfall2008@users.noreply.github.com>
Removed fallback assignment for charge and discharge rates.
... Updated in 7ea42c9. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot The tests are failing you need to fix |
There was a problem hiding this comment.
Pull request overview
Fixes GECloud auto-configuration for three-phase systems where *_power_rate number entities represent percentage rate controls (0–100%) but were previously being wired into watt-based charge_rate / discharge_rate config channels.
Changes:
- Corrected GECloud auto-config entity candidate selection so
charge_power_rate/discharge_power_ratemap tocharge_rate_percent/discharge_rate_percentinstead of watt-based rate args. - Updated GECloud register publishing to classify
*_power_ratenumber entities as percent-based controls (unit%,device_class=power_factor). - Updated GECloud tests to validate three-phase mapping and added a targeted assertion for percent attributes on the published
charge_power_rateentity.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| apps/predbat/gecloud.py | Adjusts register attribute classification and auto-config mapping to route three-phase *_power_rate controls through percent-rate args. |
| apps/predbat/tests/test_ge_cloud.py | Updates auto-config assertions for three-phase setups and adds a publish-registers check for percent attributes on charge_power_rate. |
| if "%" in reg_name: | ||
| attributes["device_class"] = "battery" | ||
| attributes["unit_of_measurement"] = "%" | ||
| elif "_power_percent" in ha_name: | ||
| elif "_power_percent" in ha_name or "_power_rate" in ha_name: | ||
| attributes["device_class"] = "power_factor" | ||
| attributes["unit_of_measurement"] = "%" |
There was a problem hiding this comment.
In publish_registers, percent-like registers such as Battery Reserve Percent Limit (e.g. HA name battery_reserve_percent_limit) won’t get unit_of_measurement/device_class because the code only treats registers as percent when the raw register name contains a literal %. The GE Cloud register names in tests use the word Percent (no %), so these entities will be published without a unit.
Consider detecting percentage registers based on the normalized ha_name (e.g. contains _percent) in addition to the % symbol, while keeping the special-cases for power percent/rate and watt-based _power registers.
Agent-Logs-Url: https://github.com/springfall2008/batpred/sessions/24987fae-5e8c-498a-940a-70bcb25389cc Co-authored-by: springfall2008 <48591903+springfall2008@users.noreply.github.com>
Agent-Logs-Url: https://github.com/springfall2008/batpred/sessions/24987fae-5e8c-498a-940a-70bcb25389cc Co-authored-by: springfall2008 <48591903+springfall2008@users.noreply.github.com>
Fixed in 0dc91a2 (with a small follow-up in 8951973). I restored GECloud Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot The manual select tests are failing |
Agent-Logs-Url: https://github.com/springfall2008/batpred/sessions/c43680af-98fa-402c-96ba-027ab946f2bc Co-authored-by: springfall2008 <48591903+springfall2008@users.noreply.github.com>
Fixed in b36346b. I made the manual_select test robust at day boundaries by preferring a non-today dropdown label and using the full day+time label for the conflict-removal checks; manual_select now passes consistently in repeated runs. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
GECloud auto-configuration was assigning three-phase
charge_power_rate/discharge_power_ratenumber entities to watt-basedcharge_rate/discharge_rate. These entities are percentage controls and should be wired through the percent-rate paths.Auto-config rate mapping correction (
apps/predbat/gecloud.py)charge_power_rate/discharge_power_ratefrom watt-rate entity candidates.charge_rate_percentviainverter_charge_power_percentagefallback tocharge_power_ratedischarge_rate_percentviainverter_discharge_power_percentagefallback todischarge_power_ratebattery_charge_power/battery_discharge_power.Targeted GECloud config test update (
apps/predbat/tests/test_ge_cloud.py)charge_rate/discharge_rateare not populated from*_power_ratecharge_rate_percent/discharge_rate_percentuse the*_power_rateentitiesWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
gitlab.com/usr/lib/git-core/git-remote-https /usr/lib/git-core/git-remote-https origin REDACTED(dns block)https://api.github.com/repos/springfall2008/batpred/contents/apps/predbat/home/REDACTED/work/batpred/batpred/coverage/venv/bin/python3 python3 ../apps/predbat/unit_test.py --quick(http block)/home/REDACTED/work/batpred/batpred/coverage/venv/bin/python3 python3 ../apps/predbat/unit_test.py --list(http block)/home/REDACTED/work/batpred/batpred/coverage/venv/bin/python3 python3 ../apps/predbat/unit_test.py --test ge_cloud(http block)If you need me to access, download, or install something from one of these locations, you can either: