feat: migrate boiler control implementation to BoilerMonitor namespace and add budget handling logic

This commit is contained in:
Marius
2026-03-24 15:29:59 +02:00
parent c4015277a3
commit 11c2574235
61 changed files with 3250 additions and 728 deletions
@@ -0,0 +1,67 @@
namespace BoilerMonitor.Models;
public static class BoilerMonitorConsts
{
public const int DefaultPollIntervalSeconds = 30;
/// <summary>
/// Power threshold in watts below which the boiler is considered to have finished heating (water ready).
/// Also used as the default threshold above which the boiler is considered actively heating.
/// </summary>
public const double DefaultHeatingPowerThresholdWatts = 5.0;
/// <summary>
/// Grace period after the boiler switch is turned on, during which
/// low power readings are ignored for "water ready" detection.
/// This prevents false positives caused by the heating element ramp-up delay.
/// </summary>
public static readonly TimeSpan WarmUpGracePeriod = TimeSpan.FromMinutes(2);
/// <summary>
/// Cooldown period after the water has been detected as ready,
/// during which the boiler will not be turned back on.
/// This prevents wasteful on/off cycling when water is already heated.
/// </summary>
public static readonly TimeSpan WaterReadyCooldownPeriod = TimeSpan.FromHours(1);
public const int MinPollIntervalSeconds = 5;
public const int MaxPollIntervalSeconds = 300;
public const int PollIntervalStepSeconds = 5;
public const double MinHeatingThresholdWatts = 1.0;
public const double MaxHeatingThresholdWatts = 100.0;
public const double HeatingThresholdStepWatts = 0.5;
public const string ConfigPowerEntityId = "text.boilermonitor_config_power_entity_id";
public const string ConfigSwitchEntityId = "text.boilermonitor_config_switch_entity_id";
public const string ConfigPollIntervalEntityId = "number.boilermonitor_config_poll_interval";
public const string ConfigHeatingThresholdEntityId = "number.boilermonitor_config_heating_threshold";
public const string CleanupButtonEntityId = "button.boilermonitor_cleanup";
public const string StatusEntityId = "sensor.boilermonitor_status";
public const string WaterReadyEntityId = "sensor.boilermonitor_water_ready";
public const string SkipPriceCapEntityId = "switch.boilermonitor_skip_price_cap";
public const string TodayRuntimeEntityId = "sensor.boilermonitor_today_runtime";
public const string RemainingTimeEntityId = "sensor.boilermonitor_remaining_time";
public const string BudgetPercentageEntityId = "sensor.boilermonitor_budget_percentage";
public const string BudgetExhaustedEntityId = "binary_sensor.boilermonitor_budget_exhausted";
public const string SessionCountEntityId = "sensor.boilermonitor_session_count";
public const string BudgetOverrideEntityId = "switch.boilermonitor_budget_override";
public const string NordPoolCheapestIntervalsEntityId = "sensor.nordpool_cheapest_intervals";
public const string BoilerDailyHoursEntityId = "input_number.boiler_daily_hours";
public const string BoilerPriceCapEntityId = "input_number.boiler_price_cap";
public const string BoilerReadyByEntityId = "input_datetime.boiler_ready_by";
public const string StatusConfigured = "configured";
public const string StatusAwaitingConfiguration = "awaiting_configuration";
public const string StatusCleanedUp = "cleaned_up";
public const string SwitchOnState = "on";
public const string DeviceIdentifier = "boiler_monitor";
public const string DeviceName = "Boiler Monitor";
public const string DeviceManufacturer = "HomeAssistant App Daemon";
}