Skip to content

This workflow automatically monitors solar energy production every 2 hours by fetching data from the Energidataservice API. If the energy output falls below a predefined threshold, it instantly notifies users via email. Otherwise, it logs the data into a Google Sheet and posts a daily summary to Slack.

License

Notifications You must be signed in to change notification settings

weblineindia/n8n-Monitor-Solar-Energy-Production-Send-Alerts-with-Gmail-Google-Sheets-and-Slack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

n8n-Monitor-Solar-Energy-Production-Send-Alerts-with-Gmail-Google-Sheets-and-Slack

This n8n workflow monitors solar energy production every 2 hours by fetching data from the Energidataservice API.
If energy output falls below a predefined threshold, it sends instant alerts via email.
Otherwise, it logs the data into Google Sheets and posts a daily summary to Slack for visibility.


👤 Who’s It For

  • Renewable energy teams monitoring solar output.
  • Facility managers and power plant supervisors.
  • ESG compliance officers tracking sustainability metrics.
  • Developers or analysts automating solar energy reporting.

⚙️ How It Works

  • Trigger (Schedule Trigger) → Runs every 2 hours.
  • Data Fetch (HTTP Request) → Calls the Energidataservice API for solar production data.
  • Processing (Code Node) → Filters entries with production below threshold.
  • Decision Making (IF Node) → Checks if any low-production entries exist.
  • Alerts (Gmail Node) → Sends an email if low-production is detected.
  • Logging (Google Sheets Node) → Logs valid production data for record-keeping.
  • Slack Summary (Slack Node) → Posts daily summary sheet data for visibility.

🛠️ How to Set Up

  • Schedule Trigger: Configure to run every 2 hours.

  • HTTP Request Node:

    Method: GET

    URL: https://api.energidataservice.dk/dataset/YourDatasetHere

    Add necessary headers and params as required by the API.

  • Code Node: Define logic to filter entries where solar_energy_production < required_threshold.

  • If Node: Use items.length > 0 to check for low-production entries.

  • Gmail Node:

    • Auth with Gmail credentials.
    • Customize recipient and message template.
  • Google Sheets Node:

    • Connect to a spreadsheet.
    • Map appropriate columns.
  • Slack Node:

    • Use Slack OAuth2 credentials.
    • Specify channel and message content.

Requirements

  • n8n Cloud or Self-hosted instance.
  • Access to Energidataservice API.
  • Gmail account (with n8n OAuth2 integration).
  • Google Sheets account & sheet ID.
  • Slack workspace and app with appropriate permissions.

How to Customize

  • Change Frequency: Adjust the Schedule Trigger interval (e.g., every hour or 4x per day).
  • Threshold Tuning: Modify the value in the Code node to change the minimum acceptable solar production.
  • Alert Routing: Update Gmail recipients or replace Gmail with Microsoft Outlook/SendGrid.
  • Sheet Format: Add or remove columns in the Google Sheet based on extra metrics (e.g., wind or nuclear data).
  • Slack Posting: Customize Slack messages using Markdown for improved readability.

Add‑ons

  • Telegram Node: Send alerts to a Telegram group instead of email.
  • Discord Webhook: Push updates to a Discord channel.
  • n8n Webhook Trigger: Extend it to receive external production update notifications.
  • Integromat/Make or Zapier: For multi-platform integration with CRMs or ticketing tools.

Use Case Examples

  • Utility Companies: Automatically detect and act on solar underperformance to maintain grid - stability.
  • Solar Farm Operators: Log clean production data for auditing and compliance reports.
  • Sustainability Teams: Track daily performance and anomalies without manual checks.
  • Home Solar System Owners: Get notified if solar generation drops below expected.

🧰 Common Troubleshooting

Issue Possible Cause Solution
HTTP Request fails API key missing or incorrect URL Verify API endpoint, parameters, and authentication headers.
Gmail not sending alerts Missing or invalid Gmail credentials Re-authenticate Gmail OAuth2 in n8n credentials.
No data logged in Google Sheet Incorrect mapping or sheet permissions Ensure the Google Sheet exists, columns match, and credentials are correct.
Slack node fails Invalid token or missing channel ID Reconnect Slack credentials and check that the channel ID is valid.
Code node returns empty Filter logic too strict or wrong format Validate incoming data structure and adjust the threshold condition.

🤝 Need Help?

Need help setting this up or customizing it for your solar or energy monitoring use case?

✅ Set it up on your n8n Cloud or self-hosted instance
✅ Customize it for your own API or data source
✅ Modify alerts to suit Teams, Discord, SMS, or other tools

👉 Contact WeblineIndia’s n8n Automation Team — we’ll be happy to help.

About

This workflow automatically monitors solar energy production every 2 hours by fetching data from the Energidataservice API. If the energy output falls below a predefined threshold, it instantly notifies users via email. Otherwise, it logs the data into a Google Sheet and posts a daily summary to Slack.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published