Comments (6)
Oh, there is a way to create a key/value variables in Grafana!
SELECT name AS __text, id AS __value FROM cars
from teslamate.
Yes, that would be great! I haven't figured out how to do it yet. But there's probably a clever way.
from teslamate.
When you insert the car ID in the database, perhaps if we add a column and call it CarName or something similar? From Tesla, the API returns this as "display_name" and it seems you are already logging this.
Here is what I saw - looks like a function called create_new in vehicles.ex. Just using the display_name in addition to everything else might work.
Logger.info("Found car '#{vehicle.display_name}'")
{:ok, car} =
case Log.get_car_by_eid(vehicle.id) do
nil ->
properties = Identification.properties(vehicle)
Log.create_car(%{
eid: vehicle.id,
vid: vehicle.vehicle_id,
model: properties.model,
efficiency: properties.efficiency
})
car ->
{:ok, car}
end
I don't know Elixir, but sometime back I had written a Tesla Token Generator (for windows) and you can see the details on what the API returns here.
Happy to try it out and help test/debug.
Thanks again!
from teslamate.
Yes, storing the display_name
like you proposed would become necessary. What then remains is showing the display_name
in grafana while at the same time combining it with the id
somehow i.e. selecting the car's name in the dropdown should actually set the corresponding car_id
(the car_id
is required by most queries). Does that make sense?
from teslamate.
Do you think, it could be something like car_id - display_name. So it would show up like 1 - WhateverCoolNameYourCarHas - or something along those lines.
from teslamate.
If there is some way to replace text inside a variable, that could work!
Another idea is to use two variables: one to select the name and another hidden one that references the name variable fetches the corresponding car id.
from teslamate.
Related Issues (20)
- postgres warning
- [Feature Request] Sentry State HOT 1
- Some location can't be resolved in China HOT 2
- 因为我服务器上80和443端口已经被其他应用修改,所以我修改80端口为8866端口,但貌似grafana打不开了?
- Battery Health has errors, the battery suddenly becomes healthy HOT 4
- Missing drive data - not exists in TeslaMate, exists in TeslaFi HOT 6
- Import from TeslaFi Does Not Appear to do Anything? HOT 7
- Failing to export teslamate.bck on macOS Docker Desktop HOT 4
- Backup not working HOT 4
- the same UID is used more than once in Grafana HOT 3
- Teslamate not starting HOT 1
- Backup not working (on Rasberry PI ) HOT 2
- bug after update docker HOT 1
- Endpoint is only available on fleetapi HOT 64
- [Feature Request] Efficiency based on tire set (Summer/Winter/All Season)
- Missing v1.28.2 ghcr.io build? HOT 2
- Grafana "This site can't be reached" HOT 7
- Intermittent charges incorrectly recorded HOT 9
- Impossible GPS coordinates HOT 1
- Suspend logging is not needed anymore as car falls asleep even while polling HOT 47
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from teslamate.