Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Saving your small battery for peak use

  • 15-12-2023 10:02pm
    #1
    Moderators, Science, Health & Environment Moderators Posts: 4,754 Mod ✭✭✭✭


    So, we have a "small" Huawei battery (5kWh), won't be getting any more anytime soon and definitely won't be DIYing.

    In order to manage the battery, I have a few Home Assistant automations to get through the day.


    alias: Solar - keep battery for peak hours
    description: ""
    trigger:
     - platform: numeric_state
       entity_id:
         - sensor.battery_state_of_capacity
       below: 50
    condition:
     - condition: numeric_state
       entity_id: sensor.solcast_pv_forecast_forecast_remaining_today
       below: 3
     - condition: time
       before: "17:00:00"
       after: "07:01:00"
    action:
     - service: select.select_option
       data:
         option: Time Of Use
       target:
         entity_id: select.battery_working_mode
     - service: notify.mobile_app_treephone
       data:
         message: Battery saver kicked in
    
    mode: single
    

    For the automation above, it is triggered when the battery hits 50% (~2h of peak is ~ 1.3kWh in this house, the battery has a lower limit of 15%, 1.3kWh/5kWh = 0.26, 0.26 * 100 => 26% plust 15% gets 41% and some generous rounding gives 50%).

    It then checks if there's more than 3kWh predicted solar left for the rest of the day, and that it's before five (after five it doesn't really matter).

    The other piece that's important is the time of use setting. The Huawei integration lets you flip between Time Of Use (schedule that's set on your inverter), Maximise self consumption (do anything to avoid using the grid), and Fully fed to grid (as it says on the tin).

    In order to support this automation, I have the TOU configured to discharge between 17:00 (peak start) and 23:00 (when night rate kicks in), and that it does nothing otherwise (including not drawing from the battery).

    The last bit is just to notify me when it kicks in, but like, that's more for my interest and setting it up.

    Another automation sets "maximise self consumption" when the night rate ends at 7am, but that should explain itself.


    All year long, an automation checks tomorrow's solar at 22:45 and decides whether to discharge overnight or not. If it doesn't discharge overnight, the TOU includes a charge window.

    The charge SOC is set by this automation:


    alias: Battery - scale grid charge SOC according to solcast forecast
    description: ""
    trigger:
     - platform: time
       at: "02:00:00"
    condition: []
    action:
     - choose:
         - conditions:
             - condition: numeric_state
               entity_id: sensor.solcast_pv_forecast_forecast_today
               above: 15
           sequence:
             - service: number.set_value
               data:
                 value: "20"
               target:
                 entity_id: number.battery_grid_charge_cutoff_soc
         - conditions:
             - condition: numeric_state
               entity_id: sensor.solcast_pv_forecast_forecast_today
               below: input_number.solarforecastbottom
           sequence:
             - service: number.set_value
               data:
                 value: "100"
               target:
                 entity_id: number.battery_grid_charge_cutoff_soc
         - conditions:
             - condition: numeric_state
               entity_id: sensor.solcast_pv_forecast_forecast_today
               above: input_number.solarforecastbottom
               below: 15
           sequence:
             - service: number.set_value
               data:
                 value: >-
                   {{ ( (states('input_number.solarforecasttop') | float -
                   states('sensor.solcast_pv_forecast_forecast_today') |float) *
                   states('sensor.solarmultiplier') | float  ) + 20 }}
               target:
                 entity_id: number.battery_grid_charge_cutoff_soc
    mode: single
    


    At 2am it checks today's solar forecast (any minute now I'll change from pure solcase to a weighted average of it and the met eireann one).

    For reference, our daily average use is ~15kWh. The max charge is 100 and the minimum soc you can set on the battery is 20% (even though it runs down lower.

    If it's above 15 kWh it sets it to the minim SOC.

    If it's below "solarforecastbottom" (I'm not consistent about using helpers, am i?) (which happens to be 5) just fully charge the thing to 100%.

    For values in between there's a sliding scale where roughly the forecase is subtracted from the max (15), that gets multiplied by (80 / (upperlimit - lower limit) ) to make it a value between 0 and 80, and then add the 20 minium to that, and get the value to set for SOC.



    For reference, I'm running a Huawei SUN2000-6KTL-L1, with 5.5 kWp on a SSE roof, 5kWh LUNA battery. Using https://github.com/wlcrs/huawei_solar with HACS. Aim is to reduce consumption from the grid rather than to maximise ROI. Just two adults who work from home, all electric cooking, PHEV, and gas heating (which I can talk about /those/ automations elsewhere...)



Advertisement