Skip to content

Grünstromindex caching issue #25876

@martin5233

Description

@martin5233

Describe the bug

I set up a plan to charge my car a few days ahead, i.e. I created the plan on Dec. 6th for Dec 9th, 8am. No actual plan was displayed, instead the UI said something like "unknown CO2". After investigating a bit, I found that seemingly the data retrieved from Grünstromindex is cached multiple days without updating it, before the cache expires. If the time span from creation to target date crosses the end of the cache validity, evcc will not start to charge at all.

Steps to reproduce

  1. Enable usage of Grünstromindex (no token, docs say its optional)
  2. Check log file for statement "using cache: grünstromindex...", which contains the cached period
  3. Create a charge plan for the morning after the end of the caching period.

evcc does not show any planned period for charging until the cache expires.
Note that I restart my docker container with evcc every night for backup reasons, I'm not sure, if this is relevant.

Configuration details

# open evcc at http://evcc.local:7070
network:
  schema: http
  host: evcc.local # .local suffix announces the hostname on MDNS
  port: 7070

log: debug

# unique installation id
plant: *** removed ***
interval: 10s # control cycle interval
telemetry: true
sponsortoken: *** removed ***

mqtt:
  broker: cube:1883
  clientid: evcc

meters:
- name: grid
  type: custom
  power:
    source: modbus
    id: 1
    uri: 192.168.1.43:502
    register:
      address: 40073
      type: holding
      decode: int32s
- name: pv
  type: custom
  power:
    source: modbus
    id: 1
    uri: 192.168.1.43:502
    register:
      address: 40067
      type: holding
      decode: int32s
- name: battery
  type: custom
  power:
    source: calc
    mul:
      scale: -1
      source: modbus
      id: 1
      uri: 192.168.1.43:502
      register:
        address: 40069
        type: holding
        decode: int32s
  soc:
    source: modbus
    id: 1
    uri: 192.168.1.43:502
    register:
      address: 40082
      type: holding
      decode: uint16
  energy:
    source: calc
    mul:
      scale: 0.0825
      source: modbus
      id: 1
      uri: 192.168.1.43:502
      register:
        address: 40082
        type: holding
        decode: uint16

vehicles:
- type: template
  template: polestar
  user: *** removed ***
  password: *** removed ***
  title: Polly
  icon: car
  capacity: 79
  phases: 3
  mode: pv
  name: polestar

chargers:
- name: wallbox
  type: template
  template: tinkerforge-warp3-smart
  host: cube
  topic: warp3

site:
  title: Mein Zuhause
  meters:
    grid: grid
    pv:
    - pv
    battery:
    - battery
  residualpower: 100

loadpoints:
  - title: Garage
    charger: wallbox
    vehicle: polestar
    enable:
      threshold: -3000
      delay: 3m
    disable:
      threshold: 0
      delay: 3m

tariffs:
  currency: EUR
  grid:
    type: fixed
    price: 0.3866  # EUR/kWh
  feedin:
    type: fixed
    price: 0.0811 # EUR/kWh
  co2:
    type: template
    template: grünstromindex
    zip: *** removed ***
  solar:
    - type: template
      template: solcast
      site: *** removed ***
      token: *** removed ***
      from: "9"
      to: "14"
      interval: 3h

Log details

evcc  | [tariff] DEBUG 2025/12/01 01:05:41 using cache: grünstromindex-be568b5c7ed027ff5a40a885b1c9bd1da87146c7dd4d9dc4bc8c077d49236334 (start: 2025-12-01 01:00:00 +0100 CET, end: 2025-12-05 00:00:00 +0100 CET)
evcc  | [tariff] DEBUG 2025/12/02 01:05:41 using cache: grünstromindex-be568b5c7ed027ff5a40a885b1c9bd1da87146c7dd4d9dc4bc8c077d49236334 (start: 2025-12-01 01:00:00 +0100 CET, end: 2025-12-05 00:00:00 +0100 CET)
evcc  | [tariff] DEBUG 2025/12/03 01:06:24 using cache: grünstromindex-be568b5c7ed027ff5a40a885b1c9bd1da87146c7dd4d9dc4bc8c077d49236334 (start: 2025-12-01 01:00:00 +0100 CET, end: 2025-12-05 00:00:00 +0100 CET)
evcc  | [site  ] WARN 2025/12/04 00:00:37 planner: cannot create tariff type 'grünstromindex': unexpected status: 429 (Too Many Requests)
evcc  | [site  ] WARN 2025/12/04 00:00:38 planner: cannot create tariff type 'grünstromindex': unexpected status: 429 (Too Many Requests)
evcc  | [site  ] WARN 2025/12/04 00:00:38 planner: cannot create tariff type 'grünstromindex': unexpected status: 429 (Too Many Requests)
evcc  | [site  ] WARN 2025/12/04 00:00:48 planner: cannot create tariff type 'grünstromindex': unexpected status: 429 (Too Many Requests)
evcc  | [site  ] WARN 2025/12/04 00:00:58 planner: cannot create tariff type 'grünstromindex': unexpected status: 429 (Too Many Requests)
evcc  | [site  ] WARN 2025/12/04 01:04:18 planner: cannot create tariff type 'grünstromindex': unexpected status: 429 (Too Many Requests)
evcc  | [site  ] WARN 2025/12/04 01:04:28 planner: cannot create tariff type 'grünstromindex': unexpected status: 429 (Too Many Requests)
evcc  | [site  ] WARN 2025/12/04 01:04:38 planner: cannot create tariff type 'grünstromindex': unexpected status: 429 (Too Many Requests)
evcc  | [site  ] WARN 2025/12/04 01:04:48 planner: cannot create tariff type 'grünstromindex': unexpected status: 429 (Too Many Requests)
evcc  | [tariff] DEBUG 2025/12/05 01:05:59 using cache: grünstromindex-be568b5c7ed027ff5a40a885b1c9bd1da87146c7dd4d9dc4bc8c077d49236334 (start: 2025-12-05 01:00:00 +0100 CET, end: 2025-12-09 00:00:00 +0100 CET)
evcc  | [tariff] DEBUG 2025/12/06 01:05:57 using cache: grünstromindex-be568b5c7ed027ff5a40a885b1c9bd1da87146c7dd4d9dc4bc8c077d49236334 (start: 2025-12-05 01:00:00 +0100 CET, end: 2025-12-09 00:00:00 +0100 CET)
evcc  | [tariff] DEBUG 2025/12/07 01:05:57 using cache: grünstromindex-be568b5c7ed027ff5a40a885b1c9bd1da87146c7dd4d9dc4bc8c077d49236334 (start: 2025-12-05 01:00:00 +0100 CET, end: 2025-12-09 00:00:00 +0100 CET)

What type of operating system or environment does evcc run on?

Docker container

External automation

  • I have made sure that no external automation like HomeAssistant or Node-RED is active or accessing any of the mentioned devices when this issue occurs.

Nightly build

  • I have verified that the issue is reproducible with the latest nightly build

Version

v0.210.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    tariffsSpecific tariff support

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions