Skip to content

Add azimuth flip option for openmeteo/forecast.solar#3985

Merged
springfall2008 merged 2 commits into
mainfrom
feat/solar_flip_azimuth
May 31, 2026
Merged

Add azimuth flip option for openmeteo/forecast.solar#3985
springfall2008 merged 2 commits into
mainfrom
feat/solar_flip_azimuth

Conversation

@springfall2008
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings May 31, 2026 13:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds an opt-in azimuth_zero_south setting for Forecast.solar and Open-Meteo PV forecast configs so users can provide azimuth values directly in the upstream API convention.

Changes:

  • Gates azimuth conversion in SolarAPI for Forecast.solar and Open-Meteo when azimuth_zero_south is enabled.
  • Adds unit coverage for converted vs unconverted azimuth URL generation.
  • Updates version, example config, and documentation for the new option.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
apps/predbat/solcast.py Adds conditional azimuth conversion for Forecast.solar and Open-Meteo configs.
apps/predbat/tests/test_solcast.py Adds Forecast.solar test coverage for azimuth_zero_south.
apps/predbat/tests/test_open_meteo.py Adds Open-Meteo test coverage for azimuth_zero_south.
apps/predbat/predbat.py Bumps Predbat version to v8.39.9.
apps/predbat/config/apps.yaml Documents the new config key in the sample config.
docs/install.md / docs/apps-yaml.md Documents the new azimuth convention option.

Comment thread docs/install.md Outdated
Comment on lines +706 to +710
om_calls = [r for r in test_api.request_log if "api.open-meteo.com" in r["url"]]
if not om_calls:
print("ERROR: No Open-Meteo API call made (azimuth_zero_south=True)")
failed = True
elif "azimuth=0" not in om_calls[0]["url"]:
Comment thread apps/predbat/solcast.py
Comment on lines 309 to +311
az = config.get("azimuth", 180.0)
az = self.convert_azimuth(az)
if not config.get("azimuth_zero_south", False):
az = self.convert_azimuth(az)
Comment thread apps/predbat/solcast.py
Comment on lines 441 to +443
az = config.get("azimuth", 180.0)
az = self.convert_azimuth(az) # Convert azimuth to degrees if needed
if not config.get("azimuth_zero_south", False):
az = self.convert_azimuth(az)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@springfall2008 springfall2008 merged commit c58341a into main May 31, 2026
1 check passed
@springfall2008 springfall2008 deleted the feat/solar_flip_azimuth branch May 31, 2026 15:47
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