teslamate-org / teslamate

A self-hosted data logger for your Tesla 🚘
https://docs.teslamate.org
MIT License
5.54k stars 694 forks source link

Allow negative charge costs #743

Closed russinating closed 4 years ago

russinating commented 4 years ago

Many Tesla owners in the UK are with Octopus Energy, a provider who's half-hourly rates are based on wholesale costs. Occassionally this can result in negative prices, ie being paid to use electricity.

Currently Teslamate prevents setting charge costs as negative, requiring them to be 0 or greater. If this is simply human validation and not a larger job, affecting the database and calculations, can this be amended to allow for negative values please?

adriankumpf commented 4 years ago

Somewhat related to #655 (Octopus Energy)

cwanja commented 4 years ago

Paid to use electricity?! What am I doing wrong.

russinating commented 4 years ago

Paid to use electricity?! What am I doing wrong.

I know! Lockdown has helped. Lowest rate tomorrow is -11.81p/kW @ 14:30-15:00 and along with the rest of the afternoon I should be paid ~£4 for charging the M3. Small gains!

russinating commented 4 years ago

@adriankumpf

I manually updated my charge cost today to a negative via psql and it appears to be displaying correctly and doesn't seem to have broken any grafana calcs so I presume the prevention is/was just for human error.

By the way, thank you for all your hard work on this, I've been meaning to donate since I started using it a few weeks ago but got around to it this evening.