Hello @gizmocuz,
You wrote:
How do you calculate the Fossil usage? Are you taking your countries emission factor into account and is this calculated value per year/month/day?
I take the data form this website:
https://app.electricitymaps.com
This site is open-source and has a free API. You need an API key, but you can use it for free.
It will give you in fact the origin of the electricity, that you consume from the grid, as well as the Carbon footprint

- Screenshot_Electricity_Map_CO2.png (13.61 KiB) Viewed 1872 times
and

- Screenshot_Electricity_Map_Electricity.png (24.01 KiB) Viewed 1872 times
In the second picture you will see the fossilFreePercentage for a specific area.
The site supports over 200 areas. Smaller countries, like The Netherlands or Belgium are one area each, while the real big countries have multiple areas.
I assume that the energy, I consume from the grid, consists of that percentage of fossil-free energy.
Therefore I take the power from the grid and multiply it with the percentage. Next I calculate the energy.
So the MQTT value from the P1 device is sent to (in my case) Node-RED (svalue5), multiply it with the percentage and calculate the energy.
This value is returned in a "Text" sensor.
I first created an "Electricity (Instant + Counter) sensor and let Domoticz do the "Energy" calculation, but unfortunately I could not make that sensor visible in the "Energy Dashboard". Therefore I changed it to a "Text" sensor.
I'm not sure, whether it is better to use the fossilFreePercentage or the renewablePercentage. I took for now the HASS presentation
The difference is that fossilFreePercentage includes the nuclear energy and the renewablePercentage is without the nuclear component.
The Node-RED flow I posted at:
https://www.domoticz.com/forum/viewtopic.php?t=42587
Are you taking your countries emission factor into account and is this calculated value per year/month/day?
Yes, the emission factor depends on the area, so in this case the country (The Netherlands) and it is calculated hourly.
In the documentation of the API it is stated :
All endpoints return data with a resolution of 1 hour.
It could be interesting to have this natively implemented in Domoticz and calculate this for/with electricity,gas,water
Electricity is quite easy and that is the easiest to calculate. Gas is by definition not fossil-free or renewable.
Water is a different issue. I believe most, if not all, water pumps are electrical pumps. So that is covered by the electricity.
But it would be a good idea to implement in natively in Domoticz. And perhaps, you have some good and interesting ideas as well.
Best Regards