Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/njh/octocron
Ruby scripts and tools for working with Octopus Energy Smart Tariffs
https://github.com/njh/octocron
octopus-energy
Last synced: 9 days ago
JSON representation
Ruby scripts and tools for working with Octopus Energy Smart Tariffs
- Host: GitHub
- URL: https://github.com/njh/octocron
- Owner: njh
- Created: 2024-04-08T13:34:13.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-04-13T00:16:27.000Z (7 months ago)
- Last Synced: 2024-04-13T22:56:22.625Z (7 months ago)
- Topics: octopus-energy
- Language: Ruby
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Octocron
========This repo contains a set of ruby scripts for working with the UK [Octopus Energy Smart Tariffs].
I wanted something that was easy to run and adapt and didn't request a persistent process running.It was built and tested using Ruby version 3.3.0 but it should work fine with other versions of ruby.
Installation
------------Install [ruby] and [bundler], then install the gem dependencies:
```
bundle install
```Copy the example configuration file and edit it:
```
cp config.yml.example config.yml
vim config.yml
```Then you can start running the scripts below.
The API Key and account number are only needed if the script uses consumption data or account information.Scripts
-------*account-info.rb*
The script*electricity-agile-check.rb*
*gas-tracker-check.rb*
*list-products.rb*
*octopus-api.rb*
Running Periodically with Cron
------------------------------Once you are happy with running the scripts manually, you can then configure [cron] to
run them automatically at your desired times.```
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# For more information see the manual pages of crontab(5) and cron(8)# m h dom mon dow command
13 2 * * * cd ~/octocron/ && ./electricity-agile-check.rb > /dev/null
15 2 * * * cd ~/octocron/ && ./gas-tracker-check.rb > /dev/null
```In this example we run the scripts that check the electricity and tariffs at 2:13 and 2:15 respectively, every day.
By piping the stdout to `/dev/null`, you will only get an email if someone goes wrong,
or something is written to stderr - such as an alert that the gas tracker rate has got expensive!