70 lines
2.4 KiB
C#
70 lines
2.4 KiB
C#
using BoilerMonitor.Models;
|
|
using LightMonitor.Models;
|
|
using NordPool.Models;
|
|
using ShowerMonitor.Models;
|
|
|
|
namespace HomeAssistant.HistoryReplay.Configuration;
|
|
|
|
public static class ReplayEntityMap
|
|
{
|
|
public static IReadOnlyList<string> GetNordPoolEntities() =>
|
|
[
|
|
"sensor.nordpool_kwh_lt_eur_3_10_0",
|
|
NordPoolConsts.CurrentPriceEntityId,
|
|
BoilerMonitorConsts.BoilerDailyHoursEntityId,
|
|
BoilerMonitorConsts.BoilerPriceCapEntityId,
|
|
BoilerMonitorConsts.BoilerReadyByEntityId,
|
|
BoilerMonitorConsts.SkipPriceCapEntityId
|
|
];
|
|
|
|
public static IReadOnlyList<string> GetBoilerEntities(string boilerPowerEntityId, string boilerSwitchEntityId) =>
|
|
[
|
|
boilerPowerEntityId,
|
|
boilerSwitchEntityId,
|
|
"sensor.nordpool_cheapest_intervals",
|
|
BoilerMonitorConsts.SkipPriceCapEntityId,
|
|
BoilerMonitorConsts.BudgetOverrideEntityId,
|
|
BoilerMonitorConsts.BoilerDailyHoursEntityId
|
|
];
|
|
|
|
public static IReadOnlyList<string> GetShowerEntities(string bathroomHumidityEntityId, string mainHomeHumidityEntityId) =>
|
|
[
|
|
bathroomHumidityEntityId,
|
|
mainHomeHumidityEntityId
|
|
];
|
|
|
|
public static IReadOnlyList<string> GetPowerEntities(string mainMeterEntityId) =>
|
|
[
|
|
mainMeterEntityId,
|
|
NordPoolConsts.CurrentPriceEntityId
|
|
];
|
|
|
|
public static IReadOnlyList<string> GetLightEntities(string sunEntityId, string lightEntityId, string[] personEntityIds)
|
|
{
|
|
var entities = new List<string> { sunEntityId, lightEntityId };
|
|
entities.AddRange(personEntityIds);
|
|
return entities;
|
|
}
|
|
|
|
public static IReadOnlyList<string> GetAllEntities(
|
|
string boilerPowerEntityId,
|
|
string boilerSwitchEntityId,
|
|
string bathroomHumidityEntityId,
|
|
string mainHomeHumidityEntityId,
|
|
string mainMeterEntityId,
|
|
string sunEntityId,
|
|
string lightEntityId,
|
|
string[] personEntityIds)
|
|
{
|
|
var all = new HashSet<string>();
|
|
|
|
foreach (var e in GetNordPoolEntities()) all.Add(e);
|
|
foreach (var e in GetBoilerEntities(boilerPowerEntityId, boilerSwitchEntityId)) all.Add(e);
|
|
foreach (var e in GetShowerEntities(bathroomHumidityEntityId, mainHomeHumidityEntityId)) all.Add(e);
|
|
foreach (var e in GetPowerEntities(mainMeterEntityId)) all.Add(e);
|
|
foreach (var e in GetLightEntities(sunEntityId, lightEntityId, personEntityIds)) all.Add(e);
|
|
|
|
return [.. all];
|
|
}
|
|
}
|