Update
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
@code {
|
||||
[Parameter] public ReplayDataSeries? DataSeries { get; set; }
|
||||
|
||||
private List<ReplayDataPoint> PowerData => DataSeries?.GetSeries("Boiler", "PowerWatts").ToList() ?? [];
|
||||
private List<ReplayDataPoint> BudgetData => DataSeries?.GetSeries("Boiler", "BudgetPercent").ToList() ?? [];
|
||||
private List<ReplayDataPoint> SwitchData => DataSeries?.GetSeries("Boiler", "SwitchState").ToList() ?? [];
|
||||
|
||||
private ApexChartOptions<ReplayDataPoint> ChartOptions => new()
|
||||
{
|
||||
Chart = new Chart { Background = "transparent", ForeColor = "#adb5bd" },
|
||||
Theme = new Theme { Mode = Mode.Dark },
|
||||
Stroke = new Stroke { Width = 2 },
|
||||
Xaxis = new XAxis { Type = XAxisType.Datetime },
|
||||
Yaxis =
|
||||
[
|
||||
new YAxis { Title = new AxisTitle { Text = "Watts" }, SeriesName = "Power (W)", DecimalsInFloat = 0 },
|
||||
new YAxis { Title = new AxisTitle { Text = "%" }, SeriesName = "Budget %", Opposite = true, Max = 100, DecimalsInFloat = 0 }
|
||||
],
|
||||
Tooltip = new Tooltip { X = new TooltipX { Format = "HH:mm" } },
|
||||
Grid = new Grid { BorderColor = "#343a40" }
|
||||
};
|
||||
}
|
||||
|
||||
@if (PowerData.Count > 0)
|
||||
{
|
||||
<ApexChart TItem="ReplayDataPoint" Options="ChartOptions" Height="300">
|
||||
<ApexPointSeries TItem="ReplayDataPoint"
|
||||
Items="PowerData"
|
||||
SeriesType="SeriesType.Area"
|
||||
Name="Power (W)"
|
||||
XValue="p => p.Timestamp.ToLocalTime().DateTime"
|
||||
YValue="p => (decimal)p.Value" />
|
||||
<ApexPointSeries TItem="ReplayDataPoint"
|
||||
Items="BudgetData"
|
||||
SeriesType="SeriesType.Line"
|
||||
Name="Budget %"
|
||||
XValue="p => p.Timestamp.ToLocalTime().DateTime"
|
||||
YValue="p => (decimal)p.Value" />
|
||||
</ApexChart>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="text-muted text-center py-4">No boiler data available</div>
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
@code {
|
||||
[Parameter] public ReplayTimeline? Timeline { get; set; }
|
||||
|
||||
private IReadOnlyList<ReplayEvent> LightEvents =>
|
||||
Timeline?.GetEventsByMonitor("Light") ?? [];
|
||||
}
|
||||
|
||||
<div class="card bg-dark">
|
||||
<div class="card-body">
|
||||
@if (LightEvents.Count > 0)
|
||||
{
|
||||
<div class="d-flex flex-column gap-2">
|
||||
@foreach (var evt in LightEvents)
|
||||
{
|
||||
var iconClass = evt.EventType == ReplayEventType.Decision ? "text-warning" : "text-muted";
|
||||
var icon = evt.EventType == ReplayEventType.Decision ? "☀" : "•";
|
||||
<div class="d-flex align-items-start gap-2">
|
||||
<span class="font-monospace small text-nowrap">@evt.Timestamp.ToLocalTime().ToString("HH:mm")</span>
|
||||
<span class="@iconClass">@((MarkupString)icon)</span>
|
||||
<span class="small">@evt.Message</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="text-muted text-center py-4">No light events</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,32 @@
|
||||
@code {
|
||||
[Parameter] public ReplayDataSeries? DataSeries { get; set; }
|
||||
|
||||
private List<ReplayDataPoint> PriceData => DataSeries?.GetSeries("NordPool", "Price").ToList() ?? [];
|
||||
|
||||
private ApexChartOptions<ReplayDataPoint> ChartOptions => new()
|
||||
{
|
||||
Chart = new Chart { Background = "transparent", ForeColor = "#adb5bd" },
|
||||
Theme = new Theme { Mode = Mode.Dark },
|
||||
Stroke = new Stroke { Curve = Curve.Smooth, Width = 2 },
|
||||
Xaxis = new XAxis { Type = XAxisType.Datetime },
|
||||
Yaxis = [new YAxis { Title = new AxisTitle { Text = "ct/kWh" }, DecimalsInFloat = 2 }],
|
||||
Tooltip = new Tooltip { X = new TooltipX { Format = "HH:mm" } },
|
||||
Grid = new Grid { BorderColor = "#343a40" }
|
||||
};
|
||||
}
|
||||
|
||||
@if (PriceData.Count > 0)
|
||||
{
|
||||
<ApexChart TItem="ReplayDataPoint" Options="ChartOptions" Height="300">
|
||||
<ApexPointSeries TItem="ReplayDataPoint"
|
||||
Items="PriceData"
|
||||
SeriesType="SeriesType.Area"
|
||||
Name="Price (ct/kWh)"
|
||||
XValue="p => p.Timestamp.ToLocalTime().DateTime"
|
||||
YValue="p => (decimal)p.Value" />
|
||||
</ApexChart>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="text-muted text-center py-4">No price data available</div>
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
@code {
|
||||
[Parameter] public ReplayDataSeries? DataSeries { get; set; }
|
||||
|
||||
private List<ReplayDataPoint> TotalData => DataSeries?.GetSeries("Power", "TotalPower").ToList() ?? [];
|
||||
private List<ReplayDataPoint> KnownData => DataSeries?.GetSeries("Power", "KnownDevices").ToList() ?? [];
|
||||
private List<ReplayDataPoint> OtherData => DataSeries?.GetSeries("Power", "OtherPower").ToList() ?? [];
|
||||
|
||||
private ApexChartOptions<ReplayDataPoint> ChartOptions => new()
|
||||
{
|
||||
Chart = new Chart { Background = "transparent", ForeColor = "#adb5bd", Stacked = true },
|
||||
Theme = new Theme { Mode = Mode.Dark },
|
||||
Stroke = new Stroke { Width = 1 },
|
||||
Xaxis = new XAxis { Type = XAxisType.Datetime },
|
||||
Yaxis = [new YAxis { Title = new AxisTitle { Text = "Watts" }, DecimalsInFloat = 0 }],
|
||||
Tooltip = new Tooltip { X = new TooltipX { Format = "HH:mm:ss" } },
|
||||
Grid = new Grid { BorderColor = "#343a40" }
|
||||
};
|
||||
}
|
||||
|
||||
@if (TotalData.Count > 0)
|
||||
{
|
||||
<ApexChart TItem="ReplayDataPoint" Options="ChartOptions" Height="300">
|
||||
<ApexPointSeries TItem="ReplayDataPoint"
|
||||
Items="KnownData"
|
||||
SeriesType="SeriesType.Area"
|
||||
Name="Known Devices"
|
||||
XValue="p => p.Timestamp.ToLocalTime().DateTime"
|
||||
YValue="p => (decimal)p.Value" />
|
||||
<ApexPointSeries TItem="ReplayDataPoint"
|
||||
Items="OtherData"
|
||||
SeriesType="SeriesType.Area"
|
||||
Name="Other Power"
|
||||
XValue="p => p.Timestamp.ToLocalTime().DateTime"
|
||||
YValue="p => (decimal)p.Value" />
|
||||
</ApexChart>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="text-muted text-center py-4">No power data available</div>
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
@code {
|
||||
[Parameter] public ReplayDataSeries? DataSeries { get; set; }
|
||||
|
||||
private List<ReplayDataPoint> BathroomData => DataSeries?.GetSeries("Shower", "BathroomHumidity").ToList() ?? [];
|
||||
private List<ReplayDataPoint> HomeData => DataSeries?.GetSeries("Shower", "HomeHumidity").ToList() ?? [];
|
||||
private List<ReplayDataPoint> DiffData => DataSeries?.GetSeries("Shower", "Differential").ToList() ?? [];
|
||||
|
||||
private ApexChartOptions<ReplayDataPoint> ChartOptions => new()
|
||||
{
|
||||
Chart = new Chart { Background = "transparent", ForeColor = "#adb5bd" },
|
||||
Theme = new Theme { Mode = Mode.Dark },
|
||||
Stroke = new Stroke { Curve = Curve.Smooth, Width = 2 },
|
||||
Xaxis = new XAxis { Type = XAxisType.Datetime },
|
||||
Yaxis = [new YAxis { Title = new AxisTitle { Text = "Humidity %" }, DecimalsInFloat = 1 }],
|
||||
Tooltip = new Tooltip { X = new TooltipX { Format = "HH:mm" } },
|
||||
Grid = new Grid { BorderColor = "#343a40" }
|
||||
};
|
||||
}
|
||||
|
||||
@if (BathroomData.Count > 0)
|
||||
{
|
||||
<ApexChart TItem="ReplayDataPoint" Options="ChartOptions" Height="300">
|
||||
<ApexPointSeries TItem="ReplayDataPoint"
|
||||
Items="BathroomData"
|
||||
SeriesType="SeriesType.Line"
|
||||
Name="Bathroom Humidity"
|
||||
XValue="p => p.Timestamp.ToLocalTime().DateTime"
|
||||
YValue="p => (decimal)p.Value" />
|
||||
<ApexPointSeries TItem="ReplayDataPoint"
|
||||
Items="HomeData"
|
||||
SeriesType="SeriesType.Line"
|
||||
Name="Home Humidity"
|
||||
XValue="p => p.Timestamp.ToLocalTime().DateTime"
|
||||
YValue="p => (decimal)p.Value" />
|
||||
<ApexPointSeries TItem="ReplayDataPoint"
|
||||
Items="DiffData"
|
||||
SeriesType="SeriesType.Area"
|
||||
Name="Differential"
|
||||
XValue="p => p.Timestamp.ToLocalTime().DateTime"
|
||||
YValue="p => (decimal)p.Value" />
|
||||
</ApexChart>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="text-muted text-center py-4">No shower data available</div>
|
||||
}
|
||||
Reference in New Issue
Block a user