jonasbkarlsson / ev_smart_charging

Electric vehicle smart charging for Home Assistant.
MIT License
191 stars 29 forks source link

FR - Total cost of charging #101

Open tubalainen opened 1 year ago

tubalainen commented 1 year ago

Is your feature request related to a problem? Please describe. N/A

Describe the solution you'd like Hej Jonas! Would it be possible to calculate and create a sensor that presents the total cost of last nights charging session? And if possible a config option to set if this should be calculated in öre or kronor.

Describe alternatives you've considered Create a quite template sensor for consumed energy per hour during the active session and then add the charging hours.

Additional context Näe

jonasbkarlsson commented 1 year ago

I have plans to add a sensor with the accumulated charging cost. And then one could use the Utility Meter to get daily, monthly, yearly costs.

Now, you ask for "last night", which neither is "today" nor "yesterday", which you would be able to get from the Utility Meter. I see the point with "last night", but how important is that given that you will have both "today" and "yesterday"?

Regarding configuration option for cents (öre instead of kronor), my initial assumption is that the integration will use the currency and choice of cents or not based on what the electricity price sensor provides.

tubalainen commented 1 year ago

Ääh per DAY perhaps - charging can be done during the day and not the NIGHT. :)

The default output from nordpool component is, from what I have understood kronor, not ören.

WhippingBoy01 commented 1 year ago

"charge session" price would be great, would make it a lot easier if someone borrows your charger and needs to pay you for the charge.

jonasbkarlsson commented 1 year ago

I plan to implement this using an entity from the charger that contains the total energy (in kWh) consumed by the charger.

And a first sensor that will contain the total charging cost (that will be possible to use with the Utility Meter to create sensors for today's cost, yesterday's cost, this month cost, last month cost, this year's cost, last year's cost).

And a second sensor that will containt the total charging cost since the switch switch.ev_smart_charging_ev_connected was turned on, containing the cost of the currect charging session. And possible an attribute with the cost of the previous charging sesson.

djungelola commented 8 months ago

Is this feature planned? Think it is a very good idea.

jonasbkarlsson commented 8 months ago

It is planned, and I have started to implement it. However, some other things with higher priority needed to be done, so there has not been any progress lately.

zanoii commented 2 months ago

Just want to add a +1 to this FR. It would be nice to be able to feed charging session cost into Teslamate.

jonasbkarlsson commented 2 months ago

Still planned.... Actually, now I'm working on adding support for charging based on excess solar power. In that case, would it be reasonable to assume that the cost of charging is zero when solar power is used?

miimikko commented 2 months ago

I'd guess that it would depend on the amount of excess solar power available, but I'd say that for most plants that is not a reasonable assumption. Most household solar plants don't output enough energy to cover the amount outputted by the charger.

For example I have a 7kw plant and my charger outputs 11kw, so even in ideal conditions (never mind that the panels are split on different sides of the roof) the charger would need to pull electricity from the grid. Though of course there are instances where the cost could actually be 0, but it is most likely the exception to the rule rather than other way around.