Skip to content

Explanation of Sitemaps

Chris Jackson edited this page Nov 26, 2013 · 6 revisions

Sitemap Definition

Introduction

Sitemaps are used to create elements of a user interface for making openHAB items accessible to various frontends.

Sitemaps are a declarative UI definition. With a few lines it is possible to define the structure and the content of your UI screens. Sitemap files are stored in ${openhab_home}/configurations/sitemaps.

The openHAB runtime comes with a demo sitemap file, which should let you easily understand its structure.

For easy editing, the openHAB Designer brings full IDE support for these files, so you can easily check the syntax and find out about the options you have. (Again, for the technically interested, this is also an Xtext DSL.)

Syntax

Sitemaps can be composed by grouping various user interface elements into areas, which will be rendered by openHAB.

The following elements can be used in a sitemap definition file (alphabetical order):

Element name Description
Colorpicker
Chart
Frame Area with either various other sitemap elements or further nested frames
Group Renders all elements of a given group defined in an items defintion file
Image Renders an image
List
Switch Renders a switch item
Selection Renders a selection item
Setpoint
Slider Renders a slider
Text Renders a text element
Video Displays a video
Webview

Element 'Colorpicker'

Syntax:

Colorpicker [item="<itemname>"] [label="<labelname>"] [icon="<iconname>"] [sendFrequency=""]

Element 'Frame'

Frames are used to create a visually separated area of items.

Syntax:

Frame [label="<labelname>"] [icon="<icon>"] [item="<item">]
{
	[additional sitemap elements]
}

Element 'Group'

Syntax:

Group [item="<itemname>"] [label="<labelname>"] [icon="<iconname>"]

Element 'Image'

Syntax:

Image [item="<itemname>"] [icon="<iconname>"] url="<url of image>" [label="<labelname>"] [refresh=xxxx]

refresh is the refresh period of the image in milliseconds

Element 'Chart'

Syntax:

Image [item="<itemname>"] [icon="<iconname>"] [label="<labelname>"] [service="<service>"] [period=xxxx] [refresh=xxxx]

refresh is the refresh period of the image in milliseconds

Element 'Switch'

Syntax:

Switch item="<itemname>" [label="<labelname>"] [icon="<iconname>"] [mappings="<mapping definition>"]

Element 'Selection'

Syntax:

Selection item="<itemname>" [label="<labelname>"] [icon="<iconname>"] [mappings="<mapping definition>"]

Element 'Setpoint'

Syntax:

Setpoint item="<itemname>" [label="<labelname>"] [icon="<iconname>"] minValue="<min value>" maxValue="<max value>" step="<step value>"

Element 'Slider'

Syntax:

Slider item="<itemname>" [label="<labelname>"] [icon="<iconname>"] [sendFrequency="frequency"] [switchEnabled="switchSupport"]

Element 'List'

Syntax:

List item="<itemname>" [label="<labelname>"] [icon="<iconname>"] [separator=""]

Element 'Text'

Syntax:

Text item="<itemname>" [label="<labelname>"] [icon="<iconname>"]

Element 'Video'

Syntax:

Video item="<itemname>"  [icon="<iconname>"] url="<url of video to embed>"

Element 'Webview'

Syntax:

Webview item="<itemname>" [label="<labelname>"] [icon="<iconname>"] url="<url>" [height="<heightvalue"]

Installation

Community

Features

Samples

Release Notes

Clone this wiki locally