Skip to content

Commit

Permalink
Merge pull request #29 from JoshuaMarden/JoshuaMarden-patch-1
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
HighestAuto authored Aug 21, 2024
2 parents a1d7193 + c0fc83c commit 68cc1bf
Showing 1 changed file with 50 additions and 7 deletions.
57 changes: 50 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@
## Description
#### A dashboard for the monitoring of energy metrics and such as price, demand, or carbon production. See how much of your electricity is generated by nuclear fission, check the cheapest time to charge your electric campervan, or just have a curious glance at what's going on in the grid we all depend upon.

(Python 3.12> and MacOS. You will need Amazon AWS and your login credentials.)
## Requirements
- MacOS
- Python 3.12
- Amazon AWS ([with an access key and secret key](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html))
- [Brew](https://brew.sh/) (to install Terraform)
- (Terraform)[https://formulae.brew.sh/formula/terraform]
- [Docker](https://docs.docker.com/desktop/install/mac-install/)

- For badges and reports to be generated you will also need a [CodeCov](https://about.codecov.io/) and [CodeClimate](https://codeclimate.com/) account. These are free and will need to be linked to your own git repo using their respective browser-based GUIs.

## 'Visuals'
! We'll add some visuals here maybe, using [Asciinema](https://asciinema.org/) or using [ttygif](https://github.com/icholy/ttygif) and a recording. !
Expand Down Expand Up @@ -32,9 +40,38 @@ Run the following commands:
- `add_root_to_path.sh`
- `pip3 install requirements.txt`

Once you have done this, you should be able to run Energy Monitor by running `python3 run.py` from within the repository. No need to run the other steps again.

! definitely a demo here using [Asciinema](https://asciinema.org/) !
You then need to setup files containing your personal secrets.
Create a `.env` file in the root directory with the following:
```
AWS_ACCESS_KEY=myaccesskey
AWS_SECRET_KEY=mysecretkey
AWS_REGION="my-region-#"
```
Create a `terraform.tfvars` file in the root directory with the following:
```
AWS_REGION = "my-region-#"
AWS_ACCESS_KEY = "myaccesskey"
AWS_SECRET_KEY = "mysecretkey"
DB_HOST = "energy-monitor.????????.my-region-#.rds.amazonaws.com"
DB_PORT = "5432"
DB_PASSWORD = "mypassword"
DB_USER = "myusername"
DB_NAME = "mydatabasename"
```
To then build the infrastructure navigate into `infrastructure/` run `terraform plan` then `terraform apply`.

Once you have done this, you should be able to deploy the modules to the cloud using `bash build_and_push.sh`.

For workflows (used by tests and badges) to run you will need to add to your repo's secrets. There are found in the repo's settings, first select 'Secrets and variables'. Under 'actions', 'secrets' select 'New repository secrets'. Add the following:

- AWS_ACCESS_KEY (as above)
- AWS_REGION (as above)
- AWS_SECRET_KEY (as above)
- ECR_URL (the URL to your AWS Elastic Container Registry)
- CODECOV_TOKEN (From the CodeCov website once you have created an account)
- CC_TEST_REPORTER_ID (From the CodeClimate website once you have created an account)

The names must match perfectly as the code is configured to search for these exact names.

## Data Sources & Design Choices

Expand All @@ -48,6 +85,12 @@ Another script runs our [StreamLit](https://streamlit.io) dashboard. StreamLit i

Where could we go next?

- Automatic location detection
- Switch to RedShift
- Tariffs of ‘big 6’ energy suppliers (Price Comparison)
- News feed of energy-relevant articles
- Smart meter integration

Elexon offers a lot more data that we could integrate, and energy suppliers like Octopus offer detailed insight which might allow users to add their personal energy usage to the dashboard.

## Support
Expand All @@ -58,14 +101,12 @@ If you are having trouble using our app please open a ticket we'll get back to y

If people have pushed to this repo, they are authors.


## License

[Elexon License](https://www.elexon.co.uk/data/balancing-mechanism-reporting-agent/copyright-licence-bmrs-data/) requires the following statement:

Contains BMRS data © Exelon Limited copyright and database right 2024.


MIT License

Copyright (c) 2024 J J Marden
Expand Down Expand Up @@ -98,5 +139,7 @@ SOFTWARE.


</div>

<div align="center">
(If this is not displaying it is because it has not yet collected enough data to build a 'Coverage Over Time' graph)
![Coverage Over Time](https://codecov.io/gh/JoshuaMarden/energy_monitor/graphs/commits.svg?token=5CLXJXIEE8)
</div>

0 comments on commit 68cc1bf

Please sign in to comment.