See llms.txt for all machine-readable content.

Back to Templates

Diagnose solar production losses with SolarEdge, Open-Meteo, Gemini, Postgres, Jira and Slack

Quick overview

Youtube Video: https://youtu.be/7lmQu9wd46w

This workflow runs on a monthly schedule (or manually) to compare SolarEdge energy production against weather-adjusted expectations using Open-Meteo and Postgres history, then uses Google Gemini to attribute losses and, for anomalies, creates Jira work orders and posts alerts to Slack.

How it works

  1. Runs on a monthly schedule (or when executed manually) and loads site configuration such as date range, expected kWh, and thresholds.
  2. Pulls daily energy production for the configured period from the SolarEdge Monitoring API and fetches hourly radiation and cloud cover data from Open-Meteo.
  3. Queries Postgres for the site’s last 30 days of performance history and the most recent incidents to build diagnostic context.
  4. Calculates actual vs expected production, weather-adjusted losses, performance ratios, anomaly flags, and historical baselines, then upserts the results into a Postgres solar performance table.
  5. If the period is anomalous, sends the metrics and historical context to Google Gemini to generate a structured root-cause attribution, confidence, priority, and recommended actions.
  6. Stores the AI diagnosis as an open incident in Postgres, creates a Jira task with the diagnosis details, links the Jira key back to the incident, and posts an alert to a Slack channel.
  7. If no anomaly is detected, posts a daily/period summary message to Slack.

Setup

  1. Configure credentials for SolarEdge (OAuth2), Postgres, Google Gemini (PaLM/Generative Language API), Jira Software Cloud, and Slack.
  2. Update the Config values for your site (SolarEdge site ID, latitude/longitude, timezone, expected_kwh, loss_threshold_pct, evaluation date and period dates, and Jira base URL).
  3. Ensure Postgres has the required tables and constraints used by the queries (solar_daily_performance and solar_incidents, including the ON CONFLICT keys).
  4. Select the target Slack channel and confirm the Jira project and issue type used for creating work orders match your Jira setup.
  5. Activate the workflow and adjust the schedule trigger interval if you want a different cadence than monthly.