solar_edge/README.md

1.2 KiB

Solar Edge Status Updater

When placed in a cron job this uppdater will make an https call to a json api to retrieve the co2 savings and equivenant trees planted and overlay those numbers on a graphic and upload them to the website.

Dependancies

Python 3 and contents of requirements.txt.

The font Biko_Regular.otf.

A .png graphic to write text on.

The package direnv and the follwing changes to the user account:

Assumes the use of direnv and ssh keys setup to upload graphic to website. If hosted on the website the ssh/scp portion can be replace with a copy. import shutil ... shutil.copy2(out_file, '/var/www/')

Bulid Instructions

assumes installed to ~/python/solar_edge

cd ~/python git clone http://git.elder-geek.net/fredw/solar_edge.git cd solar_edge cp env.sample .env direnv allow pip install -r requirements.txt

edit .env and update accordingly

add to user crontab to update site every 5 minutes 05 * * * * cd ~/python/solar_edge && direnv exec . python solar_edge.py > /dev/null 2>&1