evcc-io / evcc

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

panic: interface conversion: *struct { api.Meter; api.MeterEnergy } is not api.Battery: missing method Soc goroutine #10210

Closed tdangschulz closed 11 months ago

tdangschulz commented 11 months ago

Describe the bug

Hi,

vorab erstmal vielen Dank für das coole Projekt.

Leider kann ich EVCC nicht starten, sobald ich eine Battery in der site Section aufnehme. Dann crash die Anwendung beim Starten.

Folgende Konfiguration habe ich:

Steps to reproduce

  1. Batterie in der Konfiguation aufnehmen
  2. Anwendung starten

Configuration details

network:
  schema: http
  host: evcc.local
  port: 7070

interval: 30s # control cycle interval

plant: xxx

log: debug
levels:
  site: debug
  lp-1: debug
  lp-2: debug
  cache: error
  db: error

meters:
  - name: grid
    type: template
    template: sungrow-hybrid
    usage: grid
    modbus: tcpip
    id: 1
    host: 192.168.42.167
    port: 502
  - name: pv
    type: template
    template: sungrow-hybrid
    usage: grid
    modbus: tcpip
    id: 1
    host: 192.168.42.167
    port: 502
  - name: battery
    type: template
    template: sungrow-hybrid
    usage: grid
    modbus: tcpip
    id: 1
    host: 192.168.42.167
    port: 502

chargers:
  - name: elli
    type: template
    template: ellipro
    ski: xxx
    ip: 192.168.42.82

vehicles:
  - name: id3
    type: template
    template: id
    title: ID.3
    user: xxx
    password: xxx
    vin: xxx
    capacity: 50
    targetSoc: 80

site:
  - title: Home # display name for UI
    meters:
      grid: grid
      pv: pv 
      battery: battery
    residualPower: 100
    bufferSoc: 80
    prioritySoc: 66
    bufferStartSoc: 80

loadpoints:
  - title: Garage # display name for UI
    charger: elli # charger
    mode: "pv" # set default charge mode, use "off" to disable by default if charger is publicly available
    vehicle: id3 # set default vehicle (disables vehicle detection)
    resetOnDisconnect: true # set defaults when vehicle disconnects
    minCurrent: 6 # minimum charge current (default 6A)
    maxCurrent: 16 # maximum charge current (default 16A)
    phases: 3

eebus:
  certificate:
    public: |
      -----BEGIN CERTIFICATE-----
      MIIBvjCCAWOgAwIBAgIRART+WMy3d0QdY8o86uC7GsYwCgYIKoZIzj0EAwIwPjEL
      MAkGA1UEBhMCREUxDTALBgNVBAoTBEVWQ0MxCTAHBgNVBAsTADEVMBMGA1UEAwwM
      RVZDQ19IRU1TXzAxMB4XDTIzMTAwNTIwNTcwMloXDTMzMTAwMjIwNTcwMlowPjEL
      MAkGA1UEBhMCREUxDTALBgNVBAoTBEVWQ0MxCTAHBgNVBAsTADEVMBMGA1UEAwwM
      RVZDQ19IRU1TXzAxMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE10uDtrX/4KXm
      TsZrzPQQcHwa5KYOtUX/oelrhpI1JDGMjxVZqA6Dh9RUXTEugXNq9b1cK4pWveUe
      2U92jlCC8qNCMEAwDgYDVR0PAQH/BAQDAgeAMA8GA1UdEwEB/wQFMAMBAf8wHQYD
      VR0OBBYEFFU3oXtnh0Ch4hsWLdRyOp3raxqHMAoGCCqGSM49BAMCA0kAMEYCIQDx
      VK+5zTej85abhxdO1PsG9jWCgtUkC7YZwScncQiBTgIhAP1yO1iKCH1SrQMUzvPy
      14c4pOB7IZONZSuxh4Qj7z2l
      -----END CERTIFICATE-----

    private: |
      -----BEGIN EC PRIVATE KEY-----
      xxx==
      -----END EC PRIVATE KEY-----

Log details

[eebus ] INFO 2023/10/06 10:59:55 Local SKI:  5537a17b678740a1e21b162dd4723a9deb6b1a87
[eebus ] DEBUG 2023/10/06 10:59:55 mdns: announce
[eebus ] DEBUG 2023/10/06 10:59:55 mdns: using zeroconf
[eebus ] DEBUG 2023/10/06 10:59:55 starting websocket server on :4712
[eebus ] DEBUG 2023/10/06 10:59:55 mdns: start search
[eebus ] DEBUG 2023/10/06 10:59:55 ski: f73e725f07b374cc9c331a51e50a27a87713b529 name: Elli-Wallbox-2109A184K0 brand: Elli model: Wallbox typ: Wallbox identifier: Elli-Wallbox-2109A184K0 register: false host: wallbox-2109A184K0.local. port: 4712 addresses: [192.168.42.82]
[eebus ] DEBUG 2023/10/06 10:59:55 delaying connection to f73e725f07b374cc9c331a51e50a27a87713b529 by 120ms to minimize double connection probability
[eebus ] DEBUG 2023/10/06 10:59:56 trying to connect to f73e725f07b374cc9c331a51e50a27a87713b529 at 192.168.42.82
[eebus ] DEBUG 2023/10/06 10:59:56 initiating connection to f73e725f07b374cc9c331a51e50a27a87713b529 at 192.168.42.82:4712
[eebus ] DEBUG 2023/10/06 10:59:56 Send:  read 1 NodeManagementDetailedDiscoveryData
[eebus ] DEBUG 2023/10/06 10:59:56 Recv: d:_i:47859_Elli-Wallbox-2109A184K0: to NodeManagement read 96 NodeManagementDetailedDiscoveryData
[eebus ] DEBUG 2023/10/06 10:59:56 Send: d:_i:47859_Elli-Wallbox-2109A184K0 reply 2 96 NodeManagementDetailedDiscoveryData
[eebus ] DEBUG 2023/10/06 10:59:56 Send: d:_i:47859_Elli-Wallbox-2109A184K0 result 3 96 ResultData 0
[eebus ] DEBUG 2023/10/06 10:59:56 Recv: d:_i:47859_Elli-Wallbox-2109A184K0: to NodeManagement reply 98 1 NodeManagementDetailedDiscoveryData
[eebus ] DEBUG 2023/10/06 10:59:56 Send:  call 4 NodeManagementSubscriptionRequestCall
[eebus ] DEBUG 2023/10/06 10:59:56 Send: d:_i:47859_Elli-Wallbox-2109A184K0 read 5 NodeManagementUseCaseData
[eebus ] DEBUG 2023/10/06 10:59:56 Send: d:_i:47859_Elli-Wallbox-2109A184K0 read 6 DeviceClassificationManufacturerData
[eebus ] DEBUG 2023/10/06 10:59:56 Send: d:_i:47859_Elli-Wallbox-2109A184K0 read 7 DeviceDiagnosisStateData
[eebus ] DEBUG 2023/10/06 10:59:56 ev connected
[eebus ] DEBUG 2023/10/06 10:59:56 Send: d:_i:47859_Elli-Wallbox-2109A184K0 call 8 NodeManagementSubscriptionRequestCall
[eebus ] DEBUG 2023/10/06 10:59:56 Send: d:_i:47859_Elli-Wallbox-2109A184K0 call 9 NodeManagementSubscriptionRequestCall
[eebus ] DEBUG 2023/10/06 10:59:56 Send: d:_i:47859_Elli-Wallbox-2109A184K0 call 10 NodeManagementSubscriptionRequestCall
[eebus ] DEBUG 2023/10/06 10:59:56 Send: d:_i:47859_Elli-Wallbox-2109A184K0 call 11 NodeManagementSubscriptionRequestCall
[eebus ] DEBUG 2023/10/06 10:59:56 Send: d:_i:47859_Elli-Wallbox-2109A184K0 call 12 NodeManagementSubscriptionRequestCall
[eebus ] DEBUG 2023/10/06 10:59:56 Send: d:_i:47859_Elli-Wallbox-2109A184K0 call 13 NodeManagementSubscriptionRequestCall
[eebus ] DEBUG 2023/10/06 10:59:56 Send: d:_i:47859_Elli-Wallbox-2109A184K0 call 14 NodeManagementSubscriptionRequestCall
[eebus ] DEBUG 2023/10/06 10:59:56 Send: d:_i:47859_Elli-Wallbox-2109A184K0 call 15 NodeManagementBindingRequestCall
[eebus ] DEBUG 2023/10/06 10:59:56 Send: d:_i:47859_Elli-Wallbox-2109A184K0 read 16 DeviceConfigurationKeyValueDescriptionListData
[eebus ] DEBUG 2023/10/06 10:59:56 Send: d:_i:47859_Elli-Wallbox-2109A184K0 read 17 DeviceClassificationManufacturerData
[eebus ] DEBUG 2023/10/06 10:59:56 Send: d:_i:47859_Elli-Wallbox-2109A184K0 read 18 DeviceDiagnosisStateData
[eebus ] DEBUG 2023/10/06 10:59:56 Send: d:_i:47859_Elli-Wallbox-2109A184K0 read 19 ElectricalConnectionDescriptionListData
[eebus ] DEBUG 2023/10/06 10:59:56 Send: d:_i:47859_Elli-Wallbox-2109A184K0 read 20 ElectricalConnectionParameterDescriptionListData
[eebus ] DEBUG 2023/10/06 10:59:56 Send: d:_i:47859_Elli-Wallbox-2109A184K0 read 21 MeasurementDescriptionListData
[eebus ] DEBUG 2023/10/06 10:59:56 Send: d:_i:47859_Elli-Wallbox-2109A184K0 read 22 LoadControlLimitDescriptionListData
[eebus ] DEBUG 2023/10/06 10:59:56 Send: d:_i:47859_Elli-Wallbox-2109A184K0 read 23 IdentificationListData
[eebus ] DEBUG 2023/10/06 10:59:56 Recv: d:_i:47859_Elli-Wallbox-2109A184K0: to NodeManagement call 101 NodeManagementSubscriptionRequestCall
[eebus ] DEBUG 2023/10/06 10:59:56 Send: d:_i:47859_Elli-Wallbox-2109A184K0 result 24 101 ResultData 0
[eebus ] DEBUG 2023/10/06 10:59:56 Recv: d:_i:47859_Elli-Wallbox-2109A184K0: to NodeManagement result 104 4 ResultData 0
[eebus ] DEBUG 2023/10/06 10:59:56 Recv: d:_i:47859_Elli-Wallbox-2109A184K0: to NodeManagement reply 107 5 NodeManagementUseCaseData
[eebus ] DEBUG 2023/10/06 10:59:56 Recv: d:_i:47859_Elli-Wallbox-2109A184K0: to DeviceClassification reply 109 6 DeviceClassificationManufacturerData
[eebus ] DEBUG 2023/10/06 10:59:56 Recv: d:_i:47859_Elli-Wallbox-2109A184K0: to Measurement notify 112 MeasurementListData
[eebus ] DEBUG 2023/10/06 10:59:56 Recv: d:_i:47859_Elli-Wallbox-2109A184K0: to DeviceDiagnosis reply 114 7 DeviceDiagnosisStateData
[eebus ] DEBUG 2023/10/06 10:59:56 Recv: d:_i:47859_Elli-Wallbox-2109A184K0: to NodeManagement result 116 8 ResultData 0
[eebus ] DEBUG 2023/10/06 10:59:56 Recv: d:_i:47859_Elli-Wallbox-2109A184K0: to ElectricalConnection notify 117 ElectricalConnectionPermittedValueSetListData
[eebus ] DEBUG 2023/10/06 10:59:56 Recv: d:_i:47859_Elli-Wallbox-2109A184K0: to NodeManagement result 120 9 ResultData 0
[eebus ] DEBUG 2023/10/06 10:59:56 Recv: d:_i:47859_Elli-Wallbox-2109A184K0: to ElectricalConnection notify 121 ElectricalConnectionPermittedValueSetListData
[eebus ] DEBUG 2023/10/06 10:59:56 Recv: d:_i:47859_Elli-Wallbox-2109A184K0: to NodeManagement result 124 10 ResultData 0
[eebus ] DEBUG 2023/10/06 10:59:56 Recv: d:_i:47859_Elli-Wallbox-2109A184K0: to NodeManagement result 126 11 ResultData 0
[eebus ] DEBUG 2023/10/06 10:59:56 Recv: d:_i:47859_Elli-Wallbox-2109A184K0: to ElectricalConnection notify 127 ElectricalConnectionPermittedValueSetListData
[eebus ] DEBUG 2023/10/06 10:59:56 Recv: d:_i:47859_Elli-Wallbox-2109A184K0: to NodeManagement result 130 12 ResultData 0
[eebus ] DEBUG 2023/10/06 10:59:57 Recv: d:_i:47859_Elli-Wallbox-2109A184K0: to NodeManagement result 137 13 ResultData 0
[eebus ] DEBUG 2023/10/06 10:59:57 Recv: d:_i:47859_Elli-Wallbox-2109A184K0: to NodeManagement result 138 14 ResultData 0
[eebus ] DEBUG 2023/10/06 10:59:57 f73e725f07b374cc9c331a51e50a27a87713b529 websocket read error:  websocket: close 1006 (abnormal closure): unexpected EOF
[eebus ] DEBUG 2023/10/06 10:59:57 restarting mdns search
[eebus ] DEBUG 2023/10/06 10:59:57 delaying connection to f73e725f07b374cc9c331a51e50a27a87713b529 by 200ms to minimize double connection probability
[eebus ] DEBUG 2023/10/06 10:59:57 ev disconnected
[eebus ] DEBUG 2023/10/06 10:59:57 trying to connect to f73e725f07b374cc9c331a51e50a27a87713b529 at 192.168.42.82
[eebus ] DEBUG 2023/10/06 10:59:57 initiating connection to f73e725f07b374cc9c331a51e50a27a87713b529 at 192.168.42.82:4712
[eebus ] DEBUG 2023/10/06 10:59:57 connection to f73e725f07b374cc9c331a51e50a27a87713b529 failed:  dial tcp 192.168.42.82:4712: connect: connection refused
[eebus ] DEBUG 2023/10/06 10:59:57 trying to connect to f73e725f07b374cc9c331a51e50a27a87713b529 at wallbox-2109A184K0.local.
[eebus ] DEBUG 2023/10/06 10:59:57 initiating connection to f73e725f07b374cc9c331a51e50a27a87713b529 at wallbox-2109A184K0.local.:4712
[eebus ] DEBUG 2023/10/06 10:59:57 connection to f73e725f07b374cc9c331a51e50a27a87713b529 failed: dial tcp 192.168.42.82:4712: connect: connection refused
[eebus ] DEBUG 2023/10/06 10:59:57 restarting mdns search
[eebus ] DEBUG 2023/10/06 10:59:57 delaying connection to f73e725f07b374cc9c331a51e50a27a87713b529 by 3.766s to minimize double connection probability
[site  ] WARN 2023/10/06 10:59:58 bufferStartSoc must be larger than bufferSoc
[site  ] INFO 2023/10/06 10:59:58 site config:
[site  ] INFO 2023/10/06 10:59:58   meters:      grid ✓ pv ✓ battery ✓
[site  ] INFO 2023/10/06 10:59:58     grid:      power ✓ energy ✓ currents ✗
[site  ] INFO 2023/10/06 10:59:58     pv 1:      power ✓ energy ✓ currents ✗
[site  ] INFO 2023/10/06 10:59:58     battery 1: power ✓ energy ✓ currents ✗ soc ✗ capacity ✗
[site  ] INFO 2023/10/06 10:59:58   vehicles:
[site  ] INFO 2023/10/06 10:59:58     vehicle 1: range ✓ finish ✓ status ✓ climate ✓ wakeup ✓
[lp-1  ] INFO 2023/10/06 10:59:58 loadpoint 1:
[lp-1  ] INFO 2023/10/06 10:59:58   mode:        pv
[lp-1  ] INFO 2023/10/06 10:59:58   charger:     power ✓ energy ✗ currents ✓ phases ✗ wakeup ✗
[lp-1  ] INFO 2023/10/06 10:59:58   meters:      charge ✓
[lp-1  ] INFO 2023/10/06 10:59:58     charge:    power ✓ energy ✗ currents ✓
[lp-1  ] DEBUG 2023/10/06 10:59:58 phase timer inactive
[lp-1  ] DEBUG 2023/10/06 10:59:58 pv timer inactive
[lp-1  ] DEBUG 2023/10/06 10:59:58 guard timer inactive
[lp-1  ] INFO 2023/10/06 10:59:58 vehicle updated: unknown -> ID.3
[lp-1  ] DEBUG 2023/10/06 10:59:58 set target soc: 80
[site  ] DEBUG 2023/10/06 10:59:58 ----
[lp-1  ] DEBUG 2023/10/06 10:59:58 charge power: 0W
[site  ] DEBUG 2023/10/06 10:59:58 pv power: 5W
panic: interface conversion: *struct { api.Meter; api.MeterEnergy } is not api.Battery: missing method Soc
goroutine 151 [running]:
github.com/evcc-io/evcc/core.(*Site).updateMeters(0xc0002cf800)
    github.com/evcc-io/evcc/core/site.go:489 +0x1585
github.com/evcc-io/evcc/core.(*Site).sitePower(0xc0002cf800, 0x0, 0x0)
    github.com/evcc-io/evcc/core/site.go:583 +0x67
github.com/evcc-io/evcc/core.(*Site).update(0xc0002cf800, {0x3429d38?, 0xc000b16000})
    github.com/evcc-io/evcc/core/site.go:764 +0x405
github.com/evcc-io/evcc/core.(*Site).Run(0xc0002cf800, 0xc000c363c0, 0x6fc23ac00)
    github.com/evcc-io/evcc/core/site.go:863 +0x206
github.com/evcc-io/evcc/cmd.runRoot.func4()
    github.com/evcc-io/evcc/cmd/root.go:282 +0x25
created by github.com/evcc-io/evcc/cmd.runRoot in goroutine 1
    github.com/evcc-io/evcc/cmd/root.go:281 +0x1a13

What type of operating system are you running?

HomeAssistant Add-on

Version

0.120.3

VolkerK62 commented 11 months ago
 - name: battery
    type: template
    template: sungrow-hybrid
    usage: grid
    modbus: tcpip
    id: 1
    host: 192.168.42.167
    port: 502

dann solltest du bei der Batterie auch usage: battery nehmen und nicht usage: grid

tdangschulz commented 11 months ago

danke! Das war wohl ganz klar mein Fehler :-)

andig commented 11 months ago

Das panic ist allerdings trotzdem unschön- das geht bestimmt verträglicher.

andig commented 11 months ago

Closed in https://github.com/evcc-io/evcc/commit/ea90578dfe364da4632d08d338d5f96767203941