How to Use ReduceCO2Today.org with Home Assistant to Build Green Automations

With ReduceCO2Today.org, you can connect real-time green energy forecasts to Home Assistant and build smart automations that save energy costs and reduce CO₂ emissions.

1️⃣ Prerequisites

Home Assistant running (Docker, Raspberry Pi, or any supported platform)

Access to your configuration.yaml file

Obtain your API key from reduceCO2today.org

Find your (Country Code) and keep it handy

2️⃣ Add the ReduceCO2Today Sensors

We’ll create REST sensors that pull green band forecasts from the ReduceCO2Today API.

📂 Steps:

  1. Open your Home Assistant configuration.yaml in an editor.
  2. Paste the sensor configuration (download: green_band_sensors.yaml).
  3. Save the file and restart Home Assistant.

🔍 After restart, check in Developer Tools → States for:

  • sensor.green_band_1_start → Start time of first green period
  • sensor.green_band_1_end → End time of first green period
  • sensor.green_band_2_start / _end → Second green period
  • sensor.green_band_3_start / _end → Third green period

3️⃣ Create a Dummy Washing Machine (for Testing)

If you don’t have a smart plug yet, you can simulate your washing machine with a template switch.

📂 Add the dummy switch configuration (download: dummy_washing_machine.yaml) to your configuration.yaml, then restart.

You should now see switch.washing_machine in Developer Tools → States.

4️⃣ Build the Green Automation

Now we’ll create an automation that turns on the washing machine at the start of the green period.

📂 Download the automation file: automation_green_washing_machine.yaml and add it via:

  • Option A: Paste it directly into automations.yaml
  • Option B: Go to Settings → Automations & Scenes → Add Automation → Edit in YAML and paste the code (without the top automation: key).

5️⃣ Add Automation to Dashboard

To control and monitor your automation:

  1. Go to Dashboards → Edit Dashboard → Add Card
  2. Choose Entities card
  3. Add automation.green_energy_automation

6️⃣ Test the Setup

If the current time matches the forecasted green start time, the washing machine will automatically turn on. You’ll also see a notification confirming that the automation ran.

That’s it!

You’ve successfully connected ReduceCO2Today.org with Home Assistant and built your first green automation.

From here, you can:

  • Extend the same logic to dishwashers, EV chargers, or heating systems
  • Combine with energy dashboards for full CO₂ tracking
  • Share your automations with the community