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

monthly "invoice" #510

Open
Ralf-Th opened this issue Nov 13, 2024 · 14 comments
Open

monthly "invoice" #510

Ralf-Th opened this issue Nov 13, 2024 · 14 comments
Labels
feature Feature request

Comments

@Ralf-Th
Copy link

Ralf-Th commented Nov 13, 2024

Feature request

get monthly costs / consumptions as per user to send e-mail automatically

What version of the integration are you using?

0.9.64

Anything in the logs that might be useful for us?

No response

Additional information

actual i do not know how to sum up monthly costs / consumption as per user, there is only a sensor over all.

@Ralf-Th Ralf-Th added the feature Feature request label Nov 13, 2024
@olalid
Copy link
Collaborator

olalid commented Nov 13, 2024

This has been discussed before, it is to me really unclear how this is something that fits inside the scope of HA.
I could see that a separate application/script can do this and generate a kind of report and or invoice, but HAs model is to provide a bunch of sensors and control stuff, not to generate reports.

@olalid
Copy link
Collaborator

olalid commented Nov 13, 2024

See #158

@Ralf-Th
Copy link
Author

Ralf-Th commented Nov 13, 2024

Hey, thank you for the quick response.
Funny, that 2 years ago same idea is raising.

i think think comment is a good one

sensor.user 2.2
Attributes:

  • userId:
  • userEmail
  • dailyKWh: 2.2 kWh
  • dailyCost X SEK
  • weeklyKWh Y kWh
  • weeklyCost Z SEK
    unit_of_measurement: kWh

no idea, if it possible in this way or similar

in combination with utility meter device and template entities additional features would be available i think

best regards
Ralf

@olalid
Copy link
Collaborator

olalid commented Nov 13, 2024

I have added some functions in pyeasee to retrieve the information and created a simple example script on how to use it:
nordicopen/pyeasee#116
It will be included in next release of pyeasee, which should not be so far away.

@olalid
Copy link
Collaborator

olalid commented Nov 17, 2024

Now released in pyeasee 0.8.9 which includes functions to extract consumption per user.
There is an example script that can be run to extract the information, and of course changed to suit the need.
I am not planning to make any changes to the integration since I feel this is something better handled outside of HA.

@Ralf-Th
Copy link
Author

Ralf-Th commented Nov 18, 2024

thank you so far.
unfortunately i am no developer and without having the data in HA i cannot handle it.

@olalid
Copy link
Collaborator

olalid commented Nov 18, 2024

Well, I would not say you need to be a developer to run the script I created.
The steps to do so would be to install python on a computer, run "pip install pyeasee" to install the lib, download the example I created https://github.com/nordicopen/pyeasee/blob/master/examples/user_consumption.py
And run it with "python user_consumption.py username password"
If you tell me how you want the output formatted I can guide you how to change the script.
Honestly, I am not 100% sure the script even works correctly since I do not have a setup with more than one user to test it on, so when I run it, I see noting apart from my user id, name and email.

To me, a sensor in HA would be a far more complex thing to use to create invoices than the output of this script. I would not even know how to begin doing that honestly. A sensor would only represent the correct value at a certain point in time for one, so it would be very critical to read its value at a that time. The values would not necessarily update exactly when a month ends for instance, since it is more dependant on when a charging session ends than when a month ends.
Also, the attributes you suggested are not possible since the API only supports monthly and yearly data. Getting daily and weekly data is far more complex and requires parsing all charging sessions at the site.
To implement this would also require polling, which we like to avoid as much as possible. In fact it is on my mental roadmap to try and remove as much as possible of the polling we are already doing, so changes in that direction is coming, and it might mean that I will remove some features that we have implemented but that is not working very well.

@Ralf-Th
Copy link
Author

Ralf-Th commented Nov 18, 2024

Hello and thank you for your kindly offer.
One more question: I think the wallbox has an utility meter inside like a shelly?
i can access with sensor.links_energie_pro_stunde
screenshot
this sensor is exact what i need for each user, may be solvable with a kind of virtual utility meter on easee?

@olalid
Copy link
Collaborator

olalid commented Nov 18, 2024

The APIs that report user consumption updates only after completed charging sessions, not during ongoing charging.
And there is no API to read which user is currently connected, so you can not use any other meter since you do not know who is connected.

The "utility meter" equivalent of the the charger is the sensor called "lifetime energy" (or "Gesamtenergie" in German).
It updates with "irregular" intervals and does usually not show the correct value for the entire session until after a charging session completes, even if the car stopped charging earlier.
If you want to know more real-time how much energy is consumed in charging session you are better of integrating the power sensor over time, since it updates a lot more frequently.
The energy per hour sensor that you point to above is something else, it represents a floating average over the last hours consumption. Frankly I am unsure what that can be used for, but somebody asked for us to add it some time ago, and the data was already available so we did. More data is fun perhaps...

But again, nothing of this can be used to understand the consumption of a specific user since there is no way of knowing who is currently charging, until after the session completes (i.e. car is disconnected).

@Ralf-Th
Copy link
Author

Ralf-Th commented Nov 18, 2024

ok, i understand.

i had assumed, that user is known with authentification while starting charging

@olalid
Copy link
Collaborator

olalid commented Nov 18, 2024

The charger knows of course, but we can not access that information.

@Ralf-Th
Copy link
Author

Ralf-Th commented Nov 18, 2024

may be you can forward that as a suggestion for improvement to the charger firmware team

@olalid
Copy link
Collaborator

olalid commented Nov 18, 2024

I did discuss it with them at some point over a year ago, I do not think it is much to hope for.

@HolgerMiara
Copy link

Hi Ralf-Th,
it's maybe a bit low-tech, but I download every three months a "detailed report" in Excel format from the https://control.easee.com/portal/sites/[mysite]/consumption web portal and use it as a documentation for cash claims (accompanied by the latest copy of my electricity bill).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request
Projects
None yet
Development

No branches or pull requests

3 participants