evcc-io / evcc

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

Sonderzeichen im Admin Passwort #14241

Closed Mestro82 closed 3 months ago

Mestro82 commented 3 months ago

Describe the bug

Hallo zusammen, ich habe eine Passwort mit dem Zeichen @ verwendet. Allerdings kann ich mich damit nicht einloggen und auch Set oder Reset funktioniert nicht. Auch im Log kann ich den Vorgang Reset nicht sehen. Führt das "Sonderzeichen" zu Problemen?

Steps to reproduce

  1. Set um neues PW einzugeben (mehrmals)
  2. Reset (mehrmals) -> es kommt keine Abfrage bei GUI Start

Configuration details

# unique installation id
plant: abc

network:
  # schema is the HTTP schema
  # setting to `https` does not enable https, it only changes the way URLs are generated
  schema: http
  # host is the hostname or IP address
  # if the host name contains a `.local` suffix, the name will be announced on MDNS
  # docker: MDNS announcements don't work. host must be set to the docker host's name.
  host: evcc.local
  # port is the listening port for UI and api
  # evcc will listen on all available interfaces
  port: 7070

interval: 30s # control cycle interval. Interval <30s can lead to unexpected behavior, see https://docs.evcc.io/docs/reference/configuration/interval

# database configuration for persisting charge sessions and settings
# database:
#   type: sqlite
#   dsn: <path-to-db-file>

# sponsor token enables optional features (request at https://sponsor.evcc.io)
# sponsortoken:

# telemetry enables aggregated statistics
#
# Telemetry allows collecting usage data (grid and green energy, charge power).
# Data is aggregated, no individual charging sessions are tracked. The collected,
# anonymous data can be retrieved using https://api.evcc.io.
#
# See https://github.com/evcc-io/evcc/pull/4343 or details.
#
# For time being, this is only available to sponsors, hence data is associated with
# the sponsor token's identity.
#
# telemetry: true

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

# modbus proxy for allowing external programs to reuse the evcc modbus connection
# each entry will start a proxy instance at the given port speaking Modbus TCP and
# relaying to the given modbus downstream device (either TCP or RTU, RS485 or TCP)
modbusproxy:
  #  - port: 5200
  #    uri: solar-edge:502
  #    # rtu: true
  #    # readonly: true # use `deny` to raise modbus errors

# meter definitions
# name can be freely chosen and is used as reference when assigning meters to site and loadpoints
# for documentation see https://docs.evcc.io/docs/devices/meters

meters:
  - name: my_pv
    type: template
    template: kostal-plenticore
    usage: pv

    # Modbus TCP
    modbus: tcpip
    id: 71
    host: 192.168.100.100 # Hostname
    port: 1502 # Port 

  - name: my_grid
    type: template
    template: kostal-ksem-inverter
    usage: grid

    # Modbus TCP
    modbus: tcpip
    id: 71
    host: 192.168.100.100 # Hostname
    port: 1502 # Port 

  - name: my_battery
    type: template
    template: kostal-plenticore
    usage: battery

    # Modbus TCP
    modbus: tcpip
    id: 71
    host: 192.168.100.100 # Hostname
    port: 1502 # Port 

# charger definitions
# name can be freely chosen and is used as reference when assigning charger to vehicle
# for documentation see https://docs.evcc.io/docs/devices/chargers
chargers:
  - name: my_charger
    type: custom
    status: # charger status A..F
      source: script
      cmd: /bin/sh -c 'echo b'
    enabled: # charger enabled state (true/false or 0/1)
      source: script
      cmd: /bin/sh -c 'echo false'
    enable: # set charger enabled state (true/false or 0/1)
      source: script
      cmd: /bin/sh -c 'echo false'
    maxcurrent: # set charger max current (A)
      source: script
      cmd: /bin/sh -c 'echo 10'

# vehicle definitions
# name can be freely chosen and is used as reference when assigning vehicle to loadpoint
# for documentation see https://docs.evcc.io/docs/devices/vehicles
vehicles:
  - name: my_car
    type: template
    icon: car
    template: offline
    title: Auto # Wird in der Benutzeroberfläche angezeigt (optional)
    capacity: 38 # Akkukapazität in kWh (optional)

# site describes the EVU connection, PV and home battery
site:
  title: Ringstraße # display name for UI
  meters:
    grid: my_grid # grid meter
    pv:
      - my_pv # list of pv inverters/ meters
    battery:
      - my_battery # list of battery meters
  residualPower: 100 # additional household usage margin
  maxGridSupplyWhileBatteryCharging: 0 # ignore battery charging if AC consumption is above this value
# loadpoint describes the charger, charge meter and connected vehicle
loadpoints:
  - title: Garage # display name for UI
    charger: my_charger # charger
    vehicle: my_car
    mode: pv # default charge mode to apply when vehicle is disconnected; use "off" to disable by default if charger is publicly available

    # remaining settings are experts-only and best left at default values
    priority: 0 # relative priority for concurrent charging in PV mode with multiple loadpoints (higher values have higher priority)
    soc:
      # polling defines usage of the vehicle APIs
      # Modifying the default settings it NOT recommended. It MAY deplete your vehicle's battery
      # or lead to vehicle manufacturer banning you from API use. USE AT YOUR OWN RISK.
      poll:
        # poll mode defines under which condition the vehicle API is called:
        #   charging: update vehicle ONLY when charging (this is the recommended default)
        #   connected: update vehicle when connected (not only charging), interval defines how often
        #   always: always update vehicle regardless of connection state, interval defines how often (only supported for single vehicle)
        mode: charging
        # poll interval defines how often the vehicle API may be polled if NOT charging
        interval: 60m
      estimate: true # set false to disable interpolating between api updates (not recommended)
    enable: # pv mode enable behavior
      delay: 1m # threshold must be exceeded for this long
      threshold: 0 # grid power threshold (in Watts, negative=export). If zero, export must exceed minimum charge power to enable
    disable: # pv mode disable behavior
      delay: 3m # threshold must be exceeded for this long
      threshold: 0 # maximum import power (W)

# tariffs are the fixed or variable tariffs
tariffs:
  currency: EUR # three letter ISO-4217 currency code (default EUR)
  grid:
    # either static grid price (or price zones)
    type: fixed
    price: 0.358 # EUR/kWh 

  feedin:
    # rate for feeding excess (pv) energy to the grid
    type: fixed
    price: 0.0618 # EUR/kWh

  co2:
    # co2 tariff provides co2 intensity forecast and is for co2-optimized target charging if no variable grid tariff is specified
    # type: grünstromindex # GrünStromIndex (Germany only)
    # zip: <zip>

    # type: electricitymaps # https://app.electricitymaps.com/map
    # uri: <uri>
    # token: <token> # needs to be a token with forecast (not in the free tier)
    # zone: DE

    # type: ngeso # National Grid Electricity System Operator data (Great Britain only) https://carbonintensity.org.uk/
    # provides national data if both region and postcode are omitted - Choose ONE only!
    # region: 1 # optional, coarser than using a postcode - The region details are at https://carbon-intensity.github.io/api-definitions/#region-list
    # postcode: SW1 # optional - Outward postcode i.e. RG41 or SW1 or TF8. Do not include full postcode, outward postcode only

# 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}
    soc: # vehicle soc update event
      title: Soc updated
      msg: Battery charged to ${vehicleSoc:%.0f}%
    guest: # vehicle could not be identified
      title: Unknown vehicle
      msg: Unknown vehicle, guest connected?
#  services:
  # - type: pushover
  #   app: # app id
  #   recipients:
  #   - # list of recipient ids
  # - type: telegram
  #   token: # bot id
  #   chats:
  #   - # list of chat ids
  # - type: email
  #   uri: smtp://<user>:<password>@<host>:<port>/?fromAddress=<from>&toAddresses=<to>
  # - type: ntfy
  #   uri: https://<host>/<topics>
  #   priority: <priority>
  #   tags: <tags>
#- type: script
#  cmdline: /home/pi/sendSignalMessage.sh
#  timeout: 50s

Log details

pi@raspi:~ $ sudo journalctl -fau evcc
Jun 08 07:41:16 raspi evcc[47659]: [site  ] DEBUG 2024/06/08 07:41:16 pv power: 1769W
Jun 08 07:41:17 raspi evcc[47659]: [site  ] DEBUG 2024/06/08 07:41:17 battery soc: 28%
Jun 08 07:41:17 raspi evcc[47659]: [site  ] DEBUG 2024/06/08 07:41:17 battery power: -669W
Jun 08 07:41:17 raspi evcc[47659]: [site  ] DEBUG 2024/06/08 07:41:17 grid meter: 273011920377292420808704W
Jun 08 07:41:17 raspi evcc[47659]: [site  ] DEBUG 2024/06/08 07:41:17 site power: 273011920377292420808704W
Jun 08 07:41:17 raspi evcc[47659]: [lp-1  ] DEBUG 2024/06/08 07:41:17 charger status: B
Jun 08 07:41:17 raspi evcc[47659]: [lp-1  ] INFO 2024/06/08 07:41:17 car connected
Jun 08 07:41:17 raspi evcc[47659]: [lp-1  ] DEBUG 2024/06/08 07:41:17 pv timer elapse
Jun 08 07:41:17 raspi evcc[47659]: [lp-1  ] DEBUG 2024/06/08 07:41:17 pv timer inactive
Jun 08 07:41:17 raspi evcc[47659]: [site  ] DEBUG 2024/06/08 07:41:17 set battery mode: normal
Jun 08 07:41:44 raspi systemd[1]: Stopping evcc.service - evcc...
Jun 08 07:41:44 raspi systemd[1]: evcc.service: Deactivated successfully.
Jun 08 07:41:44 raspi systemd[1]: Stopped evcc.service - evcc.
Jun 08 07:41:59 raspi systemd[1]: Started evcc.service - evcc.
Jun 08 07:42:00 raspi evcc[47725]: [main  ] INFO 2024/06/08 07:42:00 evcc 0.126.6
Jun 08 07:42:00 raspi evcc[47725]: [main  ] INFO 2024/06/08 07:42:00 using config file: /etc/evcc.yaml
Jun 08 07:42:00 raspi evcc[47725]: [main  ] INFO 2024/06/08 07:42:00 starting ui and api at :7070
Jun 08 07:42:01 raspi evcc[47725]: [site  ] INFO 2024/06/08 07:42:01 site config:
Jun 08 07:42:01 raspi evcc[47725]: [site  ] INFO 2024/06/08 07:42:01   meters:      grid â pv â battery â
Jun 08 07:42:01 raspi evcc[47725]: [site  ] INFO 2024/06/08 07:42:01     grid:      power â energy â currents â
Jun 08 07:42:01 raspi evcc[47725]: [site  ] INFO 2024/06/08 07:42:01     pv 1:      power â energy â currents â
Jun 08 07:42:01 raspi evcc[47725]: [site  ] INFO 2024/06/08 07:42:01     battery 1: power â energy â currents â soc â capacity â
Jun 08 07:42:01 raspi evcc[47725]: [site  ] INFO 2024/06/08 07:42:01   vehicles:
Jun 08 07:42:01 raspi evcc[47725]: [site  ] INFO 2024/06/08 07:42:01     vehicle 1: range â finish â status â climate â wakeup â
Jun 08 07:42:01 raspi evcc[47725]: [lp-1  ] INFO 2024/06/08 07:42:01 loadpoint 1:
Jun 08 07:42:01 raspi evcc[47725]: [lp-1  ] INFO 2024/06/08 07:42:01   mode:        pv
Jun 08 07:42:01 raspi evcc[47725]: [lp-1  ] INFO 2024/06/08 07:42:01   charger:     power â energy â currents â phases â wakeup â
Jun 08 07:42:01 raspi evcc[47725]: [lp-1  ] INFO 2024/06/08 07:42:01   meters:      charge â
Jun 08 07:42:01 raspi evcc[47725]: [site  ] DEBUG 2024/06/08 07:42:01 set buffer soc: 95
Jun 08 07:42:01 raspi evcc[47725]: [site  ] DEBUG 2024/06/08 07:42:01 set battery discharge control: true
Jun 08 07:42:01 raspi evcc[47725]: [lp-1  ] DEBUG 2024/06/08 07:42:01 set smart cost limit: 5
Jun 08 07:42:01 raspi evcc[47725]: [lp-1  ] DEBUG 2024/06/08 07:42:01 phase timer inactive
Jun 08 07:42:01 raspi evcc[47725]: [lp-1  ] DEBUG 2024/06/08 07:42:01 pv timer inactive
Jun 08 07:42:01 raspi evcc[47725]: [lp-1  ] INFO 2024/06/08 07:42:01 vehicle updated: unknown -> VW e-Up!
Jun 08 07:42:01 raspi evcc[47725]: [site  ] DEBUG 2024/06/08 07:42:01 ----
Jun 08 07:42:01 raspi evcc[47725]: [lp-1  ] DEBUG 2024/06/08 07:42:01 charge power: 0W
Jun 08 07:42:02 raspi evcc[47725]: [site  ] DEBUG 2024/06/08 07:42:02 pv power: 1795W
Jun 08 07:42:02 raspi evcc[47725]: [site  ] DEBUG 2024/06/08 07:42:02 battery soc: 28%
Jun 08 07:42:02 raspi evcc[47725]: [site  ] DEBUG 2024/06/08 07:42:02 battery power: -708W
Jun 08 07:42:02 raspi evcc[47725]: [site  ] DEBUG 2024/06/08 07:42:02 grid meter: -0W
Jun 08 07:42:02 raspi evcc[47725]: [site  ] DEBUG 2024/06/08 07:42:02 site power: -608W
Jun 08 07:42:02 raspi evcc[47725]: [lp-1  ] DEBUG 2024/06/08 07:42:02 charger status: B
Jun 08 07:42:02 raspi evcc[47725]: [lp-1  ] INFO 2024/06/08 07:42:02 car connected
Jun 08 07:42:02 raspi evcc[47725]: [lp-1  ] DEBUG 2024/06/08 07:42:02 pv timer elapse
Jun 08 07:42:02 raspi evcc[47725]: [lp-1  ] DEBUG 2024/06/08 07:42:02 pv timer inactive
Jun 08 07:42:02 raspi evcc[47725]: [site  ] DEBUG 2024/06/08 07:42:02 set battery mode: normal

What type of operating system are you running?

Linux

Version

0.126.6

naltatis commented 3 months ago

Hm, ich kann das nicht reproduzieren. Sonderzeichen sind unproblematisch. Ich hab das gerade noch mal mit @, anderen Sondernzeichen und Emoji 😄 ausprobiert, sollte keinen Unterschied machen.

auch Set oder Reset funktioniert nicht.

Kannst du mal genauer beschreiben, was bei dir passiert, welche Schritte du gehst und welches Verhalten du beobachtest?

Zur Sicherheit: Du verwendest evcc direkt. Nicht in einem iframe oder durch irgend eine Art Reverse Proxy?

naltatis commented 3 months ago

Reset (mehrmals) -> es kommt keine Abfrage bei GUI Start

Die Abfrage kommt erst, wenn du in die Einstellungen (Menü > Konfiguration) gehst. Die Haupt-UI ist aktuell immer ohne Authentifizierung aufrufbar.

Mestro82 commented 3 months ago

Wenn ich die Konfiguration aufrufe kommt nur das Fenster „Passwort“ aber nicht „neues Passwort“ vergeben… ich verwende EVCC direkt (bin auch direkt auf dem Raspi)… hatte dann im Verdacht dass wenn ich noch an der yaml datei bin, diese geschlossen… aber weder Set noch Reset funktionieren… gibt es einem Log der das vll aufnimmt?

Mestro82 commented 3 months ago

EVCC vorher gestoppt… EVCC vorher gestartet… beides mal beides probieren…

Wenn ihr geht ihr bei Reset vor?

naltatis commented 3 months ago

Was helfen würde ist, wenn du mal einen Screenshot des Network tabs deiner Browser devtools machen könntest.

naltatis commented 3 months ago

Zu 'evcc passwort set|reset': dafür sollte der evcc process immer vorher angehalten werden damit noch parallel in die gleiche db geschrieben wird.

Mestro82 commented 3 months ago

Was helfen würde ist, wenn du mal einen Screenshot des Network tabs deiner Browser devtools machen könntest.

Da bräuchte ich etwas Unterstützung was ich huer genau machen muss

naltatis commented 3 months ago

Spannend ist für diesen Fall dieser Request:

Bildschirmfoto 2024-06-09 um 17 35 41

An die Chrome Dev-Tools kommst du so: https://developer.chrome.com/docs/devtools/open?hl=de

Mestro82 commented 3 months ago

Aufruf_Konfiguration_EVCC Status_EVCC

naltatis commented 3 months ago

Danke für die Screenshots. Kannst du einmal erklären, was du genau gemacht hast und was passiert ist? Hauptseite aufgerufen. Bei Navigation auf Konfiguration einen Passwort-Dialog bekommen. Richtiges Passwort eingegeben und eine Ablehnung (ungültiges passwort) in der UI bekommen?

Mestro82 commented 3 months ago

Ja genau.. dann unsicher gewesen wg dem PW.. dann "reset" versucht.. verwundert dass keien Abfrage bzgl neuem Passwort kommt.. dann "set" mit neuem Passwort... weiterhin die Fehlermeldung.. kann ich EVCC komplett zurücksetzen?

naltatis commented 3 months ago

@Mestro82 Du kannst du Datenbank-Datei löschen (o. umbenennen). Beim nächsten Start legt evcc eine neue Datebank an. Der Ort siehst du beim Hochfahren im Log. Da sind allerdings auch deine Ladevorgänge drin.

TobiasSt78 commented 3 months ago

Ich habe das gleiche Problem auch ohne Sonderzeichen. Das eingegebene Passwort wird nicht erkannt, password reset und password set hat beides keine Auswirkung. den evcc Dienst hatte ich vorher gestoppt. Gleiches Symptom: Es kommt zwar die Passwortabfrage aber es wird kein Passwort akzeptiert.

Die DevTools sehen bei mir ähnlich unspektakulär aus: evcc_screenshot

evcc_screenshot2

tobias@pi5htr:~ $ sudo systemctl stop evcc tobias@pi5htr:~ $ evcc password set [main ] INFO 2024/06/13 21:57:33 evcc 0.126.6 [main ] INFO 2024/06/13 21:57:33 using config file: /etc/evcc.yaml [db ] INFO 2024/06/13 21:57:33 using sqlite database: /home/tobias/.evcc/evcc.db [mqtt ] INFO 2024/06/13 21:57:33 connecting evcc-1649255431 at tcp://localhost:1883 [eebus ] INFO 2024/06/13 21:57:33 Local SKI: 1d6492b269e9503fb3d979a2d0887cdd5bbe70db ? Password [? for help] *** tobias@pi5htr:~ $ sudo systemctl start evcc tobias@pi5htr:~ $ sudo evcc password reset [main ] INFO 2024/06/13 21:58:54 evcc 0.126.6 [main ] INFO 2024/06/13 21:58:54 using config file: /etc/evcc.yaml [db ] INFO 2024/06/13 21:58:54 using sqlite database: /root/.evcc/evcc.db [mqtt ] INFO 2024/06/13 21:58:54 connecting evcc-1890168441 at tcp://localhost:1883 [eebus ] INFO 2024/06/13 21:58:54 Local SKI: xxxxx ? Are you sure? Yes tobias@pi5htr:~ $ sudo systemctl start evcc

Mestro82 commented 3 months ago

Ich habe festgestellt, wenn die YAML einen Fehler produziert, wird wieder ein neues Passwort abgefragt.

Ich hatte nun final meinen Raspi neu aufgesetzt und jetzt funktioniert auch mein Passwort mit @ problemlos

naltatis commented 3 months ago

@Mestro82 Ok, cool, dass sich das Problem gelöst hat. So richtig verstehe ich das aber noch nicht. Was für einen Fehler hattest du in der Yaml der zu diesem Verhalten geführt hat.

naltatis commented 3 months ago

@Mestro82 ich konnte es jetzt reproduzieren. Danke für die Hinweise.