ignore pv watts in inverter status response
This commit is contained in:
parent
eb62dc454d
commit
39b57cd4c4
@ -403,6 +403,7 @@
|
||||
|
||||
private void UpdateLocalSetting(Setting settingName, byte value)
|
||||
{
|
||||
// ReSharper disable once SwitchStatementMissingSomeEnumCasesNoDefault
|
||||
switch (settingName)
|
||||
{
|
||||
case Setting.OutputPriority:
|
||||
|
||||
@ -14,12 +14,12 @@ public class Endpoint : Endpoint<Shared.Models.SetSetting, bool>
|
||||
|
||||
public override async Task HandleAsync(Shared.Models.SetSetting r, CancellationToken c)
|
||||
{
|
||||
// if (Env.IsDevelopment())
|
||||
// {
|
||||
// await SendAsync(true, cancellation: c);
|
||||
//
|
||||
// return;
|
||||
// }
|
||||
if (Env.IsDevelopment())
|
||||
{
|
||||
await SendAsync(true, cancellation: c);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@ -77,7 +77,7 @@ public sealed class FelicitySolarInverter
|
||||
Status.BatteryChargeWatts = disPow.IsDischarge is false ? disPow.PositiveValue : 0;
|
||||
|
||||
Status.OutputVoltage = Math.Round(regs[16] / 10.0, 0); // 0x1111: AC output voltage (offset 0x1111 - 0x1101 = 16)
|
||||
Status.GridVoltage = Convert.ToInt16(regs[22] / 10.0); // 0x1111: AC output voltage (offset 0x1117 - 0x1101 = 22)
|
||||
Status.GridVoltage = Convert.ToInt32(regs[22] / 10.0); // 0x1111: AC output voltage (offset 0x1117 - 0x1101 = 22)
|
||||
Status.LoadWatts = regs[29]; // 0x111E: AC output active power (offset 0x111E - 0x1101 = 29)
|
||||
Status.LoadPercentage = regs[31]; // 0x1120: Load percentage (offset 0x1120 - 0x1101 = 31)
|
||||
Status.PVInputVoltage = Math.Round(regs[37] / 10.0, 0); // 0x1126: PV input voltage (offset 0x1126 - 0x1101 = 37)
|
||||
|
||||
@ -13,7 +13,7 @@ public enum Setting
|
||||
BackToBattery = 9
|
||||
}
|
||||
|
||||
public enum WorkingMode
|
||||
public enum WorkingMode : short
|
||||
{
|
||||
POWER = 0,
|
||||
STANDBY = 1,
|
||||
|
||||
@ -69,18 +69,18 @@ public class InverterStatus
|
||||
|
||||
pvInputWatt = value;
|
||||
var interval = (DateTime.Now - pvInputWattHourLastComputed).TotalSeconds;
|
||||
PVInputWattHour += Math.Round(value / (3600 / interval), 2);
|
||||
PVInputWattHour += value / (3600 / interval);
|
||||
pvInputWattHourLastComputed = DateTime.Now;
|
||||
}
|
||||
}
|
||||
|
||||
[JsonPropertyName("t")]
|
||||
[JsonIgnore]
|
||||
public double PVInputWattHour { get; private set; }
|
||||
|
||||
[JsonPropertyName("u")]
|
||||
[JsonPropertyName("t")]
|
||||
public int PV_MaxCapacity { get; set; }
|
||||
|
||||
[JsonPropertyName("v")]
|
||||
[JsonPropertyName("u")]
|
||||
public int PVPotential => PVInputWatt > 0 ? Convert.ToInt32(Convert.ToDouble(PVInputWatt) / PV_MaxCapacity * 100) : 0;
|
||||
|
||||
int pvInputWatt;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user