This Streamlit application provides a comprehensive tool for analyzing your electricity consumption, comparing different tariff options (flexible vs. static), simulating the impact of peak load shifting, and gaining insights into your energy usage patterns.
The dashboard allows users to upload their historical electricity consumption data (typically in CSV format) and compare the cost-effectiveness of various electricity tariffs. It fetches real-time EPEX spot prices for a selected country and overlays them with your consumption data. Key features include identifying the cheapest available tariffs, simulating savings through peak load shifting, and visualizing detailed consumption breakdowns and price trends.
Easily upload your historical electricity consumption data via a CSV file. The application supports parsing common formats for providers and can be extended for others.
- Automatic Cheapest Tariff Detection: Automatically identifies the most economical predefined flexible and static tariffs based on your uploaded consumption data.
- Custom Tariff Configuration: Allows users to define their own flexible and static tariffs by specifying on-top prices, variable percentages, and monthly fees.
Simulate the potential cost savings achievable by shifting a configurable percentage of your peak electricity consumption to off-peak hours within a flexible time window.
- Spot Price Analysis:
- Visualize the distribution of EPEX spot prices over time (hourly, weekly, or monthly).
- Analyze average spot prices through an interactive heatmap showing daily and seasonal patterns.
- Cost Comparison:
- Compare total electricity costs and the effective price per kWh for different tariffs over daily, weekly, or monthly periods.
- Review a detailed table summarizing consumption, costs, and savings.
- Usage Pattern Analysis:
- Classify your hourly consumption into
Base Load,Regular Load, andPeak Loadbased on dynamic thresholds. - Understand the contribution of each load type to your total consumption and their associated average prices.
- Visualize consumption patterns with a daily breakdown for a selected example day.
- Classify your hourly consumption into
- Yearly Summary:
- Provides an aggregated overview of total consumption and costs for each year present in your data.
- Download Data:
- Export the detailed analysis results and raw EPEX spot price data in XLSX format for further offline analysis.
Receive data-driven recommendations on which tariff type (flexible or static) is likely to be more cost-effective for your usage profile, along with optimization tips.
Option to exclude days with unusually low consumption, improving the accuracy of baseline analysis and recommendations.
- Clone the Repository
git clone <repository_url>
cd your-repository-directory- Install Dependencies
Ensure you have Python and Conda (Anaconda or Miniconda) installed. Then, install the required libraries:
conda env create -f environment.yml- Run the Application
Launch the Streamlit application from your terminal:
streamlit run app.py- Upload Consumption Data
In the sidebar of the application, use the "Upload Your Consumption CSV" button to upload your electricity usage data. For best results, ensure your data is in hourly or 15-minute intervals.
- Configure Settings
- Country: Select the country for which EPEX spot prices should be fetched (e.g., Germany, Austria).
- Analysis Period: Define the start and end dates for your analysis.
- Tariff Plans: Choose to automatically compare the cheapest predefined tariffs or manually configure your own flexible and static tariff details.
- Peak Load Shifting: Adjust the slider to simulate shifting a percentage of your peak consumption.
- Explore Insights
Navigate through the different tabs ("Spot Price Analysis", "Cost Comparison", "Usage Pattern Analysis", "Yearly Summary", "Download Data") to view detailed charts, tables, and recommendations.
- Consumption Data: A CSV file containing your electricity consumption. Key columns expected are a timestamp and a consumption value (e.g.,
consumption_kwh). The application is designed to be flexible with data granularity, but 15-minute intervals provide richer insights for usage pattern analysis. In case of any uncertainties please refer to the documentation in awattar backtesting. - Spot Prices: The application automatically fetches hourly EPEX spot prices from the aWATTar API for the selected country and date range. These prices are cached locally to optimize performance.
app.py: The main script orchestrating the Streamlit application flow, loading modules, and rendering the UI.methods/: Contains all supporting Python modules.config.py: Stores application-wide constants, configurations, and API-related settings.data_loader.py: Manages fetching EPEX spot prices from the aWATTar API and processing user-uploaded consumption data. Includes caching mechanisms.analysis.py: Implements the core analytical logic, including consumption classification (base, peak, regular) and peak load shifting simulation.ui_components.py: Handles the creation and rendering of all user interface elements, including sidebars, tabs, charts, and user inputs.tariffs.py: Defines theTariffclass andTariffManagerfor managing and calculating costs associated with different tariff structures.utils.py: Contains general utility functions used across the application (e.g., date handling, file export).file_parser.py: Houses theConsumptionDataParserclass responsible for parsing various CSV formats of consumption data. Interacts with awattar backtesting to use the exisitng javascript parsing logic.charts.py: Provides custom functions for generating specific plot types used in the dashboard.
This project was influenced by and extends the functionality presented in the awattar backtesting project, providing a more detailed and user-friendly interface for electricity tariff analysis.