Skip to content

Grid meter references are not cleaned-up when the grid meter device is replaced or removed in the UI #31698

Description

@blu3r4y

Describe the bug

I replaced a Modbus grid meter with a Fronius SolarAPI grid meter via the UI.

After that, the site kept crashing with "failed booting site: not found: db:13".

The only resolution was a manual edit of the evcc.db to reference the correct grid meter.

UPDATE settings SET value='db:<CORRECT_ID_HERE>' WHERE key='gridMeter'

Steps to reproduce

  1. I had evcc 0.309.2 installed, with a configured Modbus grid meter.
  2. I removed that Modbus grid meter in the UI and created a new Fronius SolarAPI grid meter.
  3. I reloaded the configuration and got failed booting site: not found: db:13
  4. I then updated to evcc 0.311.1 but the issue persisted.

Configuration details

### evcc.db


$ sudo sqlite3 /var/lib/evcc/evcc.db "SELECT key, value FROM settings;"
eebus|{"port":4712,"shipid":"EVCC-3437613365393561","certificate":{"public":"REDACTED","private":"REDACTED"},"secret":"REDACTED"}
adminPassword|REDACTED
jwtSecretKey|REDACTED
gridMeter|db:13
sponsorToken|REDACTED
pvMeters|
title|REDACTED
batteryMeters|
remoteLastSeen|{}
prioritySoc|40
batteryDischargeControl|false
tariffRefs|{"grid":"db:19","feedIn":"","co2":"","planner":"","solar":["db:17","db:18"]}


### evcc config


$ sudo evcc config --database /var/lib/evcc/evcc.db
[main  ] INFO 2026/07/11 18:24:38 config file not found, database-only mode
[main  ] INFO 2026/07/11 18:24:38 using sqlite database: /var/lib/evcc/evcc.db?_pragma=busy_timeout(5000)&_pragma=foreign_keys(1)&_pragma=auto_vacuum(INCREMENTAL)
charger
---
db:2 {Type:template Title: Icon: Product:go-e Charger V3} map[host:192.168.188.83 template:go-e-v3]

meter
---
db:20 {Type:template Title:Symo 5.0-3-M Icon: Product:Fronius Solar API V1} map[batteryconfiguri:/config host:192.168.188.119 template:fronius-solarapi-v1 usage:pv user:*****]
db:21 {Type:template Title: Icon: Product:Fronius Solar API V1} map[batteryconfiguri:/config host:192.168.188.53 template:fronius-solarapi-v1 usage:grid user:*****]

vehicle
---
db:6 {Type:template Title: Icon: Product:Toyota} map[autodetectdisabled:false cache:15m capacity:77 climaterdisabled:false icon:car password:***** priority:0 template:toyota title:Toyota C-HR+ user:***** wakeupdisabled:false]

tariff
---
db:17 {Type:template Title:Süd-West (24 Stk. x 325W) Icon: Product:Open-Meteo} map[ac:1000 alphatemp:-0.004 az:50 de:0 dec:45 dm:0 efficiency:100 interval:1h kwp:7.8 lat:***** lon:***** rossmodel:0.0342 template:open-meteo]
db:18 {Type:template Title:Nord-Ost (10 Stk. x 425W) Icon: Product:Open-Meteo} map[ac:1000 alphatemp:-0.004 az:-130 de:0 dec:45 dm:0 efficiency:100 interval:1h kwp:4.25 lat:***** lon:***** rossmodel:0.0342 template:open-meteo]
db:19 {Type:template Title: Icon: Product:SmartEnergy smartCONTROL} map[template:smartenergy]

loadpoint
---
db:3 {Type: Title: Icon: Product:} map[charger:db:2 circuit: defaultMode: meter: mode:off phasesConfigured:3 planStrategy:map[continuous:false precondition:0] soc:map[estimate:true poll:map[interval:3.6e+12 mode:charging]] thresholds:map[disable:map[delay:1.8e+11 threshold:0] enable:map[delay:6e+10 threshold:0]] title:go-e Charger ui:map[maxTemp:0 minTemp:0] vehicle:db:6]

Log details

Jul 11 18:22:05 solar-raspberry systemd[1]: evcc.service: Main process exited, code=exited, status=1/FAILURE
Jul 11 18:22:05 solar-raspberry systemd[1]: evcc.service: Failed with result 'exit-code'.
Jul 11 18:22:05 solar-raspberry systemd[1]: evcc.service: Consumed 29.673s CPU time.
Jul 11 18:22:15 solar-raspberry systemd[1]: evcc.service: Scheduled restart job, restart counter is at 2.
Jul 11 18:22:15 solar-raspberry systemd[1]: Stopped evcc.service - evcc.
Jul 11 18:22:15 solar-raspberry systemd[1]: evcc.service: Consumed 29.673s CPU time.
Jul 11 18:22:15 solar-raspberry systemd[1]: Started evcc.service - evcc.
Jul 11 18:22:23 solar-raspberry evcc[11904]: [main  ] INFO 2026/07/11 18:22:23 evcc 0.311.1
Jul 11 18:22:23 solar-raspberry evcc[11904]: [main  ] INFO 2026/07/11 18:22:23 config file not found, database-only mode
Jul 11 18:22:23 solar-raspberry evcc[11904]: [main  ] INFO 2026/07/11 18:22:23 using sqlite database: /var/lib/evcc/evcc.db?_pragma=busy_timeout(5000)&_pragma=foreign_keys(1)&_pragma=auto_vacuum(INCREMENTAL)
Jul 11 18:22:27 solar-raspberry evcc[11904]: [eebus ] INFO 2026/07/11 18:22:27 Local SKI: 8211e14c19c7fb5ec4ba9088cfa0fa90057ab55c
Jul 11 18:22:28 solar-raspberry evcc[11904]: [main  ] INFO 2026/07/11 18:22:28 OCPP local url:    ws://127.0.0.1:8887/<stationId>
Jul 11 18:22:28 solar-raspberry evcc[11904]: [main  ] INFO 2026/07/11 18:22:28 UI local url:      http://127.0.0.1:7070
Jul 11 18:22:33 solar-raspberry evcc[11904]: [main  ] FATAL 2026/07/11 18:22:33 failed booting site: not found: db:13
Jul 11 18:22:33 solar-raspberry evcc[11904]: [main  ] FATAL 2026/07/11 18:22:33 will attempt restart in: 15m0s

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

Linux

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

0.311.1

Metadata

Metadata

Assignees

Labels

uxUser experience/ interface

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions