I think I’ve managed to make Home assistant tell me how much money the solar power I’m generating would be worth from the grid, and how much running things off solar/battery instead of the grid is saving me.
I need to do further testing – it’s night, it’s hard testing solar setups when it goes dark! – but the general idea is the inverter has a “charge state” or something that is one value when taking power out the grid, and another value when taking power out the batteries/solar. It also reports the amount of load on the inverter, so I managed to get Home Assistant to tell me how many watts are being produced by the inverter when it’s not running off mains. This gets run through some integration to create a kWh figure that I can multiply by the price of my electricity.
It needs further testing to see what happens at midnight when the counter should reset. I’ll document it properly if it seems to work. Mostly it’s an exercise in using value templates, integration and some pretty graphs in the dashboard. The graphs are broken right now because I got the units wrong and everything is scaled incorrectly. Also I was trying to be clever and also count the energy cost for charging the batteries off the mains, but the smart plug I’m using seems to report incorrect values that are 1,000W off!
I can fix that by flashing the plug with Tasmota which is an upcoming video at some point in the future. I’m also going to make a video on my solar setup once it’s been running long enough for me to say meaningful things beyond “I wired a panel and batteries up to run my server”.