-
-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should I be seeing a dot moving from grid to battery when charging my battery from the grid? #109
Comments
Seeing the same issue. Also seems to include battery consumption in house consumption when charging. I see the same problem with the original card too. |
Yes, this is confusing. I expected a moving dot from grid to battery for the part that is charging. Played with the settings to fix it, but concluded eveything was setup correctly in this card. |
Ha, should have read my own comment in the discussion. It's an issue when in this situation and there is no solar. PR would be welcome. |
Yeah, of course. Thats the default answer nowadays. |
I haven't had a chance to test this yet within this card, but this code should fix it: const totalHomeConsumption = ((totalBatteryOut ?? 0) - (totalBatteryIn ?? 0)) + ((totalFromGrid ?? 0) - (totalToGrid ?? 0)) + totalSolarProduction;
let solarToBattery: null | number = null;
let solarConsumption: null | number = null;
let solarToGrid = 0;
if (hasSolarProduction) {
solarToBattery = Math.min(Math.max(0, totalBatteryIn ?? 0), totalSolarProduction);
solarConsumption = Math.min(totalSolarProduction - solarToBattery, totalHomeConsumption);
solarToGrid = totalSolarProduction - solarConsumption - solarToBattery;
}
let batteryFromGrid: null | number = null;
let batteryToGrid: null | number = null;
let batteryConsumption: number = 0;
if (hasBattery) {
batteryConsumption = Math.min(totalBatteryOut!, totalHomeConsumption - (solarConsumption ?? 0));
batteryToGrid = totalBatteryOut! + (solarToBattery ?? 0) - batteryConsumption;
batteryFromGrid = Math.max(-batteryToGrid, 0);
batteryToGrid = Math.max(batteryToGrid, 0);
}
const gridConsumption = totalHomeConsumption - (solarConsumption ?? 0) - batteryConsumption; |
Discussed in #108
Originally posted by derekyle November 11, 2022
I don't have solar panels, so I charge my battery from the grid and use it during peak power. Everything seems to be working with this card except there is no dot moving from grid to battery even though the battery shows the correct kW for power coming in or out. Is that simply a limitation of the card or do I have something setup wrong?
The text was updated successfully, but these errors were encountered: