diff --git a/Plugins.Modbus/Plugins.Modbus.csproj b/Plugins.Modbus/Plugins.Modbus.csproj
index beb2c49a5..ef3783f2e 100644
--- a/Plugins.Modbus/Plugins.Modbus.csproj
+++ b/Plugins.Modbus/Plugins.Modbus.csproj
@@ -12,7 +12,7 @@
-
+
diff --git a/Plugins.SmaEnergymeter/Plugins.SmaEnergymeter.csproj b/Plugins.SmaEnergymeter/Plugins.SmaEnergymeter.csproj
index 22aa752a3..0eb3832ff 100644
--- a/Plugins.SmaEnergymeter/Plugins.SmaEnergymeter.csproj
+++ b/Plugins.SmaEnergymeter/Plugins.SmaEnergymeter.csproj
@@ -13,7 +13,7 @@
-
+
diff --git a/Plugins.SolarEdge/Plugins.SolarEdge.csproj b/Plugins.SolarEdge/Plugins.SolarEdge.csproj
index 4038113a4..a9fa7e1ef 100644
--- a/Plugins.SolarEdge/Plugins.SolarEdge.csproj
+++ b/Plugins.SolarEdge/Plugins.SolarEdge.csproj
@@ -11,7 +11,7 @@
-
+
diff --git a/Plugins.Solax/Plugins.Solax.csproj b/Plugins.Solax/Plugins.Solax.csproj
index c7200d080..7b993c2eb 100644
--- a/Plugins.Solax/Plugins.Solax.csproj
+++ b/Plugins.Solax/Plugins.Solax.csproj
@@ -10,7 +10,7 @@
-
+
diff --git a/TeslaSolarCharger.Model/Contracts/ITeslaSolarChargerContext.cs b/TeslaSolarCharger.Model/Contracts/ITeslaSolarChargerContext.cs
index d0f868a7a..a4cb94817 100644
--- a/TeslaSolarCharger.Model/Contracts/ITeslaSolarChargerContext.cs
+++ b/TeslaSolarCharger.Model/Contracts/ITeslaSolarChargerContext.cs
@@ -29,5 +29,6 @@ public interface ITeslaSolarChargerContext
DbSet MqttResultConfigurations { get; set; }
DbSet BackendNotifications { get; set; }
DbSet LoggedErrors { get; set; }
+ DbSet CarValueLogs { get; set; }
void RejectChanges();
}
diff --git a/TeslaSolarCharger.Model/Entities/TeslaSolarCharger/Car.cs b/TeslaSolarCharger.Model/Entities/TeslaSolarCharger/Car.cs
index 5ebdff73a..0e714c52d 100644
--- a/TeslaSolarCharger.Model/Entities/TeslaSolarCharger/Car.cs
+++ b/TeslaSolarCharger.Model/Entities/TeslaSolarCharger/Car.cs
@@ -49,6 +49,7 @@ public class Car
public bool UseBleForWakeUp { get; set; }
public int ApiRefreshIntervalSeconds { get; set; }
public string? BleApiBaseUrl { get; set; }
+ public bool UseFleetTelemetry { get; set; }
public string? WakeUpCalls { get; set; }
public string? VehicleDataCalls { get; set; }
@@ -59,4 +60,5 @@ public class Car
public string? OtherCommandCalls { get; set; }
public List ChargingProcesses { get; set; } = new List();
+ public List CarValueLogs { get; set; } = new List();
}
diff --git a/TeslaSolarCharger.Model/Entities/TeslaSolarCharger/CarValueLog.cs b/TeslaSolarCharger.Model/Entities/TeslaSolarCharger/CarValueLog.cs
new file mode 100644
index 000000000..fa13a7c7b
--- /dev/null
+++ b/TeslaSolarCharger.Model/Entities/TeslaSolarCharger/CarValueLog.cs
@@ -0,0 +1,20 @@
+using TeslaSolarCharger.Shared.Enums;
+
+namespace TeslaSolarCharger.Model.Entities.TeslaSolarCharger;
+
+public class CarValueLog
+{
+ public int Id { get; set; }
+ public DateTime Timestamp { get; set; }
+ public CarValueType Type { get; set; }
+ public CarValueSource Source { get; set; }
+ public double? DoubleValue { get; set; }
+ public int? IntValue { get; set; }
+ public string? StringValue { get; set; }
+ public string? UnknownValue { get; set; }
+ public bool? BooleanValue { get; set; }
+ public bool? InvalidValue { get; set; }
+
+ public int CarId { get; set; }
+ public Car Car { get; set; }
+}
diff --git a/TeslaSolarCharger.Model/EntityFramework/TeslaSolarChargerContext.cs b/TeslaSolarCharger.Model/EntityFramework/TeslaSolarChargerContext.cs
index 5f3d1c253..8289f27f5 100644
--- a/TeslaSolarCharger.Model/EntityFramework/TeslaSolarChargerContext.cs
+++ b/TeslaSolarCharger.Model/EntityFramework/TeslaSolarChargerContext.cs
@@ -30,6 +30,7 @@ public class TeslaSolarChargerContext : DbContext, ITeslaSolarChargerContext
public DbSet MqttResultConfigurations { get; set; } = null!;
public DbSet BackendNotifications { get; set; } = null!;
public DbSet LoggedErrors { get; set; } = null!;
+ public DbSet CarValueLogs { get; set; } = null!;
// ReSharper disable once UnassignedGetOnlyAutoProperty
public string DbPath { get; }
diff --git a/TeslaSolarCharger.Model/Migrations/20241016223529_AddCarValueLogs.Designer.cs b/TeslaSolarCharger.Model/Migrations/20241016223529_AddCarValueLogs.Designer.cs
new file mode 100644
index 000000000..ebd5db0b3
--- /dev/null
+++ b/TeslaSolarCharger.Model/Migrations/20241016223529_AddCarValueLogs.Designer.cs
@@ -0,0 +1,913 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using TeslaSolarCharger.Model.EntityFramework;
+
+#nullable disable
+
+namespace TeslaSolarCharger.Model.Migrations
+{
+ [DbContext(typeof(TeslaSolarChargerContext))]
+ [Migration("20241016223529_AddCarValueLogs")]
+ partial class AddCarValueLogs
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder.HasAnnotation("ProductVersion", "8.0.8");
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.BackendNotification", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("BackendIssueId")
+ .HasColumnType("INTEGER");
+
+ b.Property("DetailText")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("Headline")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("IsConfirmed")
+ .HasColumnType("INTEGER");
+
+ b.Property("Type")
+ .HasColumnType("INTEGER");
+
+ b.Property("ValidFromDate")
+ .HasColumnType("TEXT");
+
+ b.Property("ValidFromVersion")
+ .HasColumnType("TEXT");
+
+ b.Property("ValidToDate")
+ .HasColumnType("TEXT");
+
+ b.Property("ValidToVersion")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("BackendNotifications");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.CachedCarState", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("CarId")
+ .HasColumnType("INTEGER");
+
+ b.Property("CarStateJson")
+ .HasColumnType("TEXT");
+
+ b.Property("Key")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("LastUpdated")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("CachedCarStates");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.Car", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("ApiRefreshIntervalSeconds")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER")
+ .HasDefaultValue(500);
+
+ b.Property("BleApiBaseUrl")
+ .HasColumnType("TEXT");
+
+ b.Property("ChargeMode")
+ .HasColumnType("INTEGER");
+
+ b.Property("ChargeStartCalls")
+ .HasColumnType("TEXT");
+
+ b.Property("ChargeStopCalls")
+ .HasColumnType("TEXT");
+
+ b.Property("ChargerActualCurrent")
+ .HasColumnType("INTEGER");
+
+ b.Property("ChargerPhases")
+ .HasColumnType("INTEGER");
+
+ b.Property("ChargerPilotCurrent")
+ .HasColumnType("INTEGER");
+
+ b.Property("ChargerRequestedCurrent")
+ .HasColumnType("INTEGER");
+
+ b.Property("ChargerVoltage")
+ .HasColumnType("INTEGER");
+
+ b.Property("ChargingCommandsRateLimitedUntil")
+ .HasColumnType("TEXT");
+
+ b.Property("ChargingPriority")
+ .HasColumnType("INTEGER");
+
+ b.Property("ClimateOn")
+ .HasColumnType("INTEGER");
+
+ b.Property("CommandsRateLimitedUntil")
+ .HasColumnType("TEXT");
+
+ b.Property("IgnoreLatestTimeToReachSocDate")
+ .HasColumnType("INTEGER");
+
+ b.Property("IgnoreLatestTimeToReachSocDateOnWeekend")
+ .HasColumnType("INTEGER");
+
+ b.Property("LatestTimeToReachSoC")
+ .HasColumnType("TEXT");
+
+ b.Property("Latitude")
+ .HasColumnType("REAL");
+
+ b.Property("Longitude")
+ .HasColumnType("REAL");
+
+ b.Property("MaximumAmpere")
+ .HasColumnType("INTEGER");
+
+ b.Property("MinimumAmpere")
+ .HasColumnType("INTEGER");
+
+ b.Property("MinimumSoc")
+ .HasColumnType("INTEGER");
+
+ b.Property("Name")
+ .HasColumnType("TEXT");
+
+ b.Property("OtherCommandCalls")
+ .HasColumnType("TEXT");
+
+ b.Property("PluggedIn")
+ .HasColumnType("INTEGER");
+
+ b.Property("SetChargingAmpsCall")
+ .HasColumnType("TEXT");
+
+ b.Property("ShouldBeManaged")
+ .HasColumnType("INTEGER");
+
+ b.Property("SoC")
+ .HasColumnType("INTEGER");
+
+ b.Property("SocLimit")
+ .HasColumnType("INTEGER");
+
+ b.Property("State")
+ .HasColumnType("INTEGER");
+
+ b.Property("TeslaFleetApiState")
+ .HasColumnType("INTEGER");
+
+ b.Property("TeslaMateCarId")
+ .HasColumnType("INTEGER");
+
+ b.Property("UsableEnergy")
+ .HasColumnType("INTEGER");
+
+ b.Property("UseBle")
+ .HasColumnType("INTEGER");
+
+ b.Property("UseBleForWakeUp")
+ .HasColumnType("INTEGER");
+
+ b.Property("UseFleetTelemetry")
+ .HasColumnType("INTEGER");
+
+ b.Property("VehicleCalls")
+ .HasColumnType("TEXT");
+
+ b.Property("VehicleCommandProtocolRequired")
+ .HasColumnType("INTEGER");
+
+ b.Property("VehicleDataCalls")
+ .HasColumnType("TEXT");
+
+ b.Property("VehicleDataRateLimitedUntil")
+ .HasColumnType("TEXT");
+
+ b.Property("VehicleRateLimitedUntil")
+ .HasColumnType("TEXT");
+
+ b.Property("Vin")
+ .HasColumnType("TEXT");
+
+ b.Property("WakeUpCalls")
+ .HasColumnType("TEXT");
+
+ b.Property("WakeUpRateLimitedUntil")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("TeslaMateCarId")
+ .IsUnique();
+
+ b.HasIndex("Vin")
+ .IsUnique();
+
+ b.ToTable("Cars");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.CarValueLog", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("CarId")
+ .HasColumnType("INTEGER");
+
+ b.Property("DoubleValue")
+ .HasColumnType("REAL");
+
+ b.Property("IntValue")
+ .HasColumnType("INTEGER");
+
+ b.Property("Timestamp")
+ .HasColumnType("TEXT");
+
+ b.Property("Type")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CarId");
+
+ b.ToTable("CarValueLogs");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.ChargePrice", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("AddSpotPriceToGridPrice")
+ .HasColumnType("INTEGER");
+
+ b.Property("EnergyProvider")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER")
+ .HasDefaultValue(6);
+
+ b.Property("EnergyProviderConfiguration")
+ .HasColumnType("TEXT");
+
+ b.Property("GridPrice")
+ .HasColumnType("TEXT");
+
+ b.Property("SolarPrice")
+ .HasColumnType("TEXT");
+
+ b.Property("SpotPriceCorrectionFactor")
+ .HasColumnType("TEXT");
+
+ b.Property("ValidSince")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("ChargePrices");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.ChargingDetail", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("ChargerVoltage")
+ .HasColumnType("INTEGER");
+
+ b.Property("ChargingProcessId")
+ .HasColumnType("INTEGER");
+
+ b.Property("GridPower")
+ .HasColumnType("INTEGER");
+
+ b.Property("HomeBatteryPower")
+ .HasColumnType("INTEGER");
+
+ b.Property("SolarPower")
+ .HasColumnType("INTEGER");
+
+ b.Property("TimeStamp")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ChargingProcessId");
+
+ b.ToTable("ChargingDetails");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.ChargingProcess", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("CarId")
+ .HasColumnType("INTEGER");
+
+ b.Property("Cost")
+ .HasColumnType("TEXT");
+
+ b.Property("EndDate")
+ .HasColumnType("TEXT");
+
+ b.Property("OldHandledChargeId")
+ .HasColumnType("INTEGER");
+
+ b.Property("StartDate")
+ .HasColumnType("TEXT");
+
+ b.Property("UsedGridEnergyKwh")
+ .HasColumnType("TEXT");
+
+ b.Property("UsedHomeBatteryEnergyKwh")
+ .HasColumnType("TEXT");
+
+ b.Property("UsedSolarEnergyKwh")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CarId");
+
+ b.ToTable("ChargingProcesses");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.HandledCharge", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("AverageSpotPrice")
+ .HasColumnType("TEXT");
+
+ b.Property("CalculatedPrice")
+ .HasColumnType("TEXT");
+
+ b.Property("CarId")
+ .HasColumnType("INTEGER");
+
+ b.Property("ChargingProcessId")
+ .HasColumnType("INTEGER");
+
+ b.Property("UsedGridEnergy")
+ .HasColumnType("TEXT");
+
+ b.Property("UsedSolarEnergy")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("HandledCharges");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.LoggedError", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("DismissedAt")
+ .HasColumnType("TEXT");
+
+ b.Property("EndTimeStamp")
+ .HasColumnType("TEXT");
+
+ b.Property("FurtherOccurrences")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("Headline")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("IssueKey")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("Message")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("MethodName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("Source")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("StackTrace")
+ .HasColumnType("TEXT");
+
+ b.Property("StartTimeStamp")
+ .HasColumnType("TEXT");
+
+ b.Property("TelegramNotificationSent")
+ .HasColumnType("INTEGER");
+
+ b.Property("TelegramResolvedMessageSent")
+ .HasColumnType("INTEGER");
+
+ b.Property("Vin")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("LoggedErrors");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.ModbusConfiguration", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("ConnectDelayMilliseconds")
+ .HasColumnType("INTEGER");
+
+ b.Property("Endianess")
+ .HasColumnType("INTEGER");
+
+ b.Property("Host")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("Port")
+ .HasColumnType("INTEGER");
+
+ b.Property("ReadTimeoutMilliseconds")
+ .HasColumnType("INTEGER");
+
+ b.Property("UnitIdentifier")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.ToTable("ModbusConfigurations");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.ModbusResultConfiguration", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("Address")
+ .HasColumnType("INTEGER");
+
+ b.Property("BitStartIndex")
+ .HasColumnType("INTEGER");
+
+ b.Property("CorrectionFactor")
+ .HasColumnType("TEXT");
+
+ b.Property("InvertedByModbusResultConfigurationId")
+ .HasColumnType("INTEGER");
+
+ b.Property("Length")
+ .HasColumnType("INTEGER");
+
+ b.Property("ModbusConfigurationId")
+ .HasColumnType("INTEGER");
+
+ b.Property("Operator")
+ .HasColumnType("INTEGER");
+
+ b.Property("RegisterType")
+ .HasColumnType("INTEGER");
+
+ b.Property("UsedFor")
+ .HasColumnType("INTEGER");
+
+ b.Property("ValueType")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("InvertedByModbusResultConfigurationId");
+
+ b.HasIndex("ModbusConfigurationId");
+
+ b.ToTable("ModbusResultConfigurations");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.MqttConfiguration", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("Host")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("Password")
+ .HasColumnType("TEXT");
+
+ b.Property("Port")
+ .HasColumnType("INTEGER");
+
+ b.Property("Username")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("MqttConfigurations");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.MqttResultConfiguration", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("CorrectionFactor")
+ .HasColumnType("TEXT");
+
+ b.Property("MqttConfigurationId")
+ .HasColumnType("INTEGER");
+
+ b.Property("NodePattern")
+ .HasColumnType("TEXT");
+
+ b.Property("NodePatternType")
+ .HasColumnType("INTEGER");
+
+ b.Property("Operator")
+ .HasColumnType("INTEGER");
+
+ b.Property("Topic")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("UsedFor")
+ .HasColumnType("INTEGER");
+
+ b.Property("XmlAttributeHeaderName")
+ .HasColumnType("TEXT");
+
+ b.Property("XmlAttributeHeaderValue")
+ .HasColumnType("TEXT");
+
+ b.Property("XmlAttributeValueName")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("MqttConfigurationId");
+
+ b.ToTable("MqttResultConfigurations");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.PowerDistribution", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("ChargingPower")
+ .HasColumnType("INTEGER");
+
+ b.Property("GridProportion")
+ .HasColumnType("REAL");
+
+ b.Property("HandledChargeId")
+ .HasColumnType("INTEGER");
+
+ b.Property("PowerFromGrid")
+ .HasColumnType("INTEGER");
+
+ b.Property("TimeStamp")
+ .HasColumnType("TEXT");
+
+ b.Property("UsedWattHours")
+ .HasColumnType("REAL");
+
+ b.HasKey("Id");
+
+ b.HasIndex("HandledChargeId");
+
+ b.ToTable("PowerDistributions");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.RestValueConfiguration", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("HttpMethod")
+ .HasColumnType("INTEGER");
+
+ b.Property("NodePatternType")
+ .HasColumnType("INTEGER");
+
+ b.Property("Url")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("RestValueConfigurations");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.RestValueConfigurationHeader", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("Key")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("RestValueConfigurationId")
+ .HasColumnType("INTEGER");
+
+ b.Property("Value")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("RestValueConfigurationId", "Key")
+ .IsUnique();
+
+ b.ToTable("RestValueConfigurationHeaders");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.RestValueResultConfiguration", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("CorrectionFactor")
+ .HasColumnType("TEXT");
+
+ b.Property("NodePattern")
+ .HasColumnType("TEXT");
+
+ b.Property("Operator")
+ .HasColumnType("INTEGER");
+
+ b.Property("RestValueConfigurationId")
+ .HasColumnType("INTEGER");
+
+ b.Property("UsedFor")
+ .HasColumnType("INTEGER");
+
+ b.Property("XmlAttributeHeaderName")
+ .HasColumnType("TEXT");
+
+ b.Property("XmlAttributeHeaderValue")
+ .HasColumnType("TEXT");
+
+ b.Property("XmlAttributeValueName")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("RestValueConfigurationId");
+
+ b.ToTable("RestValueResultConfigurations");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.SpotPrice", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("EndDate")
+ .HasColumnType("TEXT");
+
+ b.Property("Price")
+ .HasColumnType("TEXT");
+
+ b.Property("StartDate")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("SpotPrices");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.TeslaToken", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("AccessToken")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("ExpiresAtUtc")
+ .HasColumnType("TEXT");
+
+ b.Property("IdToken")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("RefreshToken")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("Region")
+ .HasColumnType("INTEGER");
+
+ b.Property("UnauthorizedCounter")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.ToTable("TeslaTokens");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.TscConfiguration", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("Key")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("Value")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Key")
+ .IsUnique();
+
+ b.ToTable("TscConfigurations");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.CarValueLog", b =>
+ {
+ b.HasOne("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.Car", "Car")
+ .WithMany("CarValueLogs")
+ .HasForeignKey("CarId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Car");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.ChargingDetail", b =>
+ {
+ b.HasOne("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.ChargingProcess", "ChargingProcess")
+ .WithMany("ChargingDetails")
+ .HasForeignKey("ChargingProcessId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("ChargingProcess");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.ChargingProcess", b =>
+ {
+ b.HasOne("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.Car", "Car")
+ .WithMany("ChargingProcesses")
+ .HasForeignKey("CarId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Car");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.ModbusResultConfiguration", b =>
+ {
+ b.HasOne("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.ModbusResultConfiguration", "InvertedByModbusResultConfiguration")
+ .WithMany()
+ .HasForeignKey("InvertedByModbusResultConfigurationId");
+
+ b.HasOne("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.ModbusConfiguration", "ModbusConfiguration")
+ .WithMany("ModbusResultConfigurations")
+ .HasForeignKey("ModbusConfigurationId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("InvertedByModbusResultConfiguration");
+
+ b.Navigation("ModbusConfiguration");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.MqttResultConfiguration", b =>
+ {
+ b.HasOne("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.MqttConfiguration", "MqttConfiguration")
+ .WithMany("MqttResultConfigurations")
+ .HasForeignKey("MqttConfigurationId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("MqttConfiguration");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.PowerDistribution", b =>
+ {
+ b.HasOne("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.HandledCharge", "HandledCharge")
+ .WithMany("PowerDistributions")
+ .HasForeignKey("HandledChargeId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("HandledCharge");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.RestValueConfigurationHeader", b =>
+ {
+ b.HasOne("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.RestValueConfiguration", "RestValueConfiguration")
+ .WithMany("Headers")
+ .HasForeignKey("RestValueConfigurationId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("RestValueConfiguration");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.RestValueResultConfiguration", b =>
+ {
+ b.HasOne("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.RestValueConfiguration", "RestValueConfiguration")
+ .WithMany("RestValueResultConfigurations")
+ .HasForeignKey("RestValueConfigurationId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("RestValueConfiguration");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.Car", b =>
+ {
+ b.Navigation("CarValueLogs");
+
+ b.Navigation("ChargingProcesses");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.ChargingProcess", b =>
+ {
+ b.Navigation("ChargingDetails");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.HandledCharge", b =>
+ {
+ b.Navigation("PowerDistributions");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.ModbusConfiguration", b =>
+ {
+ b.Navigation("ModbusResultConfigurations");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.MqttConfiguration", b =>
+ {
+ b.Navigation("MqttResultConfigurations");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.RestValueConfiguration", b =>
+ {
+ b.Navigation("Headers");
+
+ b.Navigation("RestValueResultConfigurations");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/TeslaSolarCharger.Model/Migrations/20241016223529_AddCarValueLogs.cs b/TeslaSolarCharger.Model/Migrations/20241016223529_AddCarValueLogs.cs
new file mode 100644
index 000000000..c1bdea090
--- /dev/null
+++ b/TeslaSolarCharger.Model/Migrations/20241016223529_AddCarValueLogs.cs
@@ -0,0 +1,61 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace TeslaSolarCharger.Model.Migrations
+{
+ ///
+ public partial class AddCarValueLogs : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.AddColumn(
+ name: "UseFleetTelemetry",
+ table: "Cars",
+ type: "INTEGER",
+ nullable: false,
+ defaultValue: false);
+
+ migrationBuilder.CreateTable(
+ name: "CarValueLogs",
+ columns: table => new
+ {
+ Id = table.Column(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ Timestamp = table.Column(type: "TEXT", nullable: false),
+ Type = table.Column(type: "INTEGER", nullable: false),
+ DoubleValue = table.Column(type: "REAL", nullable: true),
+ IntValue = table.Column(type: "INTEGER", nullable: true),
+ CarId = table.Column(type: "INTEGER", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_CarValueLogs", x => x.Id);
+ table.ForeignKey(
+ name: "FK_CarValueLogs_Cars_CarId",
+ column: x => x.CarId,
+ principalTable: "Cars",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_CarValueLogs_CarId",
+ table: "CarValueLogs",
+ column: "CarId");
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "CarValueLogs");
+
+ migrationBuilder.DropColumn(
+ name: "UseFleetTelemetry",
+ table: "Cars");
+ }
+ }
+}
diff --git a/TeslaSolarCharger.Model/Migrations/20241017165607_AddStringAndUnknownValueToCarValueLogs.Designer.cs b/TeslaSolarCharger.Model/Migrations/20241017165607_AddStringAndUnknownValueToCarValueLogs.Designer.cs
new file mode 100644
index 000000000..62dfbd6d3
--- /dev/null
+++ b/TeslaSolarCharger.Model/Migrations/20241017165607_AddStringAndUnknownValueToCarValueLogs.Designer.cs
@@ -0,0 +1,919 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using TeslaSolarCharger.Model.EntityFramework;
+
+#nullable disable
+
+namespace TeslaSolarCharger.Model.Migrations
+{
+ [DbContext(typeof(TeslaSolarChargerContext))]
+ [Migration("20241017165607_AddStringAndUnknownValueToCarValueLogs")]
+ partial class AddStringAndUnknownValueToCarValueLogs
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder.HasAnnotation("ProductVersion", "8.0.8");
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.BackendNotification", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("BackendIssueId")
+ .HasColumnType("INTEGER");
+
+ b.Property("DetailText")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("Headline")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("IsConfirmed")
+ .HasColumnType("INTEGER");
+
+ b.Property("Type")
+ .HasColumnType("INTEGER");
+
+ b.Property("ValidFromDate")
+ .HasColumnType("TEXT");
+
+ b.Property("ValidFromVersion")
+ .HasColumnType("TEXT");
+
+ b.Property("ValidToDate")
+ .HasColumnType("TEXT");
+
+ b.Property("ValidToVersion")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("BackendNotifications");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.CachedCarState", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("CarId")
+ .HasColumnType("INTEGER");
+
+ b.Property("CarStateJson")
+ .HasColumnType("TEXT");
+
+ b.Property("Key")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("LastUpdated")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("CachedCarStates");
+ });
+
+ modelBuilder.Entity("TeslaSolarCharger.Model.Entities.TeslaSolarCharger.Car", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("ApiRefreshIntervalSeconds")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER")
+ .HasDefaultValue(500);
+
+ b.Property("BleApiBaseUrl")
+ .HasColumnType("TEXT");
+
+ b.Property("ChargeMode")
+ .HasColumnType("INTEGER");
+
+ b.Property("ChargeStartCalls")
+ .HasColumnType("TEXT");
+
+ b.Property("ChargeStopCalls")
+ .HasColumnType("TEXT");
+
+ b.Property("ChargerActualCurrent")
+ .HasColumnType("INTEGER");
+
+ b.Property("ChargerPhases")
+ .HasColumnType("INTEGER");
+
+ b.Property("ChargerPilotCurrent")
+ .HasColumnType("INTEGER");
+
+ b.Property("ChargerRequestedCurrent")
+ .HasColumnType("INTEGER");
+
+ b.Property("ChargerVoltage")
+ .HasColumnType("INTEGER");
+
+ b.Property("ChargingCommandsRateLimitedUntil")
+ .HasColumnType("TEXT");
+
+ b.Property("ChargingPriority")
+ .HasColumnType("INTEGER");
+
+ b.Property("ClimateOn")
+ .HasColumnType("INTEGER");
+
+ b.Property("CommandsRateLimitedUntil")
+ .HasColumnType("TEXT");
+
+ b.Property("IgnoreLatestTimeToReachSocDate")
+ .HasColumnType("INTEGER");
+
+ b.Property("IgnoreLatestTimeToReachSocDateOnWeekend")
+ .HasColumnType("INTEGER");
+
+ b.Property("LatestTimeToReachSoC")
+ .HasColumnType("TEXT");
+
+ b.Property("Latitude")
+ .HasColumnType("REAL");
+
+ b.Property("Longitude")
+ .HasColumnType("REAL");
+
+ b.Property("MaximumAmpere")
+ .HasColumnType("INTEGER");
+
+ b.Property("MinimumAmpere")
+ .HasColumnType("INTEGER");
+
+ b.Property("MinimumSoc")
+ .HasColumnType("INTEGER");
+
+ b.Property("Name")
+ .HasColumnType("TEXT");
+
+ b.Property("OtherCommandCalls")
+ .HasColumnType("TEXT");
+
+ b.Property("PluggedIn")
+ .HasColumnType("INTEGER");
+
+ b.Property("SetChargingAmpsCall")
+ .HasColumnType("TEXT");
+
+ b.Property("ShouldBeManaged")
+ .HasColumnType("INTEGER");
+
+ b.Property("SoC")
+ .HasColumnType("INTEGER");
+
+ b.Property("SocLimit")
+ .HasColumnType("INTEGER");
+
+ b.Property("State")
+ .HasColumnType("INTEGER");
+
+ b.Property("TeslaFleetApiState")
+ .HasColumnType("INTEGER");
+
+ b.Property("TeslaMateCarId")
+ .HasColumnType("INTEGER");
+
+ b.Property("UsableEnergy")
+ .HasColumnType("INTEGER");
+
+ b.Property("UseBle")
+ .HasColumnType("INTEGER");
+
+ b.Property