Logo

dev-resources.site

for different kinds of informations.

Live Average Carbon Intensity rating with Octopus Home Mini in Home Assistant

Published at
3/20/2024
Categories
carbonrating
tutorial
homeautomation
energy
Author
danuw
Author
5 person written this
danuw
open
Live Average Carbon Intensity rating with Octopus Home Mini in Home Assistant

As mentioned to Adam Jackson on Decarbonize Software 2023 the other day, here is a quick note on how to create a live consumption carbon intensity rating widget (sorry a bit of a mouthful) on your Home Assistant dashboard.

Pre-requisites:

  • You have an instance of Home Assistant already configured
  • HACS is already set up on your Home Assistant instance. Otherwise instructions can be found here: https://hacs.xyz/docs/setup/download
  • You are signed up to Octopus Energy provider and have requested a Octopus Home Mini - if you are not yet an Octopus Energy customer, feel free to use my referral code iron-sun-306 for £50 off your first bill

Home Mini

I was recently really excited to get an Octopus Home Mini. Compared to a smart meter that only reports on aggregated readings over 30 minutes blocks, the Home Mini allows for 10 seconds to 1 minute old readings which can significantly help improve smart home automation in the house. Let's face it, there is nearly no automation relevant over 30 minutes old data when it comes to energy. I have solar panels, and in a country like the UK, the sun really comes and goes and automations would need to be based on 1 to 5 minutes averages to stay relevant.

Octopus Energy's Live Dashboard enabled by Home Mini

Anyway, getting up to 1 minute old consumption carbon rating can be achieve with these simple steps:

1. Install CO2 Signal Home Assistant Integration

This is available via the integration tab in Home Assistant.
CO2 Signal Home Assistant Integration

2. Install Octopus Integration and enable the Home Mini

This requires the installation of HACS first.
Octopus Home Assistant Integration

3. Set up a template that combines the values from both

Configuration

In your configuration.yaml, add the following line (to create your templates in a dedicated file - that is neater)

template: !include templates.yaml
Enter fullscreen mode Exit fullscreen mode

Create that template.yaml file (alongside your configuration.yaml) and add the following content:

template:
  - sensor:
      - name: "Current hourly Electricity Carbon Emission Rating"
        unit_of_measurement: "gCO2eq/h"
        state: >
            {% set currentco2rating = states('sensor.co2_signal_co2_intensity') | float %}
            {% set liveusage = states('sensor.octopus_energy_electricity_22j0484346_1013001886662_current_demand') | float %}

            {% set totalRating = currentco2rating * liveusage/1000 %}
            {% if totalRating > 0 %}
            {{ totalRating | round(1, default=0) }}
            {%- else -%}
              0
            {%- endif %}
Enter fullscreen mode Exit fullscreen mode

Note to create your own template, you can use the Template Editor under the template tab of the Developer Tools to test it.

Dashboard

You can then set up a dashboard with your current consumption or rating using the sensor card, to help you compare your consumption. The sensor card shows both the current value as well as the history over the past configured period (for me it is set to last 24h).
You could also add gauges to create some red/amber/green zones to at a glance understand how you are currently doing.

Here I am starting the battery charging when the power is at its lowest carbon intensity for the day:

Starting to charge the battery when the power is at its lowest for the day

This shows that when the consumption is negative, we are keeping our rating positive to a minimum of zero.

Defaults to zero when power is negative

Finally this show charging the car when the power is at its lowest of the day (similar to charging the battery):
Starting to charge the car when the power is at its lowest for the day

Wrap up

Adding your carbon intensity to your dashboard and combining it to your consumption makes it easy to see whether our consumption is carbon aware, i.e. whether it uses more energy cleaner, in other words, when the electricity production comes primarily from renewable energy.

EDIT 26/03/24: Thank you Ronan Glemain (@ronanglemain) for the correction tips, especially around fixing the unit of measure (from gCO2eq/kWh to gCO2eq/h) - Template has been updated though images still currently the original with the mistaken unit

energy Article's
30 articles in total
Favicon
Expanded literacy and the current state of software
Favicon
Building Your Own Smart Meter: A DIY Guide
Favicon
AI in Energy Management: Transforming the Future of Energy Efficiency
Favicon
Solar Battery Generator Market to Develop New Trend and Growth Story
Favicon
RENEWABLE ENERGY ZONES APPENDIX 3: AN IN-DEPTH LOOK
Favicon
CPEC Energy Projects In Pakistan: Impact And Future Prospects
Favicon
Solar Energy for Your Home and Business
Favicon
Cordycep Gum Energizing and Invigorating with a Healthy Mouth Biome Boost
Favicon
The Magic of Wireless Power Transmission Unleashing Teslas Vision
Favicon
Top Solar Companies in the USA
Favicon
Jacketed Liposome Extruder||Nanotechnology
Favicon
Advancing Energy Efficiency with Kinto Power Electric Co., Ltd
Favicon
How to Choose the Right Wind Generator for Your Needs
Favicon
Innovative Uses for Foldable Solar Panels in Outdoor Activities
Favicon
Powering Progress: The Role of Wind Turbines in Clean Energy
Favicon
The Best NAD Supplements for Boosting Your Energy and Staying Active
Favicon
Constant Micro Power Energy System
Favicon
Live Average Carbon Intensity rating with Octopus Home Mini in Home Assistant
Favicon
The Importance of Maintaining Energy Levels
Favicon
Distributed Energy Resource Management System Market Size
Favicon
Shaping the Future of Energy: Aluminum Air Batteries Market Trends
Favicon
Unleashing the Power of 48 Volt Solar Panels: A Gateway to Clean and Efficient Home Energy
Favicon
Decoding Capacitor Trends: A Deep Dive into the High-Voltage Market
Favicon
The Role Of Government Policies In Encouraging Businesses To Transition To Green Energy
Favicon
5G Technology and Lithium-ion Batteries: A Symbiotic Relationship
Favicon
Top Companies Reinventing the Energy Sector Via Blockchains
Favicon
Performative performance
Favicon
Sustainable Software Engineering for a greener digital world
Favicon
Creating desktop applications in Golang
Favicon
Building cross platform desktop applications using JavaScript, HTML, and CSS in GO

Featured ones: