evcc icon indicating copy to clipboard operation
evcc copied to clipboard

WARNING: uncached request on Shelly 3EM

Open Joe-md opened this issue 4 months ago • 4 comments

Description

Warning: [db:4-SolaxCarport] WARN 2026/07/28 08:47:28 uncached request repeated within 1s, please report at https://github.com/evcc-io/evcc/issues: http://MYIP.138/emeter/2

Since upgrade from 0.310.1 to 0.312.1 I get warning from my Shelly 3EM. I use it to measure my Solax Inverter which cannot be accessed directly (Solax X1-Boost-G4) I have setup the Shelly 3EM long ago in the UI and not seen this warning before.

Thanks Johannes

Steps to Reproduce

1 upgrade evcc from 0.310.1 to 0.312.1 2 see warning when evcc starts 3 restart evcc via UI 4 see warning after restart

Configuration (YAML)

# open evcc at http://evcc.local:7070
network:
  schema: http
  host: evcc.local # .local suffix announces the hostname on MDNS
  port: 7070
log: debug
levels:
  cache: error
# unique installation id
plant: *****
interval: 30s # control cycle interval
##interval: 10s # control cycle interval
# sponsor token, valid 1095 Tage ab 16.09.2024
sponsortoken: *****
# sponsors can set telemetry: true to enable anonymous data aggregation
# see https://github.com/evcc-io/evcc/discussions/4554
telemetry: true
meters:
- type: template
  template: solax
  id: 1
  host: MYIP.30
  port: 502
  usage: grid
  modbus: tcpip
  name: grid1
- type: template
  template: solax 
  id: 1  
  host: MYIP.30  
  port: 502  
  usage: pv  
  modbus: tcpip  
  name: SolaxHWR
- type: template
  template: solax 
  id: 2
  host: MYIP.30  
  port: 502  
  usage: battery  
  modbus: tcpip  
  capacity: 10.4  
  name: battery1
chargers:
- type: template
  template: go-e-v3 
  host: MYIP.32  
  name: wallbox5
- type: template
  template: shelly
  name: ShellyHWR1
  heating: true
  host: MYIP.199 # IP-Adresse oder Hostname
  user: *****
  password: *****
  channel: 0 # Optional
- type: template
  template: shelly
  name: ShellyHWR2
  heating: true
  host: MYIP.200 # IP-Adresse oder Hostname
  user: *****
  password: *****
  channel: 0 # Optional
- type: template
  template: shelly
  name: ShellyHWR3
  heating: true
  host: MYIP.198 # IP-Adresse oder Hostname
  user: *****
  password: *****
  channel: 0 # Optional
vehicles:
- type: template
  template: vw
  title: BiBo
  icon: shuttle
  user: *****
  password: *****
  vin: *****
  capacity: 77
  phases: 3
  cache: 15m
  mode: pv
  minCurrent: 2
  maxCurrent: 16
  timeout: 10s
  name: ev4
  priority: 10
#- type: template # Kann bei Störung des VW-Portals genutzt werden
#  template: offline
#  title: BiBo
#  icon: shuttle
#  capacity: 77
#  phases: 3
#  mode: pv
#  minCurrent: 2
#  maxCurrent: 16
#  name: ev4
#  priority: 10
- name: WWSpeicher_HWR
  type: custom
  title: WWSpeicher # display name for UI
  icon: waterheater
  capacity: 73 # battery capacity (kWh)
  phases: 1
  soc:
    source: http
    uri: *****
    jq: .["temperature:100"].tC
loadpoints:
- title: go-e-Carport
  charger: wallbox5
  vehicle: ev4
  mode: pv
  priority: 5
- title: WWShelly1 # display name for UI
  charger: ShellyHWR1 # charger
  vehicle: WWSpeicher_HWR
  mode: pv
  priority: 3
  soc:
    poll:
      mode: connected 
      interval: 1m
- title: WWShelly2 # display name for UI
  charger: ShellyHWR2 # charger
  vehicle: WWSpeicher_HWR
  mode: pv
  priority: 2
  soc:
    poll:
      mode: connected
      interval: 1m
- title: WWShelly3 # display name for UI
  charger: ShellyHWR3 # charger
  vehicle: WWSpeicher_HWR
  mode: pv
  priority: 1
  soc:
    poll:
      mode: connected
      interval: 1m
site:
  title: Kirchweg 11
  meters:
    grid: grid1
    pv:
##    - pv1
    - SolaxHWR
##    - pv2
    battery:
    - battery1
  residualPower: 100

Configuration (UI)

{
  "charger": [],
  "experimental": true,
  "influx": {"database":"EVCC","insecure":true,"org":"UEKW11","password":"","token":"***","url":"http://MYIP.173:8086","user":""},
  "interval": 30,
  "loadpoints": [],
  "meter": [
    {"id":4,"name":"db:4","type":"template","config":{"template":"shelly-3em","host":"MYIP.138","usage":"pv"},"deviceTitle":"SolaxCarport"}
  ],
  "modbusproxy": [],
  "mqtt": {"broker":"MYIP.173:1883","caCert":"","clientCert":"","clientID":"","clientKey":"","insecure":true,"password":"","topic":"evcc","user":""},
  "residualPower": 100,
  "shm": {"deviceId":"","deviceSerial":"","vendorId":""},
  "site": {"aux":null,"battery":["battery1"],"consumer":null,"ext":null,"grid":"grid1","pv":["SolaxHWR","db:4"],"title":"UEKW11"},
  "tariff": [
    {"id":17,"name":"db:17","type":"template","config":{"template":"fixed","price":0.08},"deviceProduct":"Fester Preis"},
    {"id":16,"name":"db:16","type":"template","config":{"template":"fixed","price":0.294},"deviceProduct":"Fester Preis"}
  ],
  "tariffRefs": {"co2":"","feedIn":"db:17","grid":"db:16","planner":"","solar":[],"temperature":""},
  "vehicle": []
}

Logs

[lp-1  ] DEBUG 2026/07/28 08:48:28 charge currents: [0 0 0]A
[site  ] DEBUG 2026/07/28 08:48:28 pv 2 power: 640W
[site  ] DEBUG 2026/07/28 08:48:28 grid power: -0W
[site  ] DEBUG 2026/07/28 08:48:29 battery 1 power: -1338W
[site  ] DEBUG 2026/07/28 08:48:30 battery 1 soc: 20%
[site  ] DEBUG 2026/07/28 08:48:30 pv 1 power: 1280W
[site  ] DEBUG 2026/07/28 08:48:31 grid currents: [0.5 0.8 0.7]A
[site  ] DEBUG 2026/07/28 08:48:31 pv power: 1920W
[site  ] DEBUG 2026/07/28 08:48:31 battery has priority at soc 20% (< 70%)
[site  ] DEBUG 2026/07/28 08:48:31 site power: 100W
[lp-3  ] DEBUG 2026/07/28 08:48:31 charge voltages: [235 0 0]V
[lp-3  ] DEBUG 2026/07/28 08:48:31 detected connected phases: 1p
[lp-3  ] DEBUG 2026/07/28 08:48:31 charge total import: 1752.851kWh
[lp-3  ] DEBUG 2026/07/28 08:48:31 charger status: B
[lp-3  ] DEBUG 2026/07/28 08:48:31 charge start energy: 1752.851kWh
[lp-3  ] INFO 2026/07/28 08:48:31 car connected
[lp-3  ] DEBUG 2026/07/28 08:48:31 pv timer elapse
[lp-3  ] DEBUG 2026/07/28 08:48:31 pv timer inactive
[lp-3  ] DEBUG 2026/07/28 08:48:31 charge total import: 1752.851kWh
[lp-3  ] DEBUG 2026/07/28 08:48:31 vehicle soc: 56%
[lp-3  ] DEBUG 2026/07/28 08:48:31 vehicle soc (estimator): 56%
[lp-3  ] DEBUG 2026/07/28 08:48:31 !! plan: plan time zero
[lp-3  ] DEBUG 2026/07/28 08:48:31 pv charge current: 0A = 0A + -0.435A (100W @ 1p)
[lp-3  ] DEBUG 2026/07/28 08:48:31 pv enable timer reset
[lp-3  ] DEBUG 2026/07/28 08:48:31 pv timer inactive

Version

v0.312.1

System

linux/arm64, CEST +02:00

Joe-md avatar Jul 28 '26 07:07 Joe-md

Analysis

Root cause found in templates/definition/meter/shelly-3em.yaml: for the Gen.1 Shelly 3EM this template issues three separate uncached HTTP GETs to the same URL (e.g. http://<host>/emeter/2) — one each for currents, voltages, and powers on that phase — since none of the http sources set a cache duration.

These three reads happen back-to-back within the same site update cycle, so they land well within 1 second of each other. That's exactly what the warning in plugin/http.go (introduced in #31932) detects and reports:

uncached request repeated within 1s, please report at https://github.com/evcc-io/evcc/issues: http://MYIP.138/emeter/2

This is not a functional bug (values are still read correctly) but unnecessary duplicate load on the device and log noise. Other templates that read multiple values from the same endpoint (e.g. amsleser.yaml, ada-p1-meter.yaml) already set cache: <duration> on their http sources for this reason — shelly-3em.yaml was simply missing it.

Fix applied: added cache: 1s to each currents/voltages/powers http source in templates/definition/meter/shelly-3em.yaml so repeated reads of the same /emeter/N endpoint within the same cycle are served from cache instead of re-fetched.

Opening a draft PR with this change.

🤖 Generated with Claude Code

github-actions[bot] avatar Jul 28 '26 07:07 github-actions[bot]

I upgraded to [v0.313.1] and do not see this behaviour anymore. Thanks for quick fixing.

Joe-md avatar Aug 03 '26 06:08 Joe-md

Hi i get the error her on 0.318.0 to WARN 2026/10/24 22:10:56 uncached request repeated within 1s, please report at https://github.com/evcc-io/evcc/issues: http://192.168.178.191/rpc/Shelly.GetStatus

Stefanos-web avatar Oct 24 '26 20:10 Stefanos-web

@Stefanos-web nothing it evcc would trigger this- seems this is your own custom template you'll need to add caching to.

andig avatar Oct 25 '26 11:10 andig