teslamate icon indicating copy to clipboard operation
teslamate copied to clipboard

Updates Dashboard Seems to Max Out at 1 Month

Open PlaysWithTrons opened this issue 2 years ago • 8 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

What happened?

My updates dashboard does not seem to display "Since Previous Update" Lengths greater than one month.

04/04/2022, 06:02:33 PM to 06/01/2022, 06:02:53 PM - Listed as 1 Month since the previous update. the

Expected Behavior

04/04/2022, 06:02:33 PM to 06/01/2022, 06:02:53 PM - Listed as 8 weeks since the previous update.

Steps To Reproduce

No response

Relevant log output

teslamate_1  | 2022-08-06 19:11:00.757 [info] GET /

Screenshots

Screen Shot 2022-08-06 at 3 03 02 PM

Additional data

No response

Type of installation

Docker

Version

V1.27.1

PlaysWithTrons avatar Aug 06 '22 19:08 PlaysWithTrons

I am going to make an assumption here, but since it is only 58 days it is not considered "two full months" since the last update. It is closer to two months than one month, I agree. But it is working as intended. Maybe we can add a tool tip similar to the drives where Grafana can give the specific number of days like it gives the specific hours and minutes from the drive. @DrMichael can validate my logic, being the Grafana and SQL expert.

cwanja avatar Aug 07 '22 15:08 cwanja

@DrMichael can validate my logic, being the Grafana and SQL expert.

Ah, no I am not... :) One could do image But that looks ugly...

DrMichael avatar Aug 07 '22 15:08 DrMichael

With the idea of cwanja, you could do something like that.

  1. Modify the last select to add the 5th line (since_last_update_days)
select	
  u.start_date as time,
  extract(EPOCH FROM u.end_date - u.start_date) AS update_duration,
  extract(EPOCH FROM u.start_date - lag(u.start_date) OVER (ORDER BY u.start_date)) AS since_last_update,
  trunc(extract(EPOCH FROM u.start_date - lag(u.start_date) OVER (ORDER BY u.start_date)) / 24 / 60 / 60) AS since_last_update_days,
  split_part(u.version, ' ', 1) as version,
  count(distinct cp.id) as chg_ct,
  convert_km(avg(r.battery_rng), '$length_unit')::numeric(6,2) AS avg_[[preferred_range]]_range_[[length_unit]]
  1. Add overide to since_last_update_days column to hide it in table
  2. Add overide to since_last_update column to add a data link title: ${__data.fields.since_last_update_days} days

As I started using Grafana a couple months ago, I'm pretty sure there are better ways to do it, but it's a start.

CrowMash avatar Aug 10 '22 07:08 CrowMash