Read per-minute energy usage form the Emporia Vue API
|
|
hai 11 meses | |
|---|---|---|
| .gitignore | hai 11 meses | |
| README.md | hai 11 meses | |
| main.py | hai 11 meses | |
| requirements.txt | hai 11 meses | |
| run.sh | hai 11 meses |
# One of these:
pip install virtualenv
sudo apt install python3-venv
# Then setup the virtual environment:
python3 -m venv env
# Activate the environment:
source env/bin/activate
# Install required packages
pip install -r requirements.txt
# Update set of required packages
pip freeze > requirements.txt
Create a keys.json file in this directory containing your
username & password:
{
"username": "<your username>",
"password": "<your password>"
}
After the first time the script is run, the file will automatically be updated to use access tokens, rather than your password.
To create a usage.tsv file, and keep it updated with new, non-duplicated,
results, just run the script:
./run.sh
To run the code manually:
# Activate the environment:
source env/bin/activate
# Run the script & store the results:
python3 main.py >> output.tsv