evcc-io / evcc

Sonne tanken ☀️🚘
https://evcc.io
MIT License
3.6k stars 666 forks source link

Retry tariff downloads on failure #8183

Closed jheinitz closed 1 year ago

jheinitz commented 1 year ago

Describe the bug

Hello!

I have configured the grünstromindex to get the carbon footprint of my setup. Today there was a problem with the request at 13:25. From that time on the log contains the following message every 20s:

[site  ] ERROR 2023/05/26 13:25:25 tariff: outdated

Exactly at 14:25 these messages did no longer appear. Could it be that the request to GSI is executed every 60m and therefore the next request succeeded?

I would suggest to log this message only once after the request failed.

By the way: my interval: is set to 20s. So maybe the message is logged at every interval.

Kind regards

Jens

Steps to reproduce

  1. configure grünstromindex
  2. wait for a failed request
  3. watch the error in the log ...

Configuration details

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

log: info
levels:
  messaging: debug
  easee: debug
  enyaq: debug
  # cache: error
  cache: debug

# unique installation id
plant: <my plant id>

interval: 20s # control cycle interval

sponsortoken: <my sponsor token>

# database configuration for persisting charge sessions and settings
database:
  type: sqlite
  dsn: /db/evcc.db

# sponsors can set telemetry: true to enable anonymous data aggregation
# see https://github.com/evcc-io/evcc/discussions/4554
telemetry: true

mqtt:
  broker: server2.example.com:1883
  topic: evcc
  clientid: evcc
  user: evcc
  password: *****

meters:
  - name: grid1
    type: custom
    power:
      source: mqtt
      topic: modbus/power/sun2000/meter
      jq: .fields.meter_active_power
      scale: -1
    energy:
      source: mqtt
      topic: modbus/power/sun2000/meter
      jq: .fields.meter_imported_energy
    currents:
      - source: mqtt
        topic: modbus/power/sun2000/meter
        jq: .fields.meter_a_line_current
        scale: -1
      - source: mqtt
        topic: modbus/power/sun2000/meter
        jq: .fields.meter_b_line_current
        scale: -1
      - source: mqtt
        topic: modbus/power/sun2000/meter
        jq: .fields.meter_c_line_current
        scale: -1

  - name: inverter1
    type: custom
    power:
      source: mqtt
      topic: modbus/power/sun2000/inverter/1
      jq: .fields.inverter_input_power
    energy:
      source: mqtt
      topic: modbus/power/sun2000/inverter/1
      jq: .fields.inverter_accumulated_energy_yield

  - name: storage1
    type: custom
    power:
      source: mqtt
      topic: modbus/power/sun2000/storage/1
      jq: .fields.storage_charge_discharge_power
      scale: -1
    soc:
      source: mqtt
      topic: modbus/power/sun2000/storage/1
      jq: .fields.storage_state_of_capacity
    capacity: 10

chargers:
  - type: template
    template: easee
    user: ***********@gmail.com
    password: ***********
    timeout: 50s
    charger: EH******
    name: wallbox4

vehicles:
  - type: template
    template: enyaq
    title: Skoda Enyaq
    user: ******@gmail.com
    password: ******
    vin: TM************
    cache: 15m
    capacity: 80
    timeout: 50s
    name: ev1
    targetSoc: 85

loadpoints:
  - title: Carport
    charger: wallbox4
    mode: pv
    phases: 0
    minCurrent: 7
    maxCurrent: 16
    resetOnDisconnect: true
    enable:
      delay: 1m
    disable:
      delay: 5m

site:
  title: Hausweide-3
  meters:
    grid: grid1
    pvs:
      - inverter1
    batteries:
      - storage1
  residualPower: 250
  bufferSoc: 70
  bufferStartSoc: 80
  prioritySoc: 50

tariffs:
  currency: EUR # (default EUR)
  grid:
    # static grid price
    type: fixed
    price: 0.4986 # [currency]/kWh

  feedin:
    # rate for feeding excess (pv) energy to the grid
    type: fixed
    price: 0.082 # [currency]/kWh

  planner:
    type: grünstromindex
    zip: "25337"

influx:
  url: http://server2.example.com:8086
  database: evcc
  token: evcc-pv-logging
  org: home

Log details

[site  ] ERROR 2023/05/26 13:25:05 tariff: outdated
[gsi   ] ERROR 2023/05/26 13:25:10 unexpected status: 429 (Too Many Requests)
[site  ] ERROR 2023/05/26 13:25:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:25:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:26:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:26:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:26:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:27:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:27:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:27:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:28:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:28:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:28:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:29:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:29:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:29:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:30:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:30:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:30:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:31:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:31:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:31:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:32:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:32:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:32:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:33:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:33:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:33:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:34:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:34:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:34:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:35:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:35:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:35:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:36:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:36:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:36:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:37:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:37:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:37:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:38:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:38:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:38:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:39:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:39:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:39:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:40:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:40:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:40:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:41:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:41:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:41:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:42:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:42:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:42:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:43:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:43:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:43:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:44:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:44:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:44:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:45:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:45:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:45:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:46:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:46:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:46:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:47:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:47:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:47:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:48:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:48:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:48:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:49:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:49:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:49:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:50:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:50:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:50:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:51:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:51:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:51:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:52:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:52:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:52:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:53:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:53:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:53:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:54:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:54:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:54:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:55:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:55:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:55:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:56:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:56:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:56:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:57:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:57:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:57:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:58:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:58:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:58:45 tariff: outdated
[site  ] ERROR 2023/05/26 13:59:05 tariff: outdated
[site  ] ERROR 2023/05/26 13:59:25 tariff: outdated
[site  ] ERROR 2023/05/26 13:59:45 tariff: outdated
[site  ] ERROR 2023/05/26 14:00:05 tariff: outdated
[site  ] ERROR 2023/05/26 14:00:25 tariff: outdated
[site  ] ERROR 2023/05/26 14:00:45 tariff: outdated
[site  ] ERROR 2023/05/26 14:01:05 tariff: outdated
[site  ] ERROR 2023/05/26 14:01:25 tariff: outdated
[site  ] ERROR 2023/05/26 14:01:45 tariff: outdated
[site  ] ERROR 2023/05/26 14:02:05 tariff: outdated
[site  ] ERROR 2023/05/26 14:02:25 tariff: outdated
[site  ] ERROR 2023/05/26 14:02:45 tariff: outdated
[site  ] ERROR 2023/05/26 14:03:05 tariff: outdated
[site  ] ERROR 2023/05/26 14:03:25 tariff: outdated
[site  ] ERROR 2023/05/26 14:03:45 tariff: outdated
[site  ] ERROR 2023/05/26 14:04:05 tariff: outdated
[site  ] ERROR 2023/05/26 14:04:25 tariff: outdated
[site  ] ERROR 2023/05/26 14:04:45 tariff: outdated
[site  ] ERROR 2023/05/26 14:05:05 tariff: outdated
[site  ] ERROR 2023/05/26 14:05:25 tariff: outdated
[site  ] ERROR 2023/05/26 14:05:45 tariff: outdated
[site  ] ERROR 2023/05/26 14:06:05 tariff: outdated
[site  ] ERROR 2023/05/26 14:06:25 tariff: outdated
[site  ] ERROR 2023/05/26 14:06:45 tariff: outdated
[site  ] ERROR 2023/05/26 14:07:05 tariff: outdated
[site  ] ERROR 2023/05/26 14:07:25 tariff: outdated
[site  ] ERROR 2023/05/26 14:07:45 tariff: outdated
[site  ] ERROR 2023/05/26 14:08:05 tariff: outdated
[site  ] ERROR 2023/05/26 14:08:25 tariff: outdated
[site  ] ERROR 2023/05/26 14:08:45 tariff: outdated
[site  ] ERROR 2023/05/26 14:09:05 tariff: outdated
[site  ] ERROR 2023/05/26 14:09:25 tariff: outdated
[site  ] ERROR 2023/05/26 14:09:45 tariff: outdated
[site  ] ERROR 2023/05/26 14:10:05 tariff: outdated
[site  ] ERROR 2023/05/26 14:10:25 tariff: outdated
[site  ] ERROR 2023/05/26 14:10:45 tariff: outdated
[site  ] ERROR 2023/05/26 14:11:05 tariff: outdated
[site  ] ERROR 2023/05/26 14:11:25 tariff: outdated
[site  ] ERROR 2023/05/26 14:11:45 tariff: outdated
[site  ] ERROR 2023/05/26 14:12:05 tariff: outdated
[site  ] ERROR 2023/05/26 14:12:25 tariff: outdated
[site  ] ERROR 2023/05/26 14:12:45 tariff: outdated
[site  ] ERROR 2023/05/26 14:13:05 tariff: outdated
[site  ] ERROR 2023/05/26 14:13:25 tariff: outdated
[site  ] ERROR 2023/05/26 14:13:45 tariff: outdated
[site  ] ERROR 2023/05/26 14:14:05 tariff: outdated
[site  ] ERROR 2023/05/26 14:14:25 tariff: outdated
[site  ] ERROR 2023/05/26 14:14:45 tariff: outdated
[site  ] ERROR 2023/05/26 14:15:05 tariff: outdated
[site  ] ERROR 2023/05/26 14:15:25 tariff: outdated
[site  ] ERROR 2023/05/26 14:15:45 tariff: outdated
[site  ] ERROR 2023/05/26 14:16:05 tariff: outdated
[site  ] ERROR 2023/05/26 14:16:25 tariff: outdated
[site  ] ERROR 2023/05/26 14:16:45 tariff: outdated
[site  ] ERROR 2023/05/26 14:17:05 tariff: outdated
[site  ] ERROR 2023/05/26 14:17:25 tariff: outdated
[site  ] ERROR 2023/05/26 14:17:45 tariff: outdated
[site  ] ERROR 2023/05/26 14:18:05 tariff: outdated
[site  ] ERROR 2023/05/26 14:18:25 tariff: outdated
[site  ] ERROR 2023/05/26 14:18:45 tariff: outdated
[site  ] ERROR 2023/05/26 14:19:05 tariff: outdated
[site  ] ERROR 2023/05/26 14:19:25 tariff: outdated
[site  ] ERROR 2023/05/26 14:19:45 tariff: outdated
[site  ] ERROR 2023/05/26 14:20:05 tariff: outdated
[site  ] ERROR 2023/05/26 14:20:25 tariff: outdated
[site  ] ERROR 2023/05/26 14:20:45 tariff: outdated
[site  ] ERROR 2023/05/26 14:21:05 tariff: outdated
[site  ] ERROR 2023/05/26 14:21:25 tariff: outdated
[site  ] ERROR 2023/05/26 14:21:45 tariff: outdated
[site  ] ERROR 2023/05/26 14:22:05 tariff: outdated
[site  ] ERROR 2023/05/26 14:22:25 tariff: outdated
[site  ] ERROR 2023/05/26 14:22:45 tariff: outdated
[site  ] ERROR 2023/05/26 14:23:05 tariff: outdated
[site  ] ERROR 2023/05/26 14:23:25 tariff: outdated
[site  ] ERROR 2023/05/26 14:23:45 tariff: outdated
[site  ] ERROR 2023/05/26 14:24:05 tariff: outdated
[site  ] ERROR 2023/05/26 14:24:25 tariff: outdated
[site  ] ERROR 2023/05/26 14:24:45 tariff: outdated
[site  ] ERROR 2023/05/26 14:25:05 tariff: outdated
[lp-1  ] INFO 2023/05/26 14:45:25 stop charging <-
[lp-1  ] INFO 2023/05/26 14:45:45 start charging ->
[lp-1  ] INFO 2023/05/26 14:55:45 stop charging <-

What type of operating system are you running?

Docker container

Version

0.117.4

andig commented 1 year ago

Die Daten werden jede Stunde refreshed und der Fehler bleibt dann entsprechend stehen. Statt den Fehler zu unterdrücken wäre es besser ein exponential retry einzubauen statt eine Stunde zu warten. Eine andere Möglichkeit wäre, gar keinen Fehler auszugeben solange noch ausreichend Daten vorliegen. Was "ausreichend" heisst wäre zu definieren. Überhaupt Daten? 8h? 1 Tag?

Aktuell keine Prio, PR welcome.

lex777777 commented 1 year ago

Der API Server scheint down ist zu sein. Ich bekomme ein


[main  ] ERROR 2023/06/01 14:32:41 failed configuring planner tariff: cannot create tariff 'grünstromindex': unexpected status: 502 (Bad Gateway)

Also kein(?) Bug.

dklinger commented 1 year ago

Wurde das mit dem verlinkten PR beginnen? Ich bin auf 0.119.5 und es tritt noch auf wie oben beschrieben: Fehler wird alle paar Sekunden geloggt.

andig commented 1 year ago

Logfile? Bitte trace für den Tarif. Wenns auch mit mehreren Versuchen nicht klappt wird der Fehler geloggt.