Init
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NetDaemon.Extensions.Mqtt" Version="26.3.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\HomeAssistant.Models\HomeAssistant.Models.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,25 @@
|
||||
using HomeAssistant.Models;
|
||||
using NetDaemon.Extensions.MqttEntityManager;
|
||||
|
||||
namespace PowerMonitor.Models;
|
||||
|
||||
public sealed class PowerMonitorEntity : EntityCreateModel
|
||||
{
|
||||
public string Domain { get; }
|
||||
public string Identifier { get; }
|
||||
public string Name { get; }
|
||||
|
||||
public PowerMonitorEntity(string domain, string identifier, string name)
|
||||
{
|
||||
Domain = domain;
|
||||
Identifier = identifier;
|
||||
EntityId = $"{Domain}.{Identifier}";
|
||||
Name = string.IsNullOrWhiteSpace(name) ? identifier : name;
|
||||
|
||||
Options = new EntityCreationOptions
|
||||
{
|
||||
UniqueId = EntityId,
|
||||
Name = Name
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
namespace PowerMonitor.Models;
|
||||
|
||||
public static class PowerSensorConfig
|
||||
{
|
||||
public const string TotalHomePowerEntityId = "sensor.sonoff_100267d63f_power";
|
||||
|
||||
public const string OtherPowerUsageEntityId = "sensor.other_power_usage";
|
||||
|
||||
public static IReadOnlyList<string> MonitoredSensorEntityIds { get; } =
|
||||
[
|
||||
"sensor.sonoff_1002230e32_power",
|
||||
"sensor.sonoff_10018909cb_power",
|
||||
"sensor.sonoff_100215c534_power",
|
||||
"sensor.sonoff_100222f7be_power",
|
||||
"sensor.sonoff_100222ff36_power",
|
||||
"sensor.sonoff_100222ff63_power",
|
||||
"sensor.sonoff_1002230a48_power",
|
||||
"sensor.sonoff_100255ead8_power",
|
||||
"sensor.sonoff_100255f06c_power",
|
||||
"sensor.sonoff_100255f738_power",
|
||||
"sensor.sonoff_10025606e6_power",
|
||||
"sensor.sonoff_10025609ce_power",
|
||||
"sensor.sonoff_s60zbtpf_power",
|
||||
"sensor.sonoff_s60zbtpf_power_2",
|
||||
"sensor.akvariumas_power",
|
||||
"sensor.balkony_laps_power",
|
||||
"sensor.christmas_lights_power_usage",
|
||||
"sensor.dishwasher_power",
|
||||
"sensor.fridge_power",
|
||||
"sensor.temp_power",
|
||||
"sensor.tv_power"
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user