SunHarvest

AI mode

You write what you want in plain words. The planner turns it into a small set of rules for your site, your tariff and tomorrow's weather, and keeps them up to date.

What it is

Take a goal like "keep 15 % back for power cuts between 8 am and 9 pm, export as much as you can at the evening peak, never buy power above 25p". The planner turns it into up to twelve rules. It replans every three hours and replaces the set with each new valid plan.

While AI mode is on, the plan's rules run and your own rules pause. If a plan goes stale (24 hours without a new valid one) or the planner fails, your own rules take over by themselves. Switch it off any time.

Every plan is kept. Control › AI shows the current plan as sentences with the planner's reasoning. You can scroll back through every run with the exact information it was given and its raw reply. What it sees shows the pack the planner would be sent right now: prices, forecast and live state. It is free to look at, and nothing is sent.

AI mode is part of Pro, and the 30-day trial includes it.

Before you start: your own AI account

SunHarvest does not run the AI for you. You bring an API key from a provider of your choice, and the plan is made on that provider, on your quota and at your cost, under your agreement with them. The key is stored encrypted and is never shown again once saved.

What gets sent: a summary of your site's recent energy data, the forecasts, the prices and your goal text. No account details, no email and no location beyond what the forecast implies. Free tiers may use what is sent to improve the provider's models. That is their terms and your call; paid tiers generally do not.

What it costs: a plan is a few thousand words in and a few hundred out, every three hours while AI mode is on. With it off, a plan is only made when you press Plan now. A failed run is retried up to three times in the next hour, so a bad day can use a few more requests. As a rough guide per site per month at the time of writing:

  • Google Gemini's free tier costs nothing.
  • OpenAI's default model, or an Anthropic Haiku-class model, runs to a few pounds.
  • Anthropic Claude Opus, the default for Anthropic, can reach £15–20.

Set a spending limit on the provider's side and you cannot be surprised.

You can add more than one provider. They form a chain: the first is tried, and if it errors (quota exhausted, outage), the next takes over. Every new plan starts again from the top. A free Gemini key with a paid key beneath it is a sensible pair.

Google Gemini: free, and the easiest place to start

  1. Go to aistudio.google.com/apikey and sign in with any Google account.
  2. Press Create API key. If asked, let it create a new Google Cloud project for you.
  3. Copy the key, which starts with AIza.

The key works immediately on the free tier, which allows far more requests than SunHarvest uses. The free tier's terms allow Google to use the content to improve its products. If you would rather it did not, attach a billing account to the project in Google Cloud. The key then moves to the paid tier, which is still very cheap.

In SunHarvest, choose provider Google Gemini, paste the key, and leave the model blank to use the built-in default.

Anthropic Claude

  1. Go to console.anthropic.com and create an account. This is separate from a claude.ai chat subscription.
  2. Under Billing, add a card and buy some prepaid credit; $5 is enough to start. This step matters, because a key on an account with no credit is rejected on every call.
  3. Under API keys, press Create Key, name it (say "SunHarvest") and copy it. It starts with sk-ant- and is shown once.
  4. Optionally, set a monthly spend limit under Billing.

In SunHarvest, choose provider Anthropic Claude and paste the key. Leaving the model blank uses Claude Opus, the strongest and dearest option. For a cheaper plan, type a Sonnet or Haiku model id from Anthropic's model list into the Model box.

OpenAI

  1. Go to platform.openai.com and sign up or sign in. The Platform account is separate from a ChatGPT subscription.
  2. Under Billing, add a card and load a prepaid balance; $5 is enough to start.
  3. Under Usage limits, set a hard monthly limit and an alert threshold.
  4. Under API keys, press Create new secret key, name it and copy it. It starts with sk- and is shown once.

In SunHarvest, choose provider OpenAI and paste the key. Leaving the model blank uses a small, inexpensive default model; type another model id from OpenAI's list if you prefer.

OpenAI-compatible services (Groq, Mistral, OpenRouter and others)

Many services use OpenAI's API format. For these, SunHarvest needs three things:

  • the key
  • the service's base URL, which ends in /v1
  • a model name, which is required because every service names models differently
  • Groq: console.groq.com › API Keys. Base URL https://api.groq.com/openai/v1. It has a free tier.
  • Mistral: console.mistral.ai › API Keys. Base URL https://api.mistral.ai/v1.
  • OpenRouter: openrouter.ai/keys, then add credit. Base URL https://openrouter.ai/api/v1. Models are named in vendor/model form. One key gives you many models.

The base URL must be https:// and reachable from the internet. A service running on your own network, such as Ollama on a home PC, is refused, because SunHarvest's servers cannot reach it and must not be pointed at private addresses.

Adding the key in SunHarvest

  1. Open Settings › AI providers and press Add a provider. Pick the provider and paste the API key. Set the model if you want one other than the default, and, for OpenAI-compatible services only, the base URL. Press Add provider.
  2. Press Test. SunHarvest sends one tiny request ("Reply with the single word OK") and shows the answer and the model that replied. If it fails, the message is the provider's own (see When the test fails).
  3. Add more providers if you like and drag them into the order you want them tried.

Edit lets you change the model or base URL; leave the key box blank to keep the stored key. Removing the last provider switches AI mode off, and your own rules take over.

Writing a goal and switching on

  1. In Control › AI, write your goal: a sentence or a few paragraphs saying what matters, in order. The chips under the box (Outage safety, Export income, Cheap import, Holiday mode, Battery care) drop in starting points you can edit. Every save is a new version, and you can restore any earlier one.
  2. Press Save goal, then Plan now to see what the planner makes of it before handing over. This takes up to a minute. The plan appears as sentences, each with the planner's one-line reason. While the switch is off, the plan is only shown, never run.
  3. If you like it, switch AI mode on. The plan's rules go live, and the planner replans every three hours. A goal edit is picked up by the next plan, or press Plan now to use it straight away.
  4. Prefer to keep control? Use Copy to my rules on a single rule, or Adopt the whole plan into my rules. The copies arrive switched off on the Rules tab for you to review, edit and enable. Copying and adopting are Pro features, and adopted rules run only while your account has Pro.

If a run fails, for example because the provider is down or the quota is spent, the previous valid plan keeps driving and the failure is shown with its error. After 24 hours with no valid plan, your own rules take over.

A goal that works

Be concrete about priorities, times and numbers. The planner knows your tariff, your forecast and your battery. It does not know what you care about. For example:

Priorities, in this order:
1. Don't let the battery fall below 15 % between 08:30 and 21:00 — that's my power-cut cushion for when I'm awake.
2. End each day with enough battery to run the house overnight (about 6 kWh).
3. Export as much as possible in the 16:00–19:00 window on days when tomorrow looks sunny.
4. Only buy from the grid below 12p, and never above 25p.
Prefer fewer, simpler rules.

When the test fails

The message is the provider's own, passed through. The common ones:

  • 401 / 403, "invalid API key". The key was mistyped, or it belongs to a different product: a ChatGPT or claude.ai subscription is not an API key. Make a fresh key and paste it again.
  • 402, "insufficient credit" or "billing". Anthropic and OpenAI keys need prepaid credit on the account.
  • 404, "model not found". The model name is wrong or retired. Clear the model box to use the default, or copy the exact id from the provider's list.
  • 429, "rate limit" or "quota". The free tier's daily allowance is spent, or a paid account's limit is hit. It clears on its own, and a second provider in the chain covers the gap.
  • Could not reach the provider. There is an outage, or an OpenAI-compatible base URL is wrong or private.