Helios is a console application designed to import energy measurement data into a database.
Represents total solar panel output in kilowatt hours at a given hour.
classDiagram
class SolarPanelOutput {
-DateTimeOffset Time
-double KWh
+ToString(): string
+Equals(obj: obj): bool
+GetHashCode(): int
}
Represents measurements of household energy production or consumption at a given hour. Production is the electricity produced that was not used by the household. Consumption is the gross electricity consumption of the household. Production is substracted from Consumption by the electricity company and net consumption is billed to the household.
If production is more than consumption, the excess energy was fed back to the grid and sold.
classDiagram
class HouseholdEnergyReading {
-DateTimeOffset Time
-double Production
-double Consumption
+ToString(): string
+Equals(obj: obj): bool
+GetHashCode(): int
}
Represents the price of electricity at a given hour. The price is in Euro cents per kilowatt hour.
classDiagram
class ElectricitySpotPrice {
-DateTimeOffset Time
-decimal EuroCentsPerKWh
+ToString(): string
+Equals(obj: obj): bool
+GetHashCode(): int
}
Helios uses SQLite database to store energy measurements. The application will create a database if it does not exist and run any missing migrations.
erDiagram
SolarPanelOutput {
TEXT Time
REAL KWh
}
HouseholdEnergyReading {
TEXT Time
REAL Production
REAL Consumption
}
ElectricitySpotPrice {
TEXT Time
TEXT EuroCentsPerKWh
}
When making changes to the database schema, the following steps need to be taken:
- Install
dotnet-ef
tool usingdotnet tool install --global dotnet-ef
command - Add a new migration using
dotnet ef migrations add [name] --project ../Helios.Migrations
command insrc/Helios.Core
directory - Apply all migrations using
dotnet ef database update
command insrc/Helios.Core
directory
- Clone the repo
- Initialize user secrets using
dotnet user-secrets init
command insrc/Helios.Core
directory - Add required secrets with
dotnet user-secrets set "[key]" "[value]"
command. For example:dotnet user-secrets set "FusionSolar:Username" "testUser"
- Build the solution using
dotnet build
command in project root directory - Run
dotnet publish --configuration Release --runtime osx-arm64 --self-contained true -p:PublishSingleFile=true -p:DebugType=none
insrc/Helios.Console
directory to publish a single file executable for Apple Silicon
FusionSolar {
Username = testUser
Password = testPass
StationCode = Station123
}
When running the application in production, the following environment variables must be set:
FUSIONSOLAR__USERNAME
FUSIONSOLAR__PASSWORD
FUSIONSOLAR__STATIONCODE
ENTSOE__SECURITYTOKEN
FINGRID__SITEIDENTIFIERS_PRODUCTION
FINGRID__SITEIDENTIFIERS_CONSUMPTION