Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic refresh of dashboard charts #210

Closed
kvolleberg opened this issue Jan 2, 2017 · 3 comments
Closed

Automatic refresh of dashboard charts #210

kvolleberg opened this issue Jan 2, 2017 · 3 comments
Assignees
Milestone

Comments

@kvolleberg
Copy link

Hi Dennis,
First off: happy new year!

I have upgraded dsmr to the 1.5 version. You've made some nice enhancements.
I noticed you updated the dashboard page. In my 1.4 version, I included some code to automatically update my electricity charts with the latest reading. I thought this was useful for realtime monitoring; this saved me some unneccessary F5'ing.

Now, with the 1.5 version, my local mods have been removed and, as things have been changed quite a bit, it's not a matter of copy-paste anymore. Plus: it's not that robust to do this locally.

Therefore: I would like to suggest an auto-update method in a next version. What are your thoughts on this?

@dennissiemensma dennissiemensma added this to the 1.6 milestone Jan 2, 2017
@dennissiemensma
Copy link
Member

Happy new year to you as well!

I think it's a good improvement, so I'll surely add this later.

Regarding your local modifications, it's actually very easy to patch this feature in this version. This should do it already:

diff --git a/dsmr_frontend/templates/dsmr_frontend/dashboard.html b/dsmr_frontend/templates/dsmr_frontend/dashboard.html
index 8058e14..5ce2b45 100644
--- a/dsmr_frontend/templates/dsmr_frontend/dashboard.html
+++ b/dsmr_frontend/templates/dsmr_frontend/dashboard.html
@@ -365,6 +365,7 @@
                 /* Auto refresh. */
                 update_header();
                 setInterval(function(){ update_header(); }, 2500);
+                setInterval(function(){ update_graphs(); }, 5000);
                 
                 initialize_graphs();
             });

So juste add setInterval(function(){ update_graphs(); }, 5000); in dsmr_frontend/templates/dsmr_frontend/dashboard.html around line 368 and save it. (5000 = milliseconds refresh rate)

A browser page refresh should suffice to apply the changes.

@dennissiemensma
Copy link
Member

Merged to development branch.

@dennissiemensma dennissiemensma modified the milestones: 1.6, 1.5.2 Jan 6, 2017
@dennissiemensma
Copy link
Member

This ticket has been part of the new patch that was just released. It should update your dashboard graphs every few seconds.

Please note that it may take a minute when you have enabled the 'group readings by minute' setting in the configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants