New Grafana Chart - Monthly Stats #664
Replies: 52 comments
-
Tried using the Trip dashboard and setting the time to 30 (or 31) days? Should include every thing you are after. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the tip! Yes, it is. However, I was looking for something that
is comparative - compare April to March, etc. Would that have too many
variations?
Pratik
…On Wed, Apr 29, 2020 at 11:08 PM cwanja ***@***.***> wrote:
Tried using the Trip dashboard and setting the time to 30 (or 31) days.
Should include every thing you are after.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<https://github.com/adriankumpf/teslamate/issues/664#issuecomment-621585907>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBIHHIGA5EQLS5YONVJWDDRPDTUTANCNFSM4MT7EYFQ>
.
|
Beta Was this translation helpful? Give feedback.
-
So I began working on it... but I dont like the layout yet..... Feel free to make some layout recommendations ... because this isn't doing it for me so far. |
Beta Was this translation helpful? Give feedback.
-
Not the best solution, but could you just open two tabs or windows and compare it? Are you really hitting this dashboard daily or weekly, or just once a month? If the latter, opening two tabs or windows seems like the best solution (in my opinion). Not saying you could not get some dashboard to eventually do it. Just wonder if it is worth the effort. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Ok, here is the copy with 2 sections showing last 30 days and last 60-30 days. Figured out the have to leave relative time blank and time shift 30d in the second set. Set the time filter to last 30 days and this works correctly. |
Beta Was this translation helpful? Give feedback.
-
Ok, it is complete. I am posting the JSON file (zipped) if anyone is interested in making this. Thanks community for showing me the way to do it! |
Beta Was this translation helpful? Give feedback.
-
Hmm, I thought, you meant more something like this? Could we learn from Teslalogger? :-) |
Beta Was this translation helpful? Give feedback.
-
That is what I was initially thinking but cwanja's tip to use the trip
dashboard, led me down a different path. Can you share the json for the
dashboard? I would like to see the query.
Pratik
…On Fri, May 1, 2020 at 8:42 AM DrMichael ***@***.***> wrote:
Hmm, I thought, you meant more something like this?
[image: Trip-Monatsstatistik]
<https://user-images.githubusercontent.com/8087682/80806027-d5c6af00-8bb9-11ea-8843-988a74c809cd.png>
Could we learn from Teslalogger? :-)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<https://github.com/adriankumpf/teslamate/issues/664#issuecomment-622372392>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBIHHNJRCY36WQGGMNJ5NLRPK7RVANCNFSM4MT7EYFQ>
.
|
Beta Was this translation helpful? Give feedback.
-
The query is: |
Beta Was this translation helpful? Give feedback.
-
I am working on converting this to work with Teslamate. Have the base
working, need to do the unit conversion. The consumption values are not in
the drives table, will look at the drive chart to calculate these values.
Will submit the completed dashboard once done.
Thanks,
Pratik
…On Fri, May 1, 2020 at 9:15 AM DrMichael ***@***.***> wrote:
Sure:
https://github.com/bassmaster187/TeslaLogger/blob/master/TeslaLogger/Grafana/Trip%20Monatsstatistik.json
The query is:
SELECT DATE_FORMAT(StartDate, '%Y / %m') as date,
\nsum(DurationMinutes)/60 as sum_duration_h, \nsum(km_diff) as
sum_km,\nsum(consumption_kWh) as sum_consumption_kwh,
\nsum(consumption_kWh) / sum(km_diff) * 100 as
avg_consumption_kwh,\navg(outside_temp_avg) as avg_outside_temp,\ncount(*)
as cnt\nfrom trip WHERE \n $__timeFilter(StartDate) and km_diff < 1000 \n
group by DATE_FORMAT(StartDate, '%Y-%m')\n
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<https://github.com/adriankumpf/teslamate/issues/664#issuecomment-622383248>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBIHHJHLW2ICPAK7MWTUQDRPLDN7ANCNFSM4MT7EYFQ>
.
|
Beta Was this translation helpful? Give feedback.
-
Here is the ported over dashboard from the above linked TeslaLogger dashboard. I didn't do the kWh/100 mi calculation. I can work on it, if you are interested in including this to TeslaMate. Also, some formatting might need to be checked on for km units. |
Beta Was this translation helpful? Give feedback.
-
I also worked a bit on this... Please comment. And please check C/F and km/mi... (I am not happy yet with the units of the "Distance driven".) (Newer version available) |
Beta Was this translation helpful? Give feedback.
-
I would like to put links behind the "Distance driven" and "Energy charged" fields to jump to "Drives" and "Charges" respectively for the given month. Can anybody help me to get the time interval in the link? It should be something like Any ideas? |
Beta Was this translation helpful? Give feedback.
-
Ok, I got further. Any comments? Is it useful anyway? :-) New version with car selector: |
Beta Was this translation helpful? Give feedback.
-
Hmmm, don't understand that... I assume, that I would need to put start_date in the GROUP BY, but I don't want that, because then I get a line for each day. Could you perhaps have a look at the SQL query? |
Beta Was this translation helpful? Give feedback.
-
Ah, I was looking at the wrong place: all (other) start_date occurrences must be aggregated... |
Beta Was this translation helpful? Give feedback.
-
yeah worst case, if you don;'t want to, just aggregate the start_date with
min or max even if it's a individual line. Or purely group by the
date_part(month version.
…On Wed, Jun 10, 2020 at 9:32 AM DrMichael ***@***.***> wrote:
Ah, I was looking at the wrong place: all start_date occurrences must be
aggregated...
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/adriankumpf/teslamate/issues/664#issuecomment-642049131>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAWPY3UCACEIPLGD2LLFUQ3RV6KPPANCNFSM4MT7EYFQ>
.
|
Beta Was this translation helpful? Give feedback.
-
Got better with taking the date_trunc into a WITH... Timezone appears to switch to UTC sometimes though... |
Beta Was this translation helpful? Give feedback.
-
Looks right to me, not sure why it would switch to UTC for you. Especially if you set the timezone field to show current_setting('TIMEZONE') as Timezone, which should never change as it's stored in the DB settings and doesn't change. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Ok, it turned out, that although PGTZ is set to 'Europe/Berlin', /var/lib/postgresql/data/postgresql.conf contains 'Etc/UTC'. Changing that to 'Europe/Berlin' appears to fix the situation. @adriankumpf Could we take care for that in the distributed container? Or much simpler approach: just store the local timezone in the settings... @natrlhy Do you want to test it in UTC-7? |
Beta Was this translation helpful? Give feedback.
-
Oh that's easy, DST.
…On Thu, Jun 11, 2020, 4:15 AM DrMichael ***@***.***> wrote:
So strange, I have not the faintest, where that "Etc/UTC" is still coming
from. Simplified in Grafana it looks like:
[image: 2020-06-11 11_11_39-Window]
<https://user-images.githubusercontent.com/8087682/84367554-b0738a80-abd4-11ea-90b2-84da5d243b84.png>
In psql it looks like:
[image: 2020-06-11 11_12_04-Window]
<https://user-images.githubusercontent.com/8087682/84367577-b9fcf280-abd4-11ea-897a-2dd8a91bb7d9.png>
And date in the container gives me Thu 11 Jun 2020 11:12:56 AM CEST
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/adriankumpf/teslamate/issues/664#issuecomment-642522383>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAWPY3QZJBZPCJJSWN2WFKTRWCOEBANCNFSM4MT7EYFQ>
.
|
Beta Was this translation helpful? Give feedback.
-
Hmmm, what do you mean? |
Beta Was this translation helpful? Give feedback.
-
Daylight savings start and end.
…On Thu, Jun 11, 2020, 7:32 AM DrMichael ***@***.***> wrote:
Hmmm, what do you mean?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/adriankumpf/teslamate/issues/664#issuecomment-642613416>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAWPY3QL3BKNUOPIAQ53MLDRWDFGFANCNFSM4MT7EYFQ>
.
|
Beta Was this translation helpful? Give feedback.
-
Yes, sure. But my question was more: why do I get Etc/UTC in Grafana and Europe/Berlin in psql: Because PGTZ sets the timezone for the clients. |
Beta Was this translation helpful? Give feedback.
-
Grafana must be doing it, just don't know why. |
Beta Was this translation helpful? Give feedback.
-
Ah, no. |
Beta Was this translation helpful? Give feedback.
-
Ok, I share my latest version. Remember: you must change the timezone in the database container in (If you do not do it, it works with UTC, which leads to misleading entries in "Period"; at least for all UTC-N) @adriankumpf Could we take care for that in the distributed container? Or simpler approach: just store the local timezone in the settings... Or set the timezone of the database to the local one? |
Beta Was this translation helpful? Give feedback.
-
Committed my latest version. Still the timezone issue exists... |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe.
I was trying to figure out my estimated miles driven per month and how that has changed with COVID.
Would it be possible to add some monthly stats to the grafana chart, broken down by calendar month:
Miles Driven
Charges
Charging Cost
Fuel Efficiency
I am sure there are others.
Love this project, amazing work. Keep up the great work.
Beta Was this translation helpful? Give feedback.
All reactions