Git Product home page Git Product logo

ausgridbot's Introduction

AusGridBot

This is a bot that reads electricity pricing information from AEMO's API and posts interesting things to Mastodon. There is one per Australian state participating in the National Energy Market:

Hosting

This repo is set up to be run on a fly.io instance to make self-hosting easy. The basic free account is good enough for this purpose.

The bring-up process is pretty trivial:

1. Install git and flyctl
    `sudo apt install git`
    `curl -L https://fly.io/install.sh | sh`
2. Clone this repo
    `git clone [email protected]:tjhowse/bomgifbot.git`
3. `flyctl auth signup`
4. Set the config in the `env` section of `fly.toml`
5. `flyctl launch`
6. Set all the secrets listed in secrets.toml.template
    `flyctl secrets set MASTODON_CLIENT_ID=<your client id> MASTODON_CLIENT_SECRET=<your client secret>`, etc
7. `flyctl deploy`

To pause the app, run flyctl scale count 0. To resume, run flyctl deploy. There might be steps missing here. I wrote this post-hoc.

Configuration

Setting Description Secret Example Default
MASTODON_SERVER The URL of the mastodon server to post to No https://botsin.space N/A
MASTODON_CLIENT_ID The client ID of the mastodon app to use Yes 1234567890 N/A
MASTODON_CLIENT_SECRET The client secret of the mastodon app to use Yes 1234567890 N/A
MASTODON_USER_EMAIL The email address of the mastodon account Yes [email protected] N/A
MASTODON_USER_PASSWORD The user password of the mastodon account Yes 1234567890 N/A
GRID_BOT_CREDENTIALS A JSON-formatted list of per-region credentials. The above credentials are used if this is blank. Yes See below ""
AEMO_CHECK_INTERVAL The number of seconds between checking the AEMO API for new forecast information No 1200 1200
TEST_MODE If true, do not toot anything to mastodon, just log messages No true false

Example GridBot credentials json

[
    {
        "RegionID": "QLD1",
        "MastodonClientID": "clientid",
        "MastodonClientSecret": "clientsecret",
        "MastodonUserEmail": "useremail",
        "MastodonUserPassword": "userpassword"
    },
    {
        "RegionID": "NSW1",
        "MastodonClientID": "clientid",
        "MastodonClientSecret": "clientsecret",
        "MastodonUserEmail": "useremail",
        "MastodonUserPassword": "userpassword"
    }
]

ausgridbot's People

Contributors

tjhowse avatar

Stargazers

 avatar

Watchers

 avatar

ausgridbot's Issues

Small downgrades should be ignored

This shouldn't happen: The South Australia predicted wholesale electricity price peak of $1.00/kWh has been downgraded to a peak of $1.00/kWh at 19:30:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.