Timeline for Basic UI

Did I understand that right that I need to use ? for the browser

but & for the webview

webview url ="/static/Visualization/Timeline.html?Item=KG_Gaeste_Fenster&serviceId=influxdb" height = 4

In the first link, you are querying the persistence REST API directly, so, yes, you should use ?. That won’t be of much use in a sitemap… I asked you to check if you can open the URL who was throwing the error just as a test.
On the second one, you are calling Timeline.html and you should specify the parameters with &.

I can display both Items now, open/close and 0/1.
Groups however no not work.
does not.

items file reads:
Group gdisplayFenster

Contact EG_Flur_Haustuer “Tür” (EG_Flur, gHaustuer,gdisplayFenster) {channel=…}

Using the REST API can you query persistence data for the group?
How do you persist the group?

I don’t. But gHaustuer is persisted. EG_Flur_Haustuer is a member gHaustuer. Since EG_Flur_Haustuer is the only member of gdisplayFenster I did not think that was a problem.

I was assuming that displaying the group concatenates all elements.
If i do persist the group in addition to its elements, does this result in twice the amount of data to be stored ?

If you use ServiceId=influxdb it works for Group and Item
If you use serviceId=influxdb it works for Item only

Can’t explain it. In Timeline.html it says
var serviceParameter = GetParameter(“ServiceId”);

In fact, if you use Item, you do not need any other parameter, just a “?”. Maybe it is then using the default persistence ?

This is the image I wanted to post further down, but the board wouln’t let me…
Now its up here where it doesn’t belong.

Same for longer periods, the image seems to be inverted.

Hello, I implemented this function and I just love it! only a question, when I stop on a plotted area it shows the time in 12 am/pm format even though the timeline is in the correct 24 format. And i would also like to translate in Italian the duration and hours. Can i get a clue on how to do it?Thanks in advance, GREAT JOB!!!

This is odd. If i plot I get:

If I plot one more hour,
I get all values inverted. I would love to post an image of it but this software wouldn’t let me. New users are so limited…
Edit: see two posts up.

Same for longer periods, the image seems to be inverted.

Hi guys!
Sorry for my late reply…


I get all values inverted.

I’m sorry, but I have no clue as why you are experience this. I’m no web programmer and all I did was to modify @patrik_gfeller’s work with help from Google and other forums.
AFAIK, this Timeline visualization only plots state changes, so my guess is that you don’t have enough data in your persistence… But, again, it’s only a guess. I’m using this chart type in my sitemap and I didn’t have any problems with it…

Well, I also wanted to make some modifications to the tooltip display and your question was just one more push for me to try something :smile:.
So, here is what I accomplished:

For translating the labels, you can take a look in Timeline.html and edit yourself the corresponding text (around line# 144):

					entry[2] = '<div class="ggl-tooltip">' +
						'<div><strong>' + label + '</strong></div>' +
						'<hr>' +
						'<table>' +
						'<tr><td><span>Start:</span></td><td>' + formatDate(entry[4],1) + '</td></tr>' +
						'<tr><td><span>End:</span></td><td>' + formatDate(entry[5],1) + '</td></tr>' +
						'</table><hr><table>' +
						'<tr><td><span>Duration:</span></td><td>' + duration_string + '</td></tr>' +
						'</table>' +

For changing the datetime format, you’ll have to take a look at formatDate function (lines# 64-100). Choose another format and use it in the tooltip’s definition or modify to suit your need.
It shouldn’t be complicated at all.

I updated the previous link with the new version, but, in any case here it is again.
Files modified: Visualization\Timeline.html and css\visualizationStyle.css.

1 Like


Thanks for this great feature. It improves my sitemap very much.

I discovered an issue with calculating the durations for the tooltip. The results always were less than 24h even if the state changes were longer than that. I have changed the calculation slightly to:

             var duration = Math.trunc((entry[5] - entry[4]) / 1000);
             var hours = parseInt( duration / 3600 );
             var minutes = parseInt( duration / 60 ) % 60;
             var seconds = duration % 60;

A second thing which seems to be nice to know for everyone is a way how to localize the timeline itself. When displaying a period longer than 24h the labels of the x-axis contain the abbreviations for the day. To streamline it with your local settings you can add the language option while loading the visualization package.

     google.charts.load("current", {
         packages: ["timeline"],
         language: "de"
1 Like

Hi All off you
This looks absolutely awesome, but no way i can get it to work, I just get a “white” space,
tried with edge an Chrome, same thing, tried the bare url in the browser : (
The percistance works fine as i get the Chart with the same group to work fine…

I downloaded Mihai_Badea html.zip, and changed the baseURL = “” still nothing…

Is it anything else i need to install to get this to work ?


I had the exact same white-space-issue. What solved it for me was adding every single item I wanted to display into the rrd4j.persist file -instead of just the group:

Strategies {
		    everyMinute : "0 * * * * ?"
        	everyHour : "0 0 * * * ?"
        	everyDay  : "0 0 0 * * ?"
        	default = everyChange
		    Items {
					timeline* : strategy = everyUpdate, everyMinute
                    timeline_item_1 : strategy = everyUpdate, everyMinute
                    timeline_item_2 : strategy = everyUpdate, everyMinute

Remains the nagging feeling that it shouldn’t be necessary as it seems very redundant.

1 Like

@Huge_Go Did you make it in english?


But I’m really busy and I couldn’t make it so far.

Thanks for your answer

maybe Some noob questions,

your help will me more than appreciated . you know the feeling to be close than ever :slight_smile:

1. Why do i have a such space (red square)?

    Text label="Security" icon="releaselock" {
        Frame label="Main" icon="alarm" {
                Selection item=HomeStatus icon="home"  label="Status"   mappings=[bye="Bye",lock="Lock",night="Night",back="Back",door="Door"]
                Default item=gpresence_Notification label="Last motion"					
                //myStr= Z_Door1 + " " +Z_Door1_LastUpdate
                Default item=DoorProxy_terrasse						 label="Terrace [%s]"	icon="door"
                Default item=Z_Door1_LastUpdate  label="Last update" icon="time" 
                Default item= mqtt_sensor_door label="Entry Door" icon="door"    
               // Default item= mqtt_sensor_door_LastUpdate label="Last update"  icon="time" 
                Default item= mqtt_sensor_door_LastUpdate1     
                Default item= mqtt_sensor_door_LastUpdate2     
                Default item= mqtt_sensor_door_LastUpdate3     
                Default item= mqtt_sensor_door_LastUpdate4     
                Default item= mqtt_sensor_door_LastUpdate5     
                Default item= mqtt_sensor_door_LastUpdate6     
                Default item= mqtt_sensor_door_LastUpdate7     
                Default item= mqtt_sensor_door_LastUpdate8     
                Default item= mqtt_sensor_door_LastUpdate9  	
                Default item= mqtt_sensor_door_LastUpdate10  	
                Webview url="/static/Visualization/Timeline.html?Item=mqtt_sensor_door&ServiceId=influxdb&Hours=12" height=12

                Default item=Door_Snooze_Switch						 label="Door_Snooze_Switch"	icon="door"


2. is it possible to change the font color or the X axis (currently black on black?

  1. Correct me if i am wrong. this widget could be displayed only when connected to the local network AND only from a browser

Guys, any ideas?

Please I would like to see this example! Thanks!!

1 Like

I want to access a sitemap containing timeline through a nginx reverse-proxy.
The local access “http://adress:8080/basicui/app?sitemap=diagnostic” works fine,
but when I try to access this site through a nginx-reverseproxy
https://adress.tld/basicui/app?sitemap=diagnostic” the timline dosnt appear.
Which changes are required to acces timline through a reverseproxy?