hif2k1 / battery_sim

Home assistant home battery simulator - allows you to model how much energy you would save with a home battery
106 stars 13 forks source link

Support for charging at lower rates, and at certain times e.g. overnight (feature request) #17

Closed andynash closed 1 year ago

andynash commented 2 years ago

Thanks for this really handy tool - it will only become more useful as energy prices rise and more people consider solar and batteries.

A big part of making the case for the battery, as well as storing excess solar, would be to charge the battery overnight from the grid on lower rate tariffs. As an example, in the UK import costs from April are set to be £0.30/kWh, but only e.g. £0.075 at the lower rate, say between midnight and 4am. This power can then be used during the day rather than importing from the grid.

It would also be great to specify hours during which the battery would charge itself, as well as any optional reserved capacity you wish to specify (e.g. leave 2kW to collect excess solar in the morning, but could be zero).

Further, requesting the battery to charge when a sensor is marked true would allow for flexible integration with other systems, e.g. 'Agile' tariffs based on the wholesale rate. A template sensor can then be created based on whatever rules a user wishes, such as when the Agile rate drops below a certain price (which could be at any time of day, e.g. when very windy). Tonight (with a storm approaching, and thus plenty of - probably too much - wind power available in the UK) the Octopus Agile HA integration tells me rates will drop as low as £0.0008 per kWh for example, and there are several hours during which it would make sense to charge the battery.

In addition, you may want to charge from the grid at other (higher rate) times, e.g. to ensure the battery always has enough charge to cover brownouts, so would be handy to be able to specify a minimum charge, perhaps at certain times of the day (e.g. if solar hasn't produced enough to reach this minimum, charge between 5pm and 7pm).

hif2k1 commented 2 years ago

Thanks for the ideas, they are really good. Hopefully in the future we can work on some of these.

hif2k1 commented 1 year ago

I've just pushed an update which has an override charging switch. If you create an automation to switch this on when you want the battery to charge up it should work I think. Let me know any feedback. I've reorganised the code now so it'll be a lot easier to adjust this than it was to create the feature. Many thanks

hif2k1 commented 1 year ago

Sorry I think it got renamed to force charge for consistency with the new force discharge option.

On Sun, 9 Oct 2022, 17:49 Herbert Riess, @.***> wrote:

Hi - after the last upgrade to 1.061 the "overide_charge" (sic!; full EntityID in my case is "switch.battery_sim_15_0_kwh_battery_overide_charging") entity is no longer being provided by the battery_sim integration.

Is there a manual step I need to complete after the upgrade?

— Reply to this email directly, view it on GitHub https://github.com/hif2k1/battery_sim/issues/17#issuecomment-1272582355, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFAIZGKJZUAMHPSKK4QOBKLWCLZSFANCNFSM5OSMW7QQ . You are receiving this because you modified the open/close state.Message ID: @.***>