Using Saturn Cloud - TonyM1958/FoxESS-Cloud GitHub Wiki

This page describes how to setup a scheduled job to run in SaturnCloud and provides scripts for configuring and setting battery charge times and uploading data to PV Output.

Get your Fox account API Key

Go to FoxESSCloud. Login and click on your account and select Account Profile and then API Management. Generate an API Key. Copy and save your API key. You will need this when you conifgure any scripts or apps that need access to your Fox account.

image

Register your account and Login

Go to SaturnCloud and register for a free Saturn Cloud Hosted account. You will recieve a free allocation of runtime per month and can link your exiting Google or Github accounts or create a new account.

Alternatively, sign up for Saturn Cloud Pro. The initial cost is just $5 and the cost to run a daily scheduled job is around $10 a year.

Add your secrets

You can store personal information using the Secrets store in your account. This information is not shared with anyone else but can be made available when you run a scheduled job so it can do things like login to the Fox ESS Cloud account to retrieve data or update inverter settings.

Each secret has an upper case name and a parameter value must be enclosed in double quotes. You add Secrets by clicking on 'Secrets' in your account menu bar and then clicking 'New', entering the name and value and then clicking 'Add'. Add the following secrets:

  • FOX_API_KEY the API key for your Fox ESS account. The value must be in double quotes e.g. "<your api key>"
  • FOX_DEVICE_SN the serial number of your inverter e.g. "<your serial number>"

Optional:

  • PV_API_KEY the API key created to allow data to be uploaded to your account in pvoutput.org e.g. "<your api key>"
  • PV_SYSTEM_ID the System ID for your PV output data e.g. "<your system id>"
  • SOLCAST_API_KEY the API key to access forecast data from the solcast.com account e.g. "<your api key>"
  • PUSHOVER_USER_KEY the user key to send messages to your pushover.net account e.g. "<your user key>"

When you have finished, your Secrets should look like this:

image

Create a New Job

Click on 'Resources' in your account and you will see the following options:

Click on New Job and then click 'Start from a recipe'. Go to this page and click 'copy raw file' (icon in the top right hand corner with 2 boxes) and then paste this (ctrl+V) in the Recipe window, give the job an owner and name and click 'Create'.

You should now be able to access the job in your Resource and see the overview:

image

What does the job do?

The job is scheduled to run at 10pm and 11pm (note that times in Saturn Cloud are GMT, so the run times will be 1 hour later during BST). When the job runs, it will:

  • configure your tariff, including working out the best charge times if you are using Agile
  • check your battery charge, forecast generation and consumption and work out if you need to charge from grid
  • download your complete generation data for yesterday and upload this to PV Ouptut
  • download your partial generation data for today and uploads this to PV Output

Configure the job

If you go to Resources and click on the job foxess, there is an 'Edit' button in the top right hand corner. Click this and you will see Overview, Schedule and Environment settings for your job. Under Environment, there is a section Environment Variables:

image

You can alter the settings here to configure your tariff and charging.

TARIFF_PARAMS configures the time when you get access to cheap rate energy for battery charging. The first parameter is your tariff. You can use the following values:

  • 'flux': Octopus Flux, charging from 02:00 to 05:00
  • 'agile': Agile Octopus, charging between 23:00 and 08:00 based on the lowest average price available
  • 'cosy': Octopus Cosy, charging from 04:00 to 07:00 and 13:00 to 16:00
  • 'go': Octopus Go, charging from 00:30 to 04:30.
  • 'intelligent': Intelligent Octopus, charging from 23:30 to 05:30.
  • 'driver': British Gas Electric Driver, charging from 00:00 to 07:00

If you are using Agile Octopus, you may also need to configure region and duration (details here).

CHARGE_PARAMS configures charging. The settings are explained here.

Settings you may want to change:

  • update_settings: setting this to 1 will allow charge_needed to change the charge settings of your inverter. No changes will be made if this parameter is set to 0
  • charge_current: this setting tells charge_needed about any charging limits you may have set. By default, charge_needed will work out how long to enable charging based on the charge power of your inverter model e.g. H1-6.0-E has a charge_current of 35A. If you specifically limit charging (by reducing the Max Charge Current setting on the inverter) you will need to set charge_current to allow the correct time for charging. For example, if you have limited charge current to 16A, charge_current=16
  • timed_mode: if you are using flux, setting timed_mode=1 tells charge_needed that your work mode is set to change to Self Use at 7am and to Feed In First at 4pm (e.g. using automations in Home Assistant). When timed_mode=0, charge_needed assumes your work mode is set to Self Use.
  • force_charge: adding force_charge=1 will enable charge from grid or force charge across all of your tariff charging time window. This ensures your battery does not discharge during your cheap rate period if, for example, you are charging an EV at the same time. If set to 0, your house will be supplied from the battery once charging is complete

After you have made any changes, click the 'Save' button at the bottom of the page.

Run the job

Go to the Overview.

Move the slider by 'Schedule' to On and click 'Start'. After a few minutes, the job should complete and look like this:

image

Click on 'Logs' and expand the main entry to see what happened:

image

If there is an error, check your Secrets have been entered correctly (username and password) and also any changes to your Environment Variables.

You can test your changes by going to Overview and clicking 'Start'.

Cron Schedule

The time that the job runs is set by the Cron Schedule in the job details. You can alter this if you wish:

image

The Cron Schedule consists of 5 elements, explained here. Saturn Cloud's Cron runs with UTC system time so the default schedule runs the job at 22:01 UTC every day. This means, in the UK, the job will run at 22:01 in Winter time and 23:01 in Summer time.

If you want the job to run at 22:01 in Summer time, change the Cron Schedule from 22 to 21 when the clocks go forward in Spring and revert to 22 when the clocks go back in Autumn.

Pushover

Pushover is a short messaging app (up to 1024 characters) that can be installed on your Android or Apple phone or tablet. It looks like this:



You can register for an account at pushover.net and get a user key.

Download the Pushover app from the Google or Apple or App Stores for your phone or tablet. Pushover is a free 30-day trial with a cost of $5 per platform (up to 10 Android or 10 Apple devices) for a perpetual licence.

Once you install the app and setup your user key, the jobs you run will send a summary to your Pushover account when they run.

Troubleshooting

Syntax Error

This happens if a parameter or secret is not configured correctly. Please ensure all of the values you entered for your Secrets are contained in double quotes.

Time-out error accessing Fox ESS cloud

This happens because access to the internet for jobs running under free accounts is blocked. Email [email protected] and ask them to unblock the following URLs:

https://www.foxesscloud.com/*
https://pvoutput.org/*
https://api.solcast.com.au/*
https://api.octopus.energy/*

Alternatively, signing up to Saturn Cloud Pro, unlocks internet access from jobs. The charges are low, with an initial payment of $5 and a charge of $0.06 for each hour of runtime (using a medium instance). Consuming 15 hours per month should cost $10 a year. You can also downgrade back to free if you wish.

⚠️ **GitHub.com Fallback** ⚠️