Closed Ed-M72 closed 10 months ago
What values are stored for the fast_charger_type
in the charges
table for the affected charging sessions?
Hey Adrian. Every single row in the charging table has "invalid" set against fast_charger_brand and fast_charger_type.
Hmm interesting. Usually, all supercharges are clearly identifiable via these fields. The values come directly from the API. Unless there is another way to detect the charges, there is not much we can do 🤔
How about I add a Tesla Supercharger bool to the geofence table? I have all the UK superchargers already in there. It could be used as a fallback in case there is nothing passed back from the API. I was thinking of adding a "Network" field to the table anyway to allow people to write dashboards that group charging costs by the charging network.
QQ- Does the cost and currency get passed back by the API too? I struggled to find the piece of code that handled the API call. Any pointers would be great.
Alternatively, tags could be added to geofences. This would potentially enable other use cases as well. It would be nice if Tesla could provide accurate information via the API though 😄
QQ- Does the cost and currency get passed back by the API too? I struggled to find the piece of code that handled the API call. Any pointers would be great.
Unfortunately not. All available charging-related information is documented here: https://tesla-api.timdorr.com/vehicle/state/chargestate
I just checked out tags in Postgres. I get the concept, it basically creates an array of tags you specify, and then returns them during a SQL query. I am new to Erlang + Ecto.sql. If you are willing to help and give direction I will give it a go, otherwise I will revert to a table column as that will be simpler to implement.
Describe the bug
If I click "Free Supercharging" within the settings screen, the charge row within the charging_processes table always has a value assigned to it after charging with a Tesla Supercharger.
The code that derived the cost looks like this, I assume the fast_charger_type is pulled in over the API, however if I look in the charging processes table both fast_charger_brand and fast_charger_type are always saved as
cost = case {stats, charging_process} do {%{fast_chargertype: "Tesla" <> }, %CP{car: %Car{settings: %CarSettings{free_supercharging: true}}}} -> 0.0
Not sure why this is happening, perhaps it is not getting passed through from the API. I am looking to add a provider to the geofences table, so if there is no workaround for this it could revert to checking against the geofence.
Expected behaviour
The charge should be saved with a zero cost if charging at a Tesla Supercharger and "Free Supercharging" is set to true in the settings screen.
How to reproduce it (as minimally and precisely as possible):
Relevant entries from the logs
Screenshots
Data
Environment