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

Home Battery Simulation Website

  • 27-06-2025 09:58PM
    #1
    Registered Users, Registered Users 2 Posts: 2,699 ✭✭✭


    Hi all

    I was bored on Holidays and decided to do some coding (well Gemini 2.5 Pro did..) and try publish my first website…I managed to do my first "Hello World" website easy enough and anyway one thing led to another and I ended up developing a website where you can upload your historical HDF data file and simulate what a house battery would have saved you over the past year, if you don't have one. I'm quite happy with the result and I think it could be quite useful for people.

    https://homebatterycalc.netlify.app/

    Obviously this started out with a firm focus on my situation, where I have PV but no battery and I wanted to see if I had a 10, 20, 30 kWh battery how much would it save me. I totally Vibe coded this using Gemini AI over the last week, couple of hours here and there and I AM NOT A PROGRAMMER so please be gentle…

    Basically you upload your HDF file and it will analyze the last 12 months data, half hour by half hour and simulate a "what if" you had a battery. It runs two scenarios

    1. Self consumption - this is simple strategy where it tries to use as much of the solar you generate and not export anything. It will not charge the battery from the grid. People with HDFs that dont have export wont be able to run this scenario..This is crap scenario anyway but maybe if you have a big enough battery and array it might work…
    2. Export Maximiser - This is the Meta as the moment here in Ireland..To work this you set up a force charge time (the check boxes in the Tariff entry section) where it will charge the battery and after this time the battery will only discharge, it wont charge off solar. The aim is then only use this if the house is importing. It will then 2 hours out before the next charging time force discharge the battery to empty it as much as possible and getting additional FIT. You enter your MIC and MEC and how much you can charge your battery (inverter power) and it will work to these limits. I wanted to know this since I charge my car and HP so I might not have the spare capacity.

    I think its fairly if not very accurate! and the numbers its putting out are what I expected doing excel calcs myself. Have a go and let me know what you think. What is good is that you can game out multiple sizes of battery very easy just change the batt storage and press the run simulation button.

    I was able to game out NC7 systems where you have bigger MICs and MECs and bigger chargers. The beauty is it uses your actual data for the last year and for example I was able quickly run through what the savings are between a possible NC7 I'm thinking about. What I found is that Im being limited by the 6kW export with the NC6 to discharge enough to empty the battery if its too big. With the NC7 the sweet spot is 25-30kWh battery even with the NC7

    image.png

    You can review every single day over the past year, just select the month and cycle through the days.

    Red line is the simulation line and the dashed line is your actual consumption from last year.

    So you can see where the battery made the difference. There might be a slight 30 min shift, but I've been assured by Mr. Gemini its because the HDF data is consumption over the past 30mins and the graphing calculates the power to the end of the half hour period. Getting this graph to work and look good nearly took the longest time, went from bar graphs to area graphs etc so it is what it is….😎

    image.png

    As the readme says I am thinking of adding to this to simulate a PV system but that a whole new ball game where I have to possibly do API call to PVGIS.. so don't hold your breath.

    Home Battery Savings Calculator

    A browser-based tool designed to help Irish homeowners with solar PV systems estimate the potential financial savings of installing a home battery. By uploading their official ESB Networks HDF (Harmonised Data File), users can run a detailed, year-long simulation to see how a battery would have performed with their actual energy consumption and generation data.

    Features

    • Detailed HDF Parsing: Directly processes the CSV file provided by ESB Networks, ensuring the simulation is based on real-world data.
    • Customisable System Configuration: Allows users to set key technical parameters for their battery system, including:
      • Total and Usable Capacity (kWh)
      • Charge/Discharge Rate (kW)
      • Round-trip Efficiency (%)
      • Maximum Grid Import & Export (MIC/MEC)
      • Minimum/Maximum State of Charge (SoC)
    • Advanced Simulation Strategies:
      • Self-Consumption: A standard strategy that prioritises storing excess solar power to be used later in the home.
      • Export Maximiser (Tariff Optimiser): An advanced strategy that force-charges the battery from the grid during designated cheap-rate hours.
    • Flexible Tariff Options: Supports flat-rate and hourly import/export tariffs to accurately model various energy plans.
    • Comprehensive Financial Analysis: Provides clear annual summaries of:
      • Estimated Bill (Before & After Battery)
      • Total Annual Savings
      • System Payback Period
      • Self-Sufficiency Percentage
    • Interactive Data Visualisation:
      • Annual and monthly summary cards.
      • Interactive daily charts showing energy flow and battery state of charge.

    How to Use

    1. Download Your HDF File: Log in to your ESB Networks account and download your detailed Harmonised Data File (HDF) for the last 12-18 months.
    2. Open the Website https://homebatterycalc.netlify.app/
    3. Upload Your File: In Section 1, click "Choose file" and select the HDF file you downloaded.
    4. Configure Your System:
      • In Section 2, enter the technical details of the battery system you are considering. Use the info icons for help on specific terms.
      • In Section 3, choose the simulation strategy you want to model.
      • In Section 4, enter the total installed cost of the system and configure your electricity import/export tariffs. If using the "Export Maximiser" strategy, be sure to select your cheap-rate hours for force-charging.
    5. Run the Simulation: Click the "Run Simulation" button at the top of the configuration panel.
    6. Analyse the Results: Review the summary cards and interactive charts on the right-hand side to see your potential savings and energy usage patterns.

    Technical Details

    • The application is a single, self-contained index.html file with no external dependencies beyond the CDN-hosted libraries.
    • Frontend: Built with plain HTML, JavaScript, and styled with Tailwind CSS.
    • Charting: Uses Chart.js for all data visualisation.
    • Icons: Icons are provided by the Lucide icon library.
    • Client-Side Simulation: All file parsing and simulation logic runs directly in the user's browser. No data is uploaded to any server, ensuring user privacy.

    “Possible” Future Development

    • PV Simulation: The next major planned feature is to add a PV (solar panel) simulation mode. This will allow users who do not yet have solar panels to estimate their potential savings by entering their location, system size, and orientation, using the PVGIS API to generate synthetic solar data.

    Disclaimer

    This tool is intended for estimation purposes only. The financial calculations are based on the data you provide and the simulation logic. Actual savings may vary due to changes in weather, energy usage, and electricity tariffs.

    6.1kWp south facing, South of Cork City



Comments

  • Registered Users, Registered Users 2 Posts: 2,699 ✭✭✭ECO_Mental


    Meant to say if you DONT have solar you CAN use the Export Maximiser scenario…its not dependent on export as that only charges during the set forced charging times so it will work away grand. Good for people who maybe don't have roof space to put up a big array.

    Post edited by ECO_Mental on

    6.1kWp south facing, South of Cork City



  • Registered Users, Registered Users 2 Posts: 9,131 ✭✭✭10-10-20


    Well done. I'd love to know more about the process of getting this from being a script (python?) to developing a site around it. I'll spend some time looking at it next month.

    Do you have this in a github, or where do the whinges bugs/feedback go? Here? 😋



  • Registered Users, Registered Users 2 Posts: 2,699 ✭✭✭ECO_Mental


    I didn't start with any python script or anything, it was just me bored looking for a project one evening and messing with Gemini2.5. I had only set up one website before on my holidays in France a couple of weeks ago on an iPad!! just to do it as a learning experience, more a landing page than anything as I have zero programming knowledge. But I am handy enough around computers…

    Anyway I just said to Gemini I am thinking of doing a website where people can upload their consumption file and it would simulate what would happen if they had a battery…and it just started banging out code…and the first go it did was alright, so I went from there.

    Now I'm probably doing myself some injustice as there was bit of work to it, setting a github rep, linking that to a webhosting service etc etc. But I did also write small requirements documents and writing down the logic of what I wanted it to do and feed that in Gemini. Then doing UAT, looking carefully as the graphs layout etc and what it was outputting and I had a good feel for what was right and not (in the outcomes) so I had to correct it a good few times.

    As I mentioned above I totally vibe coded this…. but from the results its spitting out I think its fairly spot on and hopefully be useful to people.

    Here is the GitHub Repository and as I said Im not a programmer and only learning as a hobby so things mightn't be structured as they should but hey its working 😎.

    https://github.com/ToxicStarknova/homebatterycalculator

    6.1kWp south facing, South of Cork City



  • Registered Users, Registered Users 2 Posts: 2,699 ✭✭✭ECO_Mental


    Hi

    Just updated the app to include another graph that will help in deciding the best size battery for your house. What it does is run the simulations for every 5 KWh battery size based on your details entered. Obviously there is a point of diminishing returns where you are limited by your charging power, MIC and MEC and this will show you for the example where that is. For the graph below there no point in getting a battery over 20 kWh in this particular situation, but again play around with numbers to see.

    image.png

    6.1kWp south facing, South of Cork City



  • Registered Users, Registered Users 2 Posts: 56 ✭✭Sligobuck


    Great work, would be a great addition if there was an option to see savings for those of us on Day Night plans where we charge big batteries by night and run the home off cheap night rate (charged batteries) for most of the year.



  • Advertisement
  • Registered Users, Registered Users 2 Posts: 2,699 ✭✭✭ECO_Mental


    Let me see what I can do you, might be able to simulate it as it is…what is your strategy?

    You charge your battery at night rate, then use this until all day to cover day rate

    How big is your battery? .

    Do you force discharge before night rate or just top up when night rate comes again?

    Do you charge the battery using PV during the day if there is excess?

    6.1kWp south facing, South of Cork City



  • Registered Users, Registered Users 2 Posts: 56 ✭✭Sligobuck


    You are correct on charge strategy on Night Rate, in the summer solar keeps the batteries at a high enough charge percentage that a top up from Night Rate is only needed when we get a few days of bad weather. I have Home Assistant kicking in force charge at pre-determined states of charge during the night as and when required. Excess in good weather after self use and battery top up to 100% goes to export.

    As we move into winter this top up happens more frequently and in the worst months the batteries are charging for most of the available night rate hours.

    In answer to your last 3 questions: (1) My main battery is 56kWh. (2) I do not do any force discharging since the delta between night rate cost 14c and export credit 18c is not worth it when you factor in losses. (3) Yes PV is set to Self Use during the Day so excess PV goes into the Batteries then the rest to export.

    Bottom line is I use a big battery to avoid paying day rate at 28c and only purchase night rate at 14c. I pull almost 13 MWh from the grid per year so paying €1,820 for this at 14c because of batteries. Worst case without batteries I would probably be looking at about €2,750 on the day night plan. So a saving of say €900 a year takes about 12 years to pay for the batteries. While this may seem too long for most, for me having the backup during power cuts is worth it. The last power cut was almost 2 days during that storm and it was a gift having the house and the heat pump running off batteries during that period.

    Thanks for the response,



  • Registered Users, Registered Users 2 Posts: 2,699 ✭✭✭ECO_Mental


    wow that's a big ass battery 😎 Ill see what I can do for your situation on the app, should be easy enough to update for a bit more control. Might have a selector of when people want to force discharge(but this was causing me problems before), but I felt two hours was sufficient for most people. You are more or less a self sufficiency person but looking at it again you are more an edge case and to model your strategy might make things overly complicated in the app for now.

    Im in the middle of adding in a number of new features where you can upload also a PVGIS data file to simulate a PV system for people who don't have a PV system. Was trying to do it through an API but that was causing me trouble…

    6.1kWp south facing, South of Cork City



  • Registered Users, Registered Users 2 Posts: 56 ✭✭Sligobuck


    No need to make it more complex for me as an edge case seeing it is not straightforward, drop my request to the bottom of the pile and work on what suits the majorty, best of luck with the development 👍️



  • Registered Users, Registered Users 2 Posts: 2,630 ✭✭✭SD_DRACULA


    I was messing with the site too and I don't think it likes to see 70kwh batteries in there 🤣

    Also which HDF file does it need? kw or kwh export?



  • Advertisement
  • Registered Users, Registered Users 2 Posts: 2,699 ✭✭✭ECO_Mental


    70kWh ah! here your taking the p**s now!!😁…it uses the kWh HDF file, I will add a note to the section where the upload screen when I get a chance, to use the kWh HDF.

    It can process the 70 kWh battery no problem (sort of), But I have the app set up in that its set up to force discharge for the two hours before it starts charging again (this would clean out 95-99% of normal peoples batteries but ye freaks!!😉). With you I presume you are force discharging all day or a good few hours before you start charging again. I put in some NC7 limits also 18kW (a bit over what it should be) and a discharge of 12kw. Problem is it cant get rid of all those kWh (this is based on my HDF file)

    I did have in a very early version where you could tick boxes to force discharge at any time but it was messing up with the logic so I just hard coded the 2 hours.

    image.png image.png

    6.1kWp south facing, South of Cork City



  • Registered Users, Registered Users 2 Posts: 2,699 ✭✭✭ECO_Mental


    @SD_DRACULA @Sligobuck Just thinking about you guys cutting the lawn this evening and how to reflect your systems and I came to the realization it cant be done!!

    Reason why, is your system is already in place…You consumption profile is already reflecting your load profile with the battery. If you enter 70 kWh of battery its going to add 70kWh to your load profile, so you are simulating a charging profile of 140 kWh of battery….

    What it will do for you is game out if you want to expand…if you want to add another 15kWh on top of the the 70 or 56kWh kWh, do you have enough head room what is the payback on that considering your load profiles are minimal as it is.

    Need to add some text on a landing page to clarify this that this tool is for people without a battery, or people who are looking to add to their existing system.

    6.1kWp south facing, South of Cork City



  • Registered Users, Registered Users 2 Posts: 2,630 ✭✭✭SD_DRACULA


    Just set the payback to 3 months for each pack for us and call it a day 😂



Advertisement