PowerPi is a Python application that monitors electricity prices and automatically enables a charger when prices are low.
-
Fetches Electricity Prices: Every 5 minutes, the program connects to a Strømligning API to get the current electricity price per kWh.
-
Retrieves Configuration: It gets your personal settings from Boardom Dashboard. These settings are Electricity Company and Max Price/kwh
-
Compares Prices: It compares the current electricity price against your configured maximum price.
-
Controls the Charger: If the electricity price is below your threshold, it enables the charger. Otherwise, it keeps it disabled.
-
Caches Data: It stores the latest price information in a cache file for reference.
-
Logs Everything: The program provides detailed logs of what it's doing, so you can monitor its activity.
This program requires a config.py file in the same directory with the following:
USER_ID = "your_user_id"
ADMIN_KEY = "your_admin_key"
HOSTNAME = "your_hostname"
AUDIENCE = "your_audience"
OLD_JTI = "your_old_jti"
SCOPES = ["scope0", "scope1"]
SERVICE = "your_service"