Chart with 2 items in sitemap

I know, that is possible to get a chart with multiple items (, but how can I integrate them in the sitemap?
I have tried: Chart item=TEMP_1,TEMP_2 period=h refresh=300 visibility=[CHART_PERIOD==0, CHART_PERIOD=="Uninitialized"], but it’s not working this way

You can only use one item, but a group is an item. Create a group maybe called temps and user it for the chart

In the items file

Group gTemperatures
Numer TEMP_1 "Temperatrue 1" (gTemperatures)
Numer TEMP_1 "Temperatrue 1" (gTemperatures)

And in the Sitemap

Chart item=gTemperatures period=h refresh=300 visibility=[CHART_PERIOD==0, CHART_PERIOD=="Uninitialized"]

This is not tested, but the was shiuld work in general



Here is how:

You need to make a group with the items you want to display (2, 3 or more…)
In this case you will find 3 items under group:

Number   Weather_Temp_Min         	"Temperatura min [%.2f °C]"  			<temperature> 	(Tiempo, Weather_Grafico_Temp)  	{weather="locationId=vitoria1, type=temperature, property=min, forecast=0"} 	//OK
Number   Weather_Temp_Max         	"Temperatura max [%.2f °C]"  			<temperature> 	(Tiempo, Weather_Grafico_Temp)  	{weather="locationId=vitoria1, type=temperature, property=max, forecast=0"}		//OK
Number   Weather_Temp      		"Temperatura exterior [%.2f °C]"   	<temperature> 	(Tiempo, Weather_Grafico_Temp)  	{weather="locationId=vitoria1, type=temperature, property=current"} 	//OK

Also in items file create the item for the group:

Group Weather_Grafico_Temp			"Grafica Temperaturas"

Now on Sitemap create a chart for the group item:

Frame label="Temperaturas"{
				Switch item=Weather_Chart_Period label="Chart Period" mappings=[0="Hour", 1="Day", 2="Week", 3="Month", 4="Year"]
				Chart item=Weather_Grafico_Temp period=h refresh=600 visibility=[Weather_Chart_Period==0]
				Chart item=Weather_Grafico_Temp  period=D refresh=900 visibility=[Weather_Chart_Period==1, Weather_Chart_Period=="NULL"]
				Chart item=Weather_Grafico_Temp  period=W refresh=3600 visibility=[Weather_Chart_Period==2]
				Chart item=Weather_Grafico_Temp  period=M refresh=3600 visibility=[Weather_Chart_Period==3]
				Chart item=Weather_Grafico_Temp  period=Y refresh=3600 visibility=[Weather_Chart_Period==4]

You need also to add the group into the persistance. If you are using rrd4j add in the config file the following line:

Weather_Grafico_Temp* : strategy = everyMinute, everyChange, restoreOnStartup

The * at the end of the group item is very important as it takes all items inside the group.

It will work


This works. I use it in my config in several places.

Works perfectly. Added this to documentation on GitHub:

This works good - but after using the Switch i have to reload to see the new chart - is there any way around that?


Welcome to the openHAB forum. :wave::wave::wave:

That might be a problem for the used browser or app.

Next time, please start a new thread with such a question.

1 Like