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

With reduceCO2today.org, you can easily connect real-time green energy forecasts to Home Assistant and build smart automations that secure our planet's future by reducing CO₂ emissions.

1️⃣ Prerequisites

Home Assistant running (e.g., on Docker, Raspberry Pi, or any supported platform)

Access to your configuration.yaml file

Obtain your API key from reduceCO2today.org

Know your TSO Region in Germany (Amprion, TennT, TransnetBW, or 50Hertz)

2️⃣ Add the reduceCO2today Sensor

First, we create a RESTful sensor that will fetch the green time recommendation from the API.

📂 Steps:

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

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

  • sensor.green_time_forecast (raw text)
  • sensor.green_time_start (start time of the green period)
  • sensor.green_time_end (end time of the green period)

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

If you don’t have a real smart plug or washing machine entity, create a dummy switch.

📂 Add the configuration (download file: 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 create an automation that turns on the washing machine at the start of the green period.

📂 Download 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 make it visible:

  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 charging, or heating systems
  • Combine with energy dashboards for full CO₂ tracking
  • Share your automations with the community