Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loadstatistic wrong calculated in EVCC with Easee Wallbox. Meter Count in EVCC correct #14923

Closed
free118 opened this issue Jul 18, 2024 · 19 comments
Labels
enhancement New feature or request needs decision Unsure if we should really do this stale Outdated and ready to close

Comments

@free118
Copy link

free118 commented Jul 18, 2024

Describe the bug

I'm using EVCC on HA together with an easee wallbox.
Yesterday I pluged in my BEV with ~50% SoC in to be charged via PV only.
So with 39kwh in total I assume that in total ~ 18kwh will be charged.
I let the vehicle charge and sit over night. So charging continiues today morning.
After that i took a look into the loading stats.
And they look wrong.
I verfied that Easee stats and conters are correct.
Counteres in EVCC stats are correctly show, but the math is wrong.

Screenshot_2024-07-18-12-28-00-946_no easee apps easee users

evcc stats

Steps to reproduce

1.Plugin BEV start charging in PV only mode
2. Charging stop due to night
3. let it connected over night
4. charging starts with sun in the morning
5. --> startistics are wrong shown in EVCC, EASEE statistics are correct

Configuration details

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: 192.168..
  # port is the listening port for UI and api
  # evcc will listen on all available interfaces
  port: 7070

interval: 25s # control cycle interval


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

# 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_grid
    type: template
    template: shelly-3em
    usage: grid
    host: 192.168.. # IP-Adresse oder Hostname 


chargers:
  - name: charger
    type: template
    template: easee
    user: 
    password:  #wie Login für Easee App oder Web Portal (https://easee.cloud)
    charger: 
    
    

vehicles:
  - name: kona
    type: template
    template: evnotify
    title: Kona

    capacity: 39


# site describes the EVU connection, PV and home battery
site:
  title: Home # display name for UI
  meters:
    grid: my_grid # grid meter


# loadpoint describes the charger, charge meter and connected vehicle
loadpoints:
  - title: Easee Wallbox # display name for UI
    charger: charger # charger
    meter: # charge meter
    mode: "pv" # set default charge mode, use "off" to disable by default if charger is publicly available
    vehicle: kona # set default vehicle (disables vehicle detection)
#    resetOnDisconnect: true # set defaults when vehicle disconnects
    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: 30m
      estimate: true # set false to disable interpolating between api updates (not recommended)
    phases: 0 # electrical connection (normal charger: default 3 for 3 phase, 1p3p charger: 0 for "auto" or 1/3 for fixed phases)
    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)
    guardDuration: 5m # switch charger contactor not more often than this (default 5m)
    minCurrent: 6 # minimum charge current (default 6A)
    maxCurrent: 32 # maximum charge current (default 16A)



# tariffs are the fixed or variable tariffs
# cheap (tibber/awattar) can be used to define a tariff rate considered cheap enough for charging
tariffs:
  currency: EUR # three letter ISO-4217 currency code (default EUR)
  grid:
    # either static grid price
    type: fixed
    price: 0.32 # EUR/kWh

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

# mqtt message broker
mqtt:
   broker: 192.168.
   topic: evcc # root topic for publishing, set empty to disable
   user: 
   password: 

# eebus credentials
eebus:
  # uri: # :4712
  # interfaces: # limit eebus to specific network interfaces
  # - en0
  # certificate: # local signed certificate, required, can be generated via `evcc eebus-cert`
  #   public: # public key
  #   private: # private key

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

Log details

[lp-1  ] DEBUG 2024/07/18 12:51:49 charge total import: 1793.140kWh
[lp-1  ] DEBUG 2024/07/18 12:51:49 charger status: A
[site  ] DEBUG 2024/07/18 12:52:13 ----
[lp-1  ] DEBUG 2024/07/18 12:52:13 charge power: 0W
[lp-1  ] DEBUG 2024/07/18 12:52:13 charge currents: [0 0 0]A
[site  ] DEBUG 2024/07/18 12:52:13 grid meter: -14595W
[site  ] DEBUG 2024/07/18 12:52:13 grid powers: [-4927 -4841 -4826]W
[site  ] DEBUG 2024/07/18 12:52:13 grid currents: [-19.8 -19.8 -19.7]A
[site  ] DEBUG 2024/07/18 12:52:14 pv power: 14595W
[site  ] DEBUG 2024/07/18 12:52:14 site power: -14595W
[lp-1  ] DEBUG 2024/07/18 12:52:14 !! session: chargeRater.chargedEnergy=21.5 - chargedAtStartup=0.0
[lp-1  ] DEBUG 2024/07/18 12:52:14 charge total import: 1793.140kWh
[lp-1  ] DEBUG 2024/07/18 12:52:14 charger status: A
[site  ] DEBUG 2024/07/18 12:52:38 ----
[lp-1  ] DEBUG 2024/07/18 12:52:38 charge power: 0W
[lp-1  ] DEBUG 2024/07/18 12:52:38 charge currents: [0 0 0]A
[site  ] DEBUG 2024/07/18 12:52:38 grid meter: -14369W
[site  ] DEBUG 2024/07/18 12:52:38 grid powers: [-4853 -4768 -4748]W
[site  ] DEBUG 2024/07/18 12:52:38 grid currents: [-19.5 -19.5 -19.3]A
[site  ] DEBUG 2024/07/18 12:52:39 pv power: 14369W
[site  ] DEBUG 2024/07/18 12:52:39 site power: -14369W
[lp-1  ] DEBUG 2024/07/18 12:52:39 !! session: chargeRater.chargedEnergy=21.5 - chargedAtStartup=0.0
[lp-1  ] DEBUG 2024/07/18 12:52:39 charge total import: 1793.140kWh
[lp-1  ] DEBUG 2024/07/18 12:52:39 charger status: A
[site  ] DEBUG 2024/07/18 12:53:03 ----
[lp-1  ] DEBUG 2024/07/18 12:53:03 charge power: 0W
[lp-1  ] DEBUG 2024/07/18 12:53:03 charge currents: [0 0 0]A
[site  ] DEBUG 2024/07/18 12:53:03 grid meter: -14783W
[site  ] DEBUG 2024/07/18 12:53:04 grid powers: [-4995 -4904 -4885]W
[site  ] DEBUG 2024/07/18 12:53:04 grid currents: [-20 -20 -19.9]A
[site  ] DEBUG 2024/07/18 12:53:04 pv power: 14783W
[site  ] DEBUG 2024/07/18 12:53:04 site power: -14783W
[lp-1  ] DEBUG 2024/07/18 12:53:04 !! session: chargeRater.chargedEnergy=21.5 - chargedAtStartup=0.0
[lp-1  ] DEBUG 2024/07/18 12:53:04 charge total import: 1793.140kWh
[lp-1  ] DEBUG 2024/07/18 12:53:04 charger status: A
[site  ] DEBUG 2024/07/18 12:53:28 ----
[lp-1  ] DEBUG 2024/07/18 12:53:28 charge power: 0W
[lp-1  ] DEBUG 2024/07/18 12:53:28 charge currents: [0 0 0]A
[site  ] DEBUG 2024/07/18 12:53:28 grid meter: -14394W
[site  ] DEBUG 2024/07/18 12:53:28 grid powers: [-4861 -4759 -4773]W
[site  ] DEBUG 2024/07/18 12:53:28 grid currents: [-19.5 -19.5 -19.5]A
[site  ] DEBUG 2024/07/18 12:53:29 pv power: 14394W
[site  ] DEBUG 2024/07/18 12:53:29 site power: -14394W
[lp-1  ] DEBUG 2024/07/18 12:53:29 !! session: chargeRater.chargedEnergy=21.5 - chargedAtStartup=0.0
[lp-1  ] DEBUG 2024/07/18 12:53:29 charge total import: 1793.140kWh
[lp-1  ] DEBUG 2024/07/18 12:53:29 charger status: A
[site  ] DEBUG 2024/07/18 12:53:53 ----
[lp-1  ] DEBUG 2024/07/18 12:53:53 charge power: 0W
[lp-1  ] DEBUG 2024/07/18 12:53:53 charge currents: [0 0 0]A
[site  ] DEBUG 2024/07/18 12:53:53 grid meter: -14124W
[site  ] DEBUG 2024/07/18 12:53:53 grid powers: [-4751 -4667 -4706]W
[site  ] DEBUG 2024/07/18 12:53:53 grid currents: [-19.2 -19.2 -19.1]A
[site  ] DEBUG 2024/07/18 12:53:54 pv power: 14124W
[site  ] DEBUG 2024/07/18 12:53:54 site power: -14124W
[lp-1  ] DEBUG 2024/07/18 12:53:54 !! session: chargeRater.chargedEnergy=21.5 - chargedAtStartup=0.0
[lp-1  ] DEBUG 2024/07/18 12:53:54 charge total import: 1793.140kWh
[lp-1  ] DEBUG 2024/07/18 12:53:54 charger status: A
[site  ] DEBUG 2024/07/18 12:54:18 ----
[lp-1  ] DEBUG 2024/07/18 12:54:18 charge power: 0W
[lp-1  ] DEBUG 2024/07/18 12:54:18 charge currents: [0 0 0]A
[site  ] DEBUG 2024/07/18 12:54:18 grid meter: -13974W
[site  ] DEBUG 2024/07/18 12:54:18 grid powers: [-4716 -4616 -4643]W
[site  ] DEBUG 2024/07/18 12:54:18 grid currents: [-19 -18.9 -18.9]A
[site  ] DEBUG 2024/07/18 12:54:19 pv power: 13974W
[site  ] DEBUG 2024/07/18 12:54:19 site power: -13974W
[lp-1  ] DEBUG 2024/07/18 12:54:19 !! session: chargeRater.chargedEnergy=21.5 - chargedAtStartup=0.0
[lp-1  ] DEBUG 2024/07/18 12:54:19 charge total import: 1793.140kWh
[lp-1  ] DEBUG 2024/07/18 12:54:19 charger status: A
[site  ] DEBUG 2024/07/18 12:54:43 ----
[lp-1  ] DEBUG 2024/07/18 12:54:43 charge power: 0W
[lp-1  ] DEBUG 2024/07/18 12:54:43 charge currents: [0 0 0]A
[site  ] DEBUG 2024/07/18 12:54:43 grid meter: -14104W
[site  ] DEBUG 2024/07/18 12:54:43 grid powers: [-4759 -4662 -4683]W
[site  ] DEBUG 2024/07/18 12:54:44 grid currents: [-19.1 -19.1 -19]A
[site  ] DEBUG 2024/07/18 12:54:44 pv power: 14104W
[site  ] DEBUG 2024/07/18 12:54:44 site power: -14104W
[lp-1  ] DEBUG 2024/07/18 12:54:44 !! session: chargeRater.chargedEnergy=21.5 - chargedAtStartup=0.0
[lp-1  ] DEBUG 2024/07/18 12:54:44 charge total import: 1793.140kWh
[lp-1  ] DEBUG 2024/07/18 12:54:44 charger status: A
[site  ] DEBUG 2024/07/18 12:55:08 ----
[lp-1  ] DEBUG 2024/07/18 12:55:08 charge power: 0W
[lp-1  ] DEBUG 2024/07/18 12:55:08 charge currents: [0 0 0]A
[site  ] DEBUG 2024/07/18 12:55:08 grid meter: -14511W
[site  ] DEBUG 2024/07/18 12:55:08 grid powers: [-4903 -4808 -4800]W
[site  ] DEBUG 2024/07/18 12:55:09 grid currents: [-19.7 -19.6 -19.5]A
[site  ] DEBUG 2024/07/18 12:55:09 pv power: 14511W
[site  ] DEBUG 2024/07/18 12:55:09 site power: -14511W
[lp-1  ] DEBUG 2024/07/18 12:55:09 !! session: chargeRater.chargedEnergy=21.5 - chargedAtStartup=0.0
[lp-1  ] DEBUG 2024/07/18 12:55:09 charge total import: 1793.140kWh
[lp-1  ] DEBUG 2024/07/18 12:55:09 charger status: A
[site  ] DEBUG 2024/07/18 12:55:33 ----
[lp-1  ] DEBUG 2024/07/18 12:55:33 charge power: 0W
[lp-1  ] DEBUG 2024/07/18 12:55:33 charge currents: [0 0 0]A
[site  ] DEBUG 2024/07/18 12:55:33 grid meter: -14753W
[site  ] DEBUG 2024/07/18 12:55:33 grid powers: [-4977 -4883 -4893]W
[site  ] DEBUG 2024/07/18 12:55:34 grid currents: [-20 -19.9 -20]A
[site  ] DEBUG 2024/07/18 12:55:34 pv power: 14753W
[site  ] DEBUG 2024/07/18 12:55:34 site power: -14753W
[lp-1  ] DEBUG 2024/07/18 12:55:34 !! session: chargeRater.chargedEnergy=21.5 - chargedAtStartup=0.0
[lp-1  ] DEBUG 2024/07/18 12:55:34 charge total import: 1793.140kWh
[lp-1  ] DEBUG 2024/07/18 12:55:34 charger status: A

What type of operating system are you running?

HomeAssistant

Version

0.128.2

@andig
Copy link
Member

andig commented Jul 18, 2024

It's unclear how the screenshots relate to the problem described. What to they show? We'll also need a log file that allows to reproduce the issue. The log above is not related. Closing until matching log available.

/cc @naltatis

@andig andig closed this as completed Jul 18, 2024
@free118
Copy link
Author

free118 commented Jul 18, 2024

First Screenshot show the charging in the Easee App.
So you can see that 21,5kWh were charged and measured by them. Expected ~18kWh. So this would fit. I guess.

If you took a look into the 4 loadings from EVCC (why ever this one charging is shown as four individual charges in EVCC)
you will see that the "Geladen" amount is wrongly calculated in 3 of 4 times. (marked in red and green)

Start at the top left of the screenshot:
Counter Value: 1792,9 kWh - 1784,7 kWh = 8,2kWh --> but EVCC shows 20,4 kWh as charged.

Lower left of the screenshot:
Counter Value: 1784,7 kWh - 1782,7 kWh = 2,0 kWh --> but EVCC shows 12,2 kWh as charged.

Overall EVCC shows for this charge an total amount of: 42,87kWh.
Which i think didn't make any sense because the Cars Battery is just 39kWh and it was ~50% charged, when I started charging.

If you calculate from the first Counter Value - the last value of the charging than it's: abs(1771,6 - 1792,9) = 21,3kWh.
That fit the total amount of charged kWh.

What values does EVCC use for the total calculation here?

@free118
Copy link
Author

free118 commented Jul 18, 2024

I can't reach the old log.
But i did a new charging.
Attached the log and here the screenshot

image

evcc-20240718-165112-debug.log

Total calculation is 0,4kWh off, but meters ar showing up correctly

@andig andig reopened this Jul 18, 2024
@andig andig added the question Rather clarification than issue label Jul 18, 2024
@andig
Copy link
Member

andig commented Jul 20, 2024

Here's what I can see:

[lp-1  ] DEBUG 2024/07/18 16:06:24 charge total import: 1793.140kWh
[lp-1  ] INFO 2024/07/18 16:06:24 start charging ->

[lp-1  ] DEBUG 2024/07/18 16:11:24 !! session: chargeRater.chargedEnergy=0.0 - chargedAtStartup=0.0
[lp-1  ] DEBUG 2024/07/18 16:11:24 charge total import: 1793.142kWh

[lp-1  ] DEBUG 2024/07/18 16:50:59 charger status: B
[lp-1  ] INFO 2024/07/18 16:50:59 stop charging <-
[lp-1  ] DEBUG 2024/07/18 16:50:59 charge total import: 1799.455kWh
[lp-1  ] DEBUG 2024/07/18 16:50:59 !! session: chargedEnergy=6.0 > chargedEnergy=0.0
[lp-1  ] DEBUG 2024/07/18 16:50:59 !! session: start=1793.140 stop=1799.455 chargedEnergy=6.010
chargedEnergy=6.0

comes from the Easee Api (set easee: trace to validate yourself). This value is wrong when the session stops. We can either:

@GrimmiMeloni wdyt?

/cc @premultiply

@andig andig added enhancement New feature or request needs decision Unsure if we should really do this and removed question Rather clarification than issue labels Jul 20, 2024
@GrimmiMeloni
Copy link
Collaborator

Regression of #9884 ?

Not sure if it is the same issue though. @allcoolusernamesaregone do you by any chance remember from the top of your head if the issue described here matches what we discussed back in the day?

@allcoolusernamesaregone

This comment was marked as off-topic.

@andig
Copy link
Member

andig commented Jul 27, 2024

Das Log zeigt, dass die 4,6 kWh an Menge zu viel in der zweiten Session aus dem Wert von der Easse Api kommen, die die Menge in einer Session fortschreibt. Die Gesamtmenge der Session lt. Easee Api und App ist 6,25.

Eine Session i.S. der WB geht von An- bis Abstecken, egal ob evcc läuft.

Ich denke EVCC müsste beim Session Start den aktuellen Wert von SESSION_ENERGY, falls > 0, von späteren SESSION_ENERGY Werten abziehen.

Das tut evcc.

Siehe #14923 (comment) da liefert die Easee schon den falschen Wert.

@allcoolusernamesaregone

This comment was marked as off-topic.

@andig

This comment was marked as off-topic.

@allcoolusernamesaregone

This comment was marked as off-topic.

@andig
Copy link
Member

andig commented Jul 27, 2024

Aber es gibt das hier:

@allcoolusernamesaregone Das nutzt nichts. Ohne Log gibt es hier nichts zu tun. Falls es nicht möglich ist, eines zu produzieren würde ich hier schließen. Insbesondere ist dein Problem ein anderes als hier diskutiert, es wäre also sinnvoll ein neues Issue aufzumachen.

@free118 Falls das Problem aus #14923 (comment) nicht mehr besteht gibts auch da nichts zu tun.

@allcoolusernamesaregone

This comment was marked as off-topic.

@andig
Copy link
Member

andig commented Jul 27, 2024

Gut, dann zurück zum Thema. Bleibt noch #14923 (comment) zu entscheiden.

@andig
Copy link
Member

andig commented Jul 27, 2024

Regression of #9884 ?

@GrimmiMeloni warum? Das Log zeigt m.E. klar, dass der falsche Wert von der Easee kommt.

@allcoolusernamesaregone

This comment was marked as off-topic.

@andig
Copy link
Member

andig commented Jul 27, 2024

Wozu brauchst Du bitte schön ein Log um anzuerkennen, dass was schief gelaufen ist? Das sollte man problemlos im Code nachvollziehen können, es liegen alle Fakten auf dem Tisch.

Mach das bitte wenn du es kannst. Ich kann es nicht. Die Situation wird bereits im Code behandelt. Warum das nicht funktioniert könnte das Logfile zeigen.

Weiterhin ist Dein Problem- Energiemenge >0 beim evcc Start ein anderes als das Theme eingangs- abweichende Menge vs. Zählerstände nach evcc Start. Sei bitte so nett und bleib beim Thema, zumal es Dir ja egal ist ;). Danke.

@GrimmiMeloni
Copy link
Collaborator

Regression of #9884 ?

@GrimmiMeloni warum? Das Log zeigt m.E. klar, dass der falsche Wert von der Easee kommt.

War nur geraten, daher auch als Frage formuliert.

Soweit ich es überblicke ist es anders als #9884. Die Daten von der API kommen bekanntermaßen verzögert. Das lässt sich nur bedingt gut mit der Logik/Ablauf in evcc vereinbaren.

@andig , welche Idee hattest du denn mit dem meter oben? Kannst du das noch mal genauer erklären, wie das funktionieren würde?

@allcoolusernamesaregone

This comment was marked as off-topic.

@andig
Copy link
Member

andig commented Jul 27, 2024

Ändert doch nix. Ohne Logfile nicht nachvollziehbar. Zum Eingangsthema gibts ein Log. Ich würde jetzt wirklich darum bitten, dieses zu liefern oder den Thread in Ruhe zu lassen. Danke.

@github-actions github-actions bot added the stale Outdated and ready to close label Aug 3, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs decision Unsure if we should really do this stale Outdated and ready to close
Projects
None yet
Development

No branches or pull requests

4 participants