evcc-io / evcc

Solar Charging ☀️🚘
https://evcc.io
MIT License
3.67k stars 688 forks source link

identifiers not working with templates #2036

Closed Chris591 closed 2 years ago

Chris591 commented 2 years ago

Describe the bug Autos können nicht identifiziert werden mit identifiers wenn über templetes konfiguriert

To Reproduce Steps to reproduce the behavior:

vehicles:
- type: template
  template: ford
...
  identifiers:
    - 123456AB

Expected behavior Sollte genauso funktionieren wie mit type: ford

EVCC details: Show output of evcc -v:

evcc version 0.73.1639362857.1639362857 (cd43f09)
Show output of evcc dump -c configfile:
[main  ] INFO 2021/12/13 12:35:05 evcc 0.73.1639362857.1639362857 (cd43f09)
[main  ] INFO 2021/12/13 12:35:05 using config file /etc/evcc.yaml
[mqtt  ] INFO 2021/12/13 12:35:05 connecting evcc-1225036323 at tcp://10.201.1.10:1883
config
======

grid: grid
----------
Power: -51W

pv 0: pv1
---------
Power: 830W

Battery 0: battery1
-------------------
Power: -0W
SoC:   3%

loadpoint 1
===========

charger: Einfahrt
-----------------
Power:          0W
Energy:         1699.4kWh
Current L1..L3: 0A 0A 0A
Charge status:  B
Enabled:        false
Duration:       34s
Identifier:     123456AB

vehicle 0
---------
.SoC:     vehicle not available: cannot create vehicle 'template': template: yaml:2:2: executing "yaml" at : error calling include: template: yaml:39:12: executing "vehicle-common" at <.identifiers>: range can't iterate over '[123456AB]'
Capacity: 0kWh

vehicle 1
---------
.SoC:     vehicle not available: cannot create vehicle 'template': template: yaml:2:2: executing "yaml" at : error calling include: template: yaml:39:12: executing "vehicle-common" at <.identifiers>: range can't iterate over '[234567AB]'
Capacity: 0kWh

loadpoint 2
===========

charger: Garage
---------------
Power:          0W
Energy:         237.9kWh
Current L1..L3: 0A 0A 0A
Charge status:  B
Enabled:        false
Duration:       0s

vehicle 0
---------
.SoC:     vehicle not available: cannot create vehicle 'template': template: yaml:2:2: executing "yaml" at : error calling include: template: yaml:39:12: executing "vehicle-common" at <.identifiers>: range can't iterate over '[123456AB]'
Capacity: 0kWh

vehicle 1
---------
.SoC:     vehicle not available: cannot create vehicle 'template': template: yaml:2:2: executing "yaml" at : error calling include: template: yaml:39:12: executing "vehicle-common" at <.identifiers>: range can't iterate over '[234567AB]'
Capacity: 0kWh

Show evcc configuration file evcc.yaml:
interval: 10s # control cycle interval
uri: 0.0.0.0:7070 # uri for ui

log: info

meters:
- type: template
  template: e3dc
  usage: grid 
  host: x.x.x.x 
  port: 502 
  name: grid
- type: template
  template: e3dc
  usage: pv 
  host: x.x.x.x 
  port: 502 
  name: pv1
- type: template
  template: e3dc
  usage: battery 
  host: x.x.x.x 
  port: 502 
  name: battery1

chargers:
- type: template
  template: evsewifi
  host: x.x.x.x 
  name: Garage
- type: template
  template: evsewifi
  host: x.x.x.x 
  name: Einfahrt

vehicles:
- type: template
  template: ford
#- type: ford
  title: Mustang Mach-e 
  user: xxx 
  password: 'xxx' 
  vin: VIN 
  capacity: 88 
  name: Mustang
  identifiers:
    - 123456AB # Roter RFID token ID
#  onIdentify:
  mode: "pv"
  minSoC: 20
  targetSoC: 80
  minCurrent: 6
  maxCurrent: 16
- type: template
  template: seat
#- type: seat
  title: Cupra Leon 
  user: xxx 
  password: xxx 
  vin: VIN 
  capacity: 11 
  name: Cupra
  identifiers:
    - 234567AB # Blauer RFID token ID
#  onIdentify: # set defaults when vehicle is identified
  mode: "pv"
  minSoC: 50 # charge to at least 20% independent of charge mode
  targetSoC: 100 # limit charge to 90%
  minCurrent: 6
  maxcurrent: 16

loadpoints:
- title: Einfahrt
  charger: Einfahrt
  vehicles:
    - Mustang
    - Cupra
  mode: off
  phases: 3
  mincurrent: 6
  maxcurrent: 16
- title: Garage
  charger: Garage
  vehicles:
    - Mustang
    - Cupra
  mode: off
  phases: 3
  mincurrent: 6
  maxcurrent: 16

site:
  title: Home
  meters:
    grid: grid
    pvs:
    - pv1
    batteries:
    - battery1
  prioritySoC: 20 # give home battery priority up to this soc (0 to disable)

# mqtt message broker
mqtt:
  broker: x.x.x.x:1883
  topic: evcc # root topic for publishing, set empty to disable
  user: xxx
  password: XXX

# influx database
influx:
  url: http://x.x.x.x:8086
  database: evcc
  user: xxx
  password: XXX

# push messages
messaging:
  events:
    start: # charge start event
      title: Charge started
      msg: Started charging in "${mode}" mode
    stop: # charge stop event
      title: Charge finished
      msg: Finished charging ${chargedEnergy:%.1fk}kWh in ${chargeDuration}.
    connect: # vehicle connect event
      title: Car connected
      msg: "Car connected at ${pvPower:%.1fk}kW PV"
    disconnect: # vehicle connected event
      title: Car disconnected
      msg: Car disconnected after ${connectedDuration}
  services:

Show evcc log output with --log debug:
[main  ] INFO 2021/12/13 12:41:36 evcc 0.73.1639362857.1639362857 (cd43f09)
[main  ] INFO 2021/12/13 12:41:36 using config file /etc/evcc.yaml
[main  ] INFO 2021/12/13 12:41:36 listening at 0.0.0.0:7070
[mqtt  ] INFO 2021/12/13 12:41:36 connecting evcc-378802638 at tcp://10.201.1.10:1883
[mqtt  ] DEBUG 2021/12/13 12:41:36 tcp://10.201.1.10:1883 connected
[cache ] DEBUG 2021/12/13 12:41:36 title: Einfahrt
[cache ] DEBUG 2021/12/13 12:41:36 minCurrent: 6
[cache ] DEBUG 2021/12/13 12:41:36 maxCurrent: 16
[cache ] DEBUG 2021/12/13 12:41:36 phases: 3
[cache ] DEBUG 2021/12/13 12:41:36 activePhases: 3
[cache ] DEBUG 2021/12/13 12:41:36 hasVehicle: true
[cache ] DEBUG 2021/12/13 12:41:36 mode: 0
[cache ] DEBUG 2021/12/13 12:41:36 targetSoC: 100
[cache ] DEBUG 2021/12/13 12:41:36 minSoC: 0
[cache ] DEBUG 2021/12/13 12:41:36 title: Garage
[cache ] DEBUG 2021/12/13 12:41:36 minCurrent: 6
[cache ] DEBUG 2021/12/13 12:41:36 maxCurrent: 16
[cache ] DEBUG 2021/12/13 12:41:36 phases: 3
[cache ] DEBUG 2021/12/13 12:41:36 activePhases: 3
[cache ] DEBUG 2021/12/13 12:41:36 hasVehicle: true
[cache ] DEBUG 2021/12/13 12:41:36 mode: 0
[cache ] DEBUG 2021/12/13 12:41:36 targetSoC: 100
[cache ] DEBUG 2021/12/13 12:41:36 minSoC: 0
[site  ] INFO 2021/12/13 12:41:36 site config:
[site  ] INFO 2021/12/13 12:41:36   meters:    grid ✓ pv ✓ battery ✓
[cache ] DEBUG 2021/12/13 12:41:36 siteTitle: Home
[site  ] INFO 2021/12/13 12:41:36     grid:    power ✓ energy ✗ currents ✗
[site  ] INFO 2021/12/13 12:41:36     pv 0:    power ✓ energy ✗ currents ✗
[site  ] INFO 2021/12/13 12:41:36     battery 0: power ✓ energy ✗ currents ✗ soc ✓
[cache ] DEBUG 2021/12/13 12:41:36 gridConfigured: true
[cache ] DEBUG 2021/12/13 12:41:36 pvConfigured: true
[cache ] DEBUG 2021/12/13 12:41:36 batteryConfigured: true
[cache ] DEBUG 2021/12/13 12:41:36 prioritySoC: 20
[lp-1  ] INFO 2021/12/13 12:41:36 loadpoint 1:
[lp-1  ] INFO 2021/12/13 12:41:36   mode:      0
[lp-1  ] INFO 2021/12/13 12:41:36   charger:   power ✓ energy ✓ currents ✓ timer ✓
[lp-1  ] INFO 2021/12/13 12:41:36   meters:    charge ✓
[lp-1  ] INFO 2021/12/13 12:41:36     charge:  power ✓ energy ✓ currents ✓
[cache ] DEBUG 2021/12/13 12:41:36 chargeConfigured: true
[lp-1  ] INFO 2021/12/13 12:41:36   vehicles:  ✓
[lp-1  ] INFO 2021/12/13 12:41:36     car 0:   range ✗ finish ✗ status ✗ climate ✗
[lp-1  ] INFO 2021/12/13 12:41:36     car 1:   range ✗ finish ✗ status ✗ climate ✗
[lp-2  ] INFO 2021/12/13 12:41:36 loadpoint 2:
[lp-2  ] INFO 2021/12/13 12:41:36   mode:      0
[lp-2  ] INFO 2021/12/13 12:41:36   charger:   power ✓ energy ✓ currents ✓ timer ✓
[lp-2  ] INFO 2021/12/13 12:41:36   meters:    charge ✓
[lp-2  ] INFO 2021/12/13 12:41:36     charge:  power ✓ energy ✓ currents ✓
[lp-2  ] INFO 2021/12/13 12:41:36   vehicles:  ✓
[lp-2  ] INFO 2021/12/13 12:41:36     car 0:   range ✗ finish ✗ status ✗ climate ✗
[lp-2  ] INFO 2021/12/13 12:41:36     car 1:   range ✗ finish ✗ status ✗ climate ✗
[site  ] DEBUG 2021/12/13 12:41:36 ----
[cache ] DEBUG 2021/12/13 12:41:36 chargeConfigured: true
[site  ] DEBUG 2021/12/13 12:41:36 pv power: 684W
[cache ] DEBUG 2021/12/13 12:41:36 pvPower: 684
[site  ] DEBUG 2021/12/13 12:41:36 grid power: 809W
[cache ] DEBUG 2021/12/13 12:41:36 gridPower: 809
[site  ] DEBUG 2021/12/13 12:41:36 battery power: 0W
[cache ] DEBUG 2021/12/13 12:41:36 batteryPower: 0
[site  ] DEBUG 2021/12/13 12:41:36 battery soc 0: 3%
[site  ] DEBUG 2021/12/13 12:41:36 site power: 809W
[cache ] DEBUG 2021/12/13 12:41:36 batterySoC: 3
[cache ] DEBUG 2021/12/13 12:41:36 mode: 0
[lp-1  ] DEBUG 2021/12/13 12:41:36 charge power: 0W
[cache ] DEBUG 2021/12/13 12:41:36 chargePower: 0
[lp-1  ] DEBUG 2021/12/13 12:41:36 charge currents: [0 0 0]A
[cache ] DEBUG 2021/12/13 12:41:36 chargeCurrents: [0 0 0]
[cache ] DEBUG 2021/12/13 12:41:36 chargeCurrent: 0
[cache ] DEBUG 2021/12/13 12:41:36 chargedEnergy: 0
[cache ] DEBUG 2021/12/13 12:41:36 chargeDuration: 34s
[lp-1  ] DEBUG 2021/12/13 12:41:36 charger status: B
[cache ] DEBUG 2021/12/13 12:41:36 connectedDuration: 0s
[cache ] DEBUG 2021/12/13 12:41:36 chargeCurrent: 0
[cache ] DEBUG 2021/12/13 12:41:36 connected: true
[cache ] DEBUG 2021/12/13 12:41:36 charging: false
[cache ] DEBUG 2021/12/13 12:41:36 enabled: false
[lp-1  ] DEBUG 2021/12/13 12:41:36 charger vehicle id: 123456AB
[cache ] DEBUG 2021/12/13 12:41:36 vehicleIdentity: 123456AB
[lp-1  ] WARN 2021/12/13 12:41:36 target charging: not possible
[lp-1  ] DEBUG 2021/12/13 12:41:37 charge power: 0W
[cache ] DEBUG 2021/12/13 12:41:37 chargePower: 0
[lp-1  ] DEBUG 2021/12/13 12:41:37 charge currents: [0 0 0]A
[cache ] DEBUG 2021/12/13 12:41:37 homePower: 1493
[cache ] DEBUG 2021/12/13 12:41:37 chargeCurrents: [0 0 0]
[site  ] DEBUG 2021/12/13 12:41:46 ----
[site  ] DEBUG 2021/12/13 12:41:46 pv power: 690W
[cache ] DEBUG 2021/12/13 12:41:46 pvPower: 690
[site  ] DEBUG 2021/12/13 12:41:46 grid power: 829W
[cache ] DEBUG 2021/12/13 12:41:46 gridPower: 829
[site  ] DEBUG 2021/12/13 12:41:46 battery power: 0W
[cache ] DEBUG 2021/12/13 12:41:46 batteryPower: 0
[site  ] DEBUG 2021/12/13 12:41:46 battery soc 0: 3%
[site  ] DEBUG 2021/12/13 12:41:46 site power: 829W
[cache ] DEBUG 2021/12/13 12:41:46 batterySoC: 3
[cache ] DEBUG 2021/12/13 12:41:46 mode: 0
[lp-2  ] DEBUG 2021/12/13 12:41:46 charge power: 0W
[cache ] DEBUG 2021/12/13 12:41:46 chargePower: 0
[lp-2  ] DEBUG 2021/12/13 12:41:46 charge currents: [0 0 0]A
[cache ] DEBUG 2021/12/13 12:41:46 chargeCurrents: [0 0 0]
[cache ] DEBUG 2021/12/13 12:41:46 chargeCurrent: 0
[cache ] DEBUG 2021/12/13 12:41:46 chargedEnergy: 0
[cache ] DEBUG 2021/12/13 12:41:46 chargeDuration: 0s
[lp-2  ] DEBUG 2021/12/13 12:41:46 charger status: B
[cache ] DEBUG 2021/12/13 12:41:46 connectedDuration: 0s
[cache ] DEBUG 2021/12/13 12:41:46 chargeCurrent: 0
[cache ] DEBUG 2021/12/13 12:41:46 connected: true
[cache ] DEBUG 2021/12/13 12:41:46 charging: false
[cache ] DEBUG 2021/12/13 12:41:46 enabled: false
[lp-2  ] WARN 2021/12/13 12:41:46 target charging: not possible
[lp-2  ] DEBUG 2021/12/13 12:41:47 charge power: 0W
[cache ] DEBUG 2021/12/13 12:41:47 chargePower: 0
[lp-2  ] DEBUG 2021/12/13 12:41:47 charge currents: [0 0 0]A
[cache ] DEBUG 2021/12/13 12:41:47 homePower: 1519
[cache ] DEBUG 2021/12/13 12:41:47 chargeCurrents: [0 0 0]

If using Docker: Show output of docker run andig/evcc -v:

<- paste here
Show evcc log output with docker logs :
<- paste here

DerAndereAndi commented 2 years ago

Danke nochmal für den Hinweis! Der fix ist morgen im nightly build drin.

Chris591 commented 2 years ago

Ihr seit einfach Klasse vielen Danke das ihr euch so schnell auf alle Probleme stürzt und sie löst egal ob diese vor dem Bildschirm sind oder doch manchmal auf in der Software!! - Hoffe jetzt kommt auch mal die Sonne raus das ich es auch mal wirklich nutzen kann.

Chris591 commented 2 years ago

Wollte nur bescheid geben es läuft jetzt so wie erwartet!! Danke