I couldn’t find a solution to calculating the gCO2 from the electricity grid and many people asking how to do it. This may not be the best way to do it, but here it is.
Key is sensor.energy_real_consumed_fronius_meter_0_fronius_lan is the sensor on my network which is a monotonically increasing sensor that measure my grid usage in wh. (hence the /1000 to convert to kwh in step3).
Assumes you have the Electricity Maps integration already configured and working.
Where I live the grid is dispatched every 5mins so the Electricity Maps CO2 number can’t update any more frequently than 5mins, hence choice of 5mins in the automation.
Very good approach @markpurcell . I also created a sensor today using your instructions.
But could it be that you have an error in your formula for the “co2_emissions_displaced_rate” given here?
Hi Mark,
I try to do the same as you but I’m a complete HA beginner. Could you describe your method a bit more step by step? Do you also create helpers or do you put this code in your configuration.yaml? Thanks!
I think it is important to realize that, while the Electricity Maps CO2 number is a good approximation of how well countries do with the production of carbon friendly energy production, it is in no way a good way to calculate how green the energy is that any individual household consumes. This has to do with how the energy market and carbon emission rights work. The HA energy dashboard, which does similar calculations, is making the same false assumption that you can use production percentages for consumption.
Let me try to explain why. In my country, the Netherlands, each consumer can choose to take a contract for a certain minimum amount of “green” energy. That green energy must be produced without fossil fuel. In my case, I chose a 100% green contract, so I pay to force my energy company to buy all CO2 free energy. The production percentage for the Netherlands is way below 100%, but my consumtion percentage is 100% because I payed extra for it. It means other must get less.
Add to that: Unfortunately, the Netherlands does not produce enough green energy.So my energy company needs to buy green energy abroad, for instance from Norway, which produces way more green energy than the Netherlands (kudos to them).
People who do not explicitly buy green energy (we call it gray energy) are told they get a mix of green and not green. But in reality, if people like me have already payed for all the green energy that is produced in the Netherlands, it cannot be that others in the Netherlands can also claim apart of their use as green.
In Norway, if a part of green energy produced is sold to abroad, that part of green production can also not be claimed by Norwegians. I do not know how energy contracts are sold there, but the international energy market is making it so that the percentage green energy produced is not the percentage that is consumed locally, because the energy company sold at least parts to other countries.
Whilst it is great you are paying for green energy and it is also great they are bringing additional green energy to the Netherlands to satisfy your demand this does reduce the carbon intensity of the Netherlands grid and if everyone did that you would have 100% renewable energy.
But unless you have a hardwired connection to those renewable energy generators (such as your own solar panels or a wind generator on your roof) then when you consume energy from the grid, even if you have paid for green energy, you are still consuming energy that has been generated from the mix of sources which are feeding the grid at that time, including fossil fuels. The company is unable to select which set of electrons you receive via your network connection.
Looking at the data for NL from yesterday, you have impressive solar and wind generation entities, but in the evening when the sun goes down that generation is being supplemented by gas generators with a high carbon intensity. If you are drawing from the grid at that time you are contributing to those CO2 emissions. Again looking at the data from yesterday during the solar peak the minimum carbon intensity during the day was still 123 gCO2e/ kWh. Which is a lot better than my network here which only gets down to a minimum of 400 gCO2e/ kWh.
You are absolutely right that the actual energy delivered comes from local sources. Those can be green or grey sources depending on time of day and all sorts of other factors. The actual energy I use is always local and not always green. The production figures are calculated on a national scale. But if you live near a gas plant, chances are you consume 100% fossil. That is my whole point. National figures are not applicable on a personal scale.
But you do have to look at who is paying for the windmills and the gas plants. It is not fair that people who are paying low prices (that can only be achieved by using fossil fuel) feel good about themselves because they live in the vincinity of a windmill that is only feasible because others were prepared to pay extra.
But I do applaude people that try to balance their use based on moments when green energy is abundant though. That only applies if you really act on what the percentages say, not if you just look and do not change your behavior. Responsible energy use behavior benefits every one, regardless of what you paid. So I will give it to you that it is not clear cut. The numbers have their good use if interpreted right.
Local energymix might indeed vary but if you live next to the Eemshaven coal powerplant you also live near Drenthe which has abundant solarpanels. So it’s not automatically the case that if you live next to a coal powerplant you consume grey energy.
I have 16 solarpanels and consume about 40% of this energy right away in my all-electric house. You could say this produces 0 kg of CO2 (the panels were made with carbon naturally). I’m interested in the amount of CO2 I still consume from the grid which varies enormously during the day. It’s quite a simple sum as Marc describes, the problem is that I’m a nood at yaml coding
I basically need yaml I can copy paste or need more time to learn yaml haha.
Thanks anyways. I hope HA will implement CO2 in the energydashboard since it’s such a big theme and a lot of people have no idea how much they produce