teslamate
teslamate copied to clipboard
Updates Dashboard Seems to Max Out at 1 Month
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

Additional data
No response
Type of installation
Docker
Version
V1.27.1
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.
@DrMichael can validate my logic, being the Grafana and SQL expert.
Ah, no I am not... :)
One could do
But that looks ugly...
With the idea of cwanja, you could do something like that.
- 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]]
- Add overide to since_last_update_days column to hide it in table
- 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.