Sitemap - Visibility of an entire block

Hi,

I have defined a block in my sitemap. It contains all possible error messages I can have. Using the visibility-setting, error messages are only shown if their value is “OPEN” or “TRUE”.

This is an extract (not all error messages displayed):

Text label="Foutmeldingen" icon="error" {		
	Text item=KNX_ZO_TechnischeRuimte_Rookmelder_Alarm_11_4_0			label="Rookmelder zolder - Alarm [%s]" 				visibility=[KNX_ZO_TechnischeRuimte_Rookmelder_Alarm_11_4_0==OPEN]
	Text item=KNX_ZO_TechnischeRuimte_Rookmelder_RookAlarm_11_4_2			label="Rookmelder zolder - Rookalarm [%s]" 			visibility=[KNX_ZO_TechnischeRuimte_Rookmelder_RookAlarm_11_4_2==OPEN]
	Text item=KNX_ZO_TechnischeRuimte_Rookmelder_HitteAlarm_11_4_3			label="Rookmelder zolder - Hittealarm [%s]" 			visibility=[KNX_ZO_TechnischeRuimte_Rookmelder_HitteAlarm_11_4_3==OPEN]				
	Text item=KNX_ZO_TechnischeRuimte_Rookmelder_NetwerkAlarm_11_4_4		label="Rookmelder zolder - Netwerkalarm [%s]" 			visibility=[KNX_ZO_TechnischeRuimte_Rookmelder_NetwerkAlarm_11_4_4==OPEN]		
	}

The good thing is I only see the relevant error messages. The bad thing is, that I need to open up the error-message list to see if there are any messages.

Is it possible to have a visibility on this entire block? So that the block “Foutmeldingen” is only displayed if there is at least one error message?

Thanks!

Sure thing,

  1. See http://docs.openhab.org/configuration/sitemaps.html#visibility - you can give multiple comma separated OR criteria for visibility. In your case you would therefor simply list all you’ve already defined.

  2. If this might get too confusing for your taste you can define a helper Item and a Rule to set it to true if any error is TRUE

  3. The above can also be accomplished by an OR group: http://docs.openhab.org/configuration/items.html#group-item-types

Hi Thom,

Thank you for your reply.
I was thinking of using OR groups. However, I can not get it to work.

These are the items involved:

Contact KNX_ZO_TechnischeRuimte_Rookmelder_StatusTestAlarm_11_4_8		"Rookmelder Technische Ruimte Status Test alarm [%s]"		<fire>					(gZO_TechnischeRuimte, gRookmelder, gStatusmessage) 	{ knx="11/4/8" }
Contact KNX_ZO_TechnischeRuimte_Rookmelder_Alarm_11_4_0					"Rookmelder Technische Ruimte Alarm [%s]"					<fire>					(gZO_TechnischeRuimte, gRookmelder, gStatusmessage) 	{ knx="11/4/0" }
Contact KNX_ZO_TechnischeRuimte_Rookmelder_RookAlarm_11_4_2				"Rookmelder Technische Ruimte Rookalarm [%s]"				<fire>					(gZO_TechnischeRuimte, gRookmelder, gStatusmessage) 	{ knx="11/4/2" }
Group:Contact:OR(OPEN,CLOSED) gStatusmessage		"Status Message [%s]"								<error>				(gSet)

My sitemap for now:

Text item=gStatusmessage	label="Status Message [%s]"
Switch item=KNX_ZO_TechnischeRuimte_Rookmelder_TestAlarm_11_4_7			label="Test alarm"
Text item=KNX_ZO_TechnischeRuimte_Rookmelder_StatusTestAlarm_11_4_8		label="Status Test alarm [%s]"

If the item “KNX_ZO_TechnischeRuimte_Rookmelder_StatusTestAlarm_11_4_8” is set to “OPEN”, the group “gStatusmessage” does not get updated.

I don’t really understand what I am doing wrong.

Hi,
Ok, I think the problem was a missing space (Group:Contact:OR(OPEN,CLOSED) should be Group:Contact:OR(OPEN, CLOSED) ).

So thanks, I have now something that works perfectly. :slight_smile:

As a summary, this is my items file and sitemap:

Items:

Contact KNX_ZO_TechnischeRuimte_Rookmelder_Alarm_11_4_0					"Rookmelder Technische Ruimte Alarm [%s]"					<fire>					(gZO_TechnischeRuimte, gRookmelder, gStatusmessage) 	{ knx="11/4/0" }
Contact KNX_ZO_TechnischeRuimte_Rookmelder_RookAlarm_11_4_2				"Rookmelder Technische Ruimte Rookalarm [%s]"				<fire>					(gZO_TechnischeRuimte, gRookmelder, gStatusmessage) 	{ knx="11/4/2" }
Contact KNX_ZO_TechnischeRuimte_Rookmelder_HitteAlarm_11_4_3			"Rookmelder Technische Ruimte Hittealarm [%s]"				<fire>					(gZO_TechnischeRuimte, gRookmelder, gStatusmessage) 	{ knx="11/4/3" }
Contact KNX_ZO_TechnischeRuimte_Rookmelder_NetwerkAlarm_11_4_4			"Rookmelder Technische Ruimte Netwerkalarm [%s]"			<fire>					(gZO_TechnischeRuimte, gRookmelder, gStatusmessage) 	{ knx="11/4/4" }

Group:Contact:OR(OPEN, CLOSED)		gStatusmessage	"Status Message [%s]"								<error>				(gSet)

Sitemap:

Text label="Foutmeldingen" icon="error" visibility=[gStatusmessage==OPEN] {		
	Text item=KNX_ZO_TechnischeRuimte_Rookmelder_Alarm_11_4_0				label="Rookmelder zolder - Alarm [%s]" 					visibility=[KNX_ZO_TechnischeRuimte_Rookmelder_Alarm_11_4_0==OPEN]
	Text item=KNX_ZO_TechnischeRuimte_Rookmelder_RookAlarm_11_4_2			label="Rookmelder zolder - Rookalarm [%s]" 				visibility=[KNX_ZO_TechnischeRuimte_Rookmelder_RookAlarm_11_4_2==OPEN]
	Text item=KNX_ZO_TechnischeRuimte_Rookmelder_HitteAlarm_11_4_3			label="Rookmelder zolder - Hittealarm [%s]" 			visibility=[KNX_ZO_TechnischeRuimte_Rookmelder_HitteAlarm_11_4_3==OPEN]					
	Text item=KNX_ZO_TechnischeRuimte_Rookmelder_NetwerkAlarm_11_4_4		label="Rookmelder zolder - Netwerkalarm [%s]" 			visibility=[KNX_ZO_TechnischeRuimte_Rookmelder_NetwerkAlarm_11_4_4==OPEN]
}		

Thanks @ThomDietrich!

I have a bonus question:
Is it possible to show the number of error messages (= contacts with status OPEN in group gStatusmessage) in my sitemap as well? So the label “Foutmeldingen” should display for example “Foutmelding (12)”.

Thanks,

1 Like

Glad it worked out.
Hmm my best bet would be to add a second SUM group. If this doesn’t work, just build a Number Item and a Rule to update it :wink:

Hi Thom,

Thanks. Let’s suppose I create a second SUM group or a new number item (called “AmountOfErrors”), I can only display this in my sitemap as a separate line, right?

More specifically, the sitemap below:

Text label="Foutmeldingen" icon="error" visibility=[gStatusmessage==OPEN] {		
	Text item=KNX_ZO_TechnischeRuimte_Rookmelder_Alarm_11_4_0				label="Rookmelder zolder - Alarm [%s]" 					visibility=[KNX_ZO_TechnischeRuimte_Rookmelder_Alarm_11_4_0==OPEN]
	Text item=KNX_ZO_TechnischeRuimte_Rookmelder_RookAlarm_11_4_2			label="Rookmelder zolder - Rookalarm [%s]" 				visibility=[KNX_ZO_TechnischeRuimte_Rookmelder_RookAlarm_11_4_2==OPEN]
}

Would change in to:

Text label="Error messages" icon="error" visibility=[gStatusmessage==OPEN] {		
	Text item=KNX_ZO_TechnischeRuimte_Rookmelder_Alarm_11_4_0				label="Rookmelder zolder - Alarm [%s]" 					visibility=[KNX_ZO_TechnischeRuimte_Rookmelder_Alarm_11_4_0==OPEN]
	Text item=KNX_ZO_TechnischeRuimte_Rookmelder_RookAlarm_11_4_2			label="Rookmelder zolder - Rookalarm [%s]" 				visibility=[KNX_ZO_TechnischeRuimte_Rookmelder_RookAlarm_11_4_2==OPEN]
}
Text item=AmountOfErrors label="Number of error messages [s%]" visibility=[gStatusmessage==OPEN]

Implying I get one line allowing me to “deep dive” in the error messages and one additional line showing the amount.

Or can I get all of this in one line?

You don’t need the second line. Just combine them. This should do:

Text item=AmountOfErrors label="Error messages [%d]" icon="error" visibility=[gStatusmessage==OPEN] {	
	Text item=KNX_ZO_TechnischeRuimte_Rookmelder_Alarm_11_4_0				label="Rookmelder zolder - Alarm [%s]" 					visibility=[KNX_ZO_TechnischeRuimte_Rookmelder_Alarm_11_4_0==OPEN]
	Text item=KNX_ZO_TechnischeRuimte_Rookmelder_RookAlarm_11_4_2			label="Rookmelder zolder - Rookalarm [%s]" 				visibility=[KNX_ZO_TechnischeRuimte_Rookmelder_RookAlarm_11_4_2==OPEN]
}

Thanks, that is what I needed to know! :slight_smile:

Just realized your typing error for the value (“s%”). I’ve updated the snippet above.