The UK’s National Grid system operator has published an API to forecast the carbon intensity of electricity nationally and region by region. The forecasts are quite short (72h max) and relatively precise
There are a couple of integration out there but none useful enough for my taste so I refactored some of the code and can now produce this type of cards in home assistant
UI is a bit suboptimal as I patched it together with the loverly ApexChart Card extension and some markdown. A proper custom card could be better
Code on github https://github.com/jfparis/sensor.carbon_intensity_uk