evcc icon indicating copy to clipboard operation
evcc copied to clipboard

Amperfied WB connect.business RFID Tags werden binär gelesen

Open kallelix opened this issue 2 years ago • 0 comments

Describe the bug

Ich würde gerne die RFID Tags zur sicheren Identifizierung der Fahrzeuge nutzen und wollte die Tags per evcc charger auslesen. Ausgabe wie im log zu sehen. Das Vorgehen ist ja hier: https://docs.evcc.io/docs/guides/vehicles#erkennung-%C3%BCber-rfid-karten-und-andere-token beschrieben.

Ich bekomme hier allerdings den RFID Tag binäre in Zeichen gepresst und kann ihn so kaum in die yaml config kopieren. Laut Modbus Doku https://www.amperfied.de/wp-content/uploads/2023/06/Documentation-Modbus-Register-Layout-connect-series-20230623.pdf sind das 6 uint register. Also 12 byte. Ich würde hier als Fix gerne anregen das RFID Tag in eine string umzuwandeln, wie das beispielsweise beim keba charger gemacht wird:

// identify implements the api.Identifier interface
func (wb *Amperfied) Identify() (string, error) {
	b, err := wb.conn.ReadInputRegisters(ampRegRfidUID, 6)
	if err != nil {
		return "", err
	}

	id := hex.EncodeToString(b)
	if id == "000000000000" {
		id = ""
	}

	return id, nil
}

Steps to reproduce

  1. service evcc stop
  2. RFID Tag an Charger halten
  3. evcc charger ...

Configuration details

# 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: <id>

sponsortoken: <token>
interval: 10s # control cycle interval

tariffs:
  currency: EUR
  grid:
    type: fixed
    price: 0.3193
  feedin:
    type: fixed
    price: 0

vehicles:
- type: template
  template: id
  title: ID.Buzz
  user: <user>
  password: <pwd>
  vin: <fin>
  capacity: 77
  name: ev1
- type: template
  template: audi
  title: Audi etron 55
  user: <user>
  password: <pwd>
  vin: <fin>
  capacity: 86
  name: ev2
- type: template
  template: id
  title: VW Golf
  user: <user>
  password: <pwd>
  vin: <fin>
  capacity: 11
  name: ev3
- type: template
  template: seat
  title: Cupra
  user: <user>
  password: <pwd>
  capacity: 11
  name: ev4

meters:
- name: grid
  type: custom
  power:
    source: http
    uri: http://iobroker:8087/getPlainValue/smartmeter.0.1-0:16_7_0__255.value
    method: GET
- name: heatpump
  type: custom
  power:
    source: http
    uri: http://iobroker:8087/getPlainValue/modbus.0.inputRegisters.101.30053_Total_system_power
    method: GET
  energy:
    source: http
    uri: http://iobroker:8087/getPlainValue/modbus.0.inputRegisters.101.30343_Total_kwh
    method: GET

loadpoints:
- title: Parkplatz 3
  charger: wallbox3
  mode: now
- title: Parkplatz 4
  charger: wallbox4
  mode: now

chargers:
  - name: wallbox3
    type: template
    template: amperfied
    modbus: tcpip
    id: 255
    host: hdm-smart-connect-350cae # Hostname
    port: 502 # Port
  - name: wallbox4
    type: template
    template: amperfied
    modbus: tcpip
    id: 255
    host: hdm-smart-connect-3513ba # Hostname
    port: 502 # Port

site:
  title: EXOR PRO
  meters:
    grid: grid

Log details

:~ $ evcc charger
[main  ] INFO 2023/12/20 10:35:12 evcc 0.122.1
[main  ] INFO 2023/12/20 10:35:12 using config file: /etc/evcc.yaml
[db    ] INFO 2023/12/20 10:35:12 using sqlite database: /home/kallelix/.evcc/evcc.db
wallbox4
--------
Power:          1217W
Energy:         181.9kWh
Current L1..L3: 5.3A 0A 0A
Voltage L1..L3: 230V 235V 234V
Charge status:  C
Enabled:        true
Identifier:     ▒\%Z

wallbox3
--------
Power:          10861W
Energy:         302.6kWh
Current L1..L3: 15.6A 15.6A 15.6A
Voltage L1..L3: 229V 232V 232V
Charge status:  C
Enabled:        true
Identifier:     \▒h\

What type of operating system are you running?

Linux

Version

evcc version 0.122.1

kallelix avatar Dec 20 '23 09:12 kallelix