teslamate-org / teslamate

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

Add or allow adding currency symbol to all costs in default dashboards #3137

Open AkshayRao27 opened 1 year ago

AkshayRao27 commented 1 year ago

Is there an existing issue for this?

What happened?

The current default dashboards in Teslamate do not have any currency symbols image

While adding a currency symbol to these values is possible fairly easily: image

The changes cannot be saved as Grafana says that it "Cannot save provisioned dashboard" image

A potential workaround would be to specify a currency symbol in preferences and have all dashboards take this symbol over. Alternatively, telling Grafana to allow saving provisioned dashboards somehow would also work

Expected Behavior

No response

Steps To Reproduce

No response

Relevant log output

-

Screenshots

No response

Additional data

Grafana v8.5.6 (623255cf2d)

Type of installation

Docker

Version

v1.27.1

DrMichael commented 1 year ago

Well, $ would obviously not be correct for me... I think, all money values are coming from manually input cost of charges. So, yes, adding a currency symbol in the preferences would be possible. (Although I could live without...:-)

vzhivkov commented 1 year ago

This would be very useful since when traveling abroad charges are in different currencies even at Tesla Superchargers.

Hjlfmir commented 1 year ago

Hi all, +1 for this feature :)

putianhui commented 1 year ago

When modifying grafana's dashboard to save, it prompts Cannot save provisioned dashboard, you can try the following solutions

  1. Copy the /etc/grafana/provisioning/dashboards/dashboards.yml configuration file of the teslamate-grafana-1 docker container to the /tmp directory
$ docker cp teslamate-grafana-1:/etc/grafana/provisioning/dashboards/dashboards.yml /tmp/
  1. Modify the /tmp/dashboards.yml configuration file just copied to the local, add allowUiUpdates: true configuration item, the content of the modified configuration file is as follows:
$ vim /tmp/dashboards.yml
apiVersion: 1

providers:
- name: 'teslamate_EN'
  orgId: 1
  folder: TeslaMate_EN
  folderUid: Nr4ofiDZk
  type: file
  disableDeletion: false
  editable: true
  updateIntervalSeconds: 86400
  # newly added
  allowUiUpdates: true
  options:
    path: /dashboards_en
- name: 'teslamate_internal'
  orgId: 1
  folder: Internal
  folderUid: Nr5ofiDZk
  type: file
  disableDeletion: false
  editable: true
  updateIntervalSeconds: 86400
  # newly added
  allowUiUpdates: true
  options:
    path: /dashboards_internal
- name: 'teslamate_reports'
  orgId: 1
  folder: Reports
  folderUid: Nr6ofiDZk
  type: file
  disableDeletion: false
  editable: true
  updateIntervalSeconds: 86400
  # newly added
  allowUiUpdates: true
  options:
    path: /dashboards_reports
  1. Copy the modified /tmp/dashboards.yml configuration file to teslamate-grafana-1 under the /etc/grafana/provisioning/dashboards/dashboards.yml directory of the docker container
$ docker cp /tmp/dashboards.yml teslamate-grafana-1:/etc/grafana/provisioning/dashboards/dashboards.yml
  1. Restart the teslamate-grafana-1 docker container, re-access grafana, modify the dashboard and try to find that it can be saved
$ docker restart teslamate-grafana-1
Hjlfmir commented 1 year ago

Hi. I tried this, file is corretly modified but the issue is still the same :s

AkshayRao27 commented 1 year ago

When modifying grafana's dashboard to save, it prompts Cannot save provisioned dashboard, you can try the following solutions

  1. Copy the /etc/grafana/provisioning/dashboards/dashboards.yml configuration file of the teslamate-grafana-1 docker container to the /tmp directory
$ docker cp teslamate-grafana-1:/etc/grafana/provisioning/dashboards/dashboards.yml /tmp/

This fixed it. I had to change teslamate-grafana-1 to root-grafana-1 for my install.

I tried FTPing into the server to change the file manually without CLI, but I straight up cannot find where Graphana's files are stored. There is no Graphana folder in /etc/ or in /var/lib/

github-actions[bot] commented 10 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Hjlfmir commented 1 week ago

Hi everyone, since last update, it seems this solution does not work anymore. Once restarted, Grafana is not working anymore. I need to pull the clean image to get it work :s Any idea ?

cwanja commented 1 week ago

@JakobLichterfeld @swiffer @DrMichael time to add another setting that allows a user to insert their desired currency? Similar to temperature, tire pressure and length. Then use that variable before the value. Is that even possible?

JakobLichterfeld commented 1 week ago

@JakobLichterfeld @swiffer @DrMichael time to add another setting that allows a user to insert their desired currency? Similar to temperature, tire pressure and length. Then use that variable before the value. Is that even possible?

Hm, on the one hand I do see a bit of improvement in UX, but on the other hand there comes lots of drawbacks with it. More settings mean more room for failure. What If someone moves the location where it is now another currency. My expectation would be an automatic conversion in my currency from setting. All this is not in the scope of TeslaMate nor should it be. So I strongly vote against it.

Hm, on the one hand I see a slight improvement in the UX, but on the other hand there are a lot of drawbacks. More settings means more room for error. What if someone changes location, with a different currency. As a user I would expect an automatic conversion to my currency from the settings. All this is not in the scope of TeslaMate, nor should it be. So I strongly vote against it.

DrMichael commented 1 week ago

Well, temperature, tire pressure and length are coming from Tesla, whereas the costs are in the responsibility of the user itself. So I also voter against adding the currency symbol (although it would look nicer).

swiffer commented 1 week ago

Ok with adding a symbol to make it visually more appealing but agree with both of you that that might open expectations of handling & converting currencies - and as currency exchange rates are changing i wouldn' step into the topic at all.

Hjlfmir commented 1 week ago

I understand your arguments. Maybe a "kind of solution" would be to set by default dashboards editable by users. I think it would be enough for most of users, just to be able to add their own currency if they want, but not an among of work for devs.

swiffer commented 1 week ago

we are doing that with PR #4338 - however changes are overwritten on update.