evcc icon indicating copy to clipboard operation
evcc copied to clipboard

Config UI: improve loadpoint creating flow (abort, cleanup)

Open StefanR71 opened this issue 2 months ago • 1 comments

Describe the bug

Wenn man in der GUI einen neuen Ladepunkt erstellt, die Wallbox hinzugefügt hat und dann aus versehen im gleichen Browser-Fenster neben den Eingabedialog klickt, dann wird das Fenster geschlossen und alle Eingaben sind verloren. Weiter kann es dann auch passieren, dass eine neue Wallbox in der DB angelegt wurde, diese dann aber als Leiche (DB:16) zurück bleibt.

Ggf. müsste man im Dialog auch eine bereits angelegte Wallbox auswählen können, aktuell legt man dann beim neuen Versuch eine neue (doppelt) an.

Oder besser es müsste eine Abfrage kommen, ob man die Eingaben verwerfen möchte. Oder beides...

Steps to reproduce

1.In der GUI neue Wallbox anwählen, neuen Ladepunkt erstellen, Namen vergeben, Wallbox hinzufügen, alle Daten angeben, Überprüfen und speichern wählen. 2. Nun mal neben dem Eingabedialog klicken, weil man z.B. mal in einem anderen Fenster war und dieses wieder aktivieren möchte, dann wird der Dialog geschlossen und man denkt alle Eingaben sind verworfen und beginnt von vorn. 3. Dadurch entstehen aber doppelte DB Einträge ...

Configuration details

[main  ] INFO 2025/10/11 11:57:26 using config file: /etc/evcc.yaml
charger
---
db:8 {Type:template Title: Icon: Product:Cupra Charger Connect 2} map[ip:192.168.77.72 ski:7928f603646c051a0456aaaddb2c843f3e5678cd template:elli-2]
db:14 {Type:template Title: Icon: Product:TinkerForge WARP3 Charger Pro} map[host:192.168.77.46 port:1883 template:tinkerforge-warp3 timeout:30s topic:warp/garage-links]
db:16 {Type:template Title: Icon: Product:TinkerForge WARP3 Charger Pro} map[host:192.168.77.46 port:1883 template:tinkerforge-warp3 timeout:30s topic:warp/garage-links]

meter
---
db:3 {Type:template Title:sonnenBatterie Icon: Product:Sonnen sonnenBatterie} map[capacity:40 defaultmode:self-consumption host:192.168.77.100 maxchargepower:8000 port:80 template:sonnenbatterie token:***** usage:battery]
db:4 {Type:template Title:PV Anlage West Icon: Product:Kostal Piko} map[host:192.168.77.54 template:kostal-piko-pv usage:pv]
db:5 {Type:template Title:PV Anlage Süd Icon: Product:Kostal Piko} map[host:192.168.77.53 template:kostal-piko-pv usage:pv]

vehicle
---
db:10 {Type:template Title: Icon: Product:Seat CupraConnect Gen4 (Born, Formentor, Tavascan)} map[cache:3e+11 capacity:77 icon:car maxCurrent:16 minCurrent:6 mode:pv password:***** phases: template:cupra title:Cupra Tavascan user:***** vin:***** welcomecharge:true]
db:11 {Type:custom Title: Icon: Product:} map[yaml:title: Seat Mii
icon: car
capacity: 32
phases: 2
soc:
  source: mqtt
  topic: mii/soc
range:
  source: mqtt
  topic: mii/range
odometer:
  source: mqtt
  topic: mii/odometer]
db:12 {Type:template Title: Icon: Product:Generisches Fahrzeug (ohne API)} map[icon:car maxCurrent:16 minCurrent:6 mode:pv phases: template:offline title:Gast welcomecharge:true]

loadpoint
---
db:9 {Type: Title: Icon: Product:} map[charger:db:8 circuit:wallboxen defaultMode:pv limitSoc:0 maxCurrent:16 meter: mode:pv phasesConfigured:3 soc:map[estimate:false poll:map[interval:6e+10 mode:always]] thresholds:map[disable:map[delay:1.8e+11 threshold:0] enable:map[delay:6e+10 threshold:0]] title:Garage rechts vehicle:db:11]
db:15 {Type: Title: Icon: Product:} map[charger:db:14 circuit:wallboxen defaultMode:pv limitSoc:0 meter: mode:pv phasesConfigured:0 soc:map[estimate:true poll:map[interval:9e+11 mode:always]] thresholds:map[disable:map[delay:1.8e+11 threshold:0] enable:map[delay:6e+10 threshold:0]] title:Garage links vehicle:db:10]

Log details

Ich denke keine Logs erforderlich, wenn doch, dann müsste ich wissen von welchem Bereich.

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

Linux

External automation

  • [x] 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

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

Version

evcc version 0.209.1 (57f74ecc2)

StefanR71 avatar Oct 11 '25 10:10 StefanR71

Yes, good point. We should introduce a confirm dialog if you're dismissing a modal you've made unsaved changes in.

The other point is cleaning up chargers and charger meters when the users deliberately aborts the loadpoint creation process. We can't ensure this 100%, since the user can close the browser half way. But when we know, we can and should clean up.

The orphaned chargers or charger meters should not cause any problems. These are only instantiated on startup if they are a associated to a loadpoint (@andig).

naltatis avatar Oct 11 '25 11:10 naltatis