Create New Switch in OpenRemote 2.0 Designer
1. Switch to the "Building Modeler" view in the designer.
2. New switches can be created either during New Device creation wizard (see Image 1) or by selecting an existing device from the left-hand side device menu and using 'Add Switch' button (see Image 2).

Image 1: Add Switch in New Device Dialog

Image 2: First select existing device and then choose New Switch from context menu
Create Switch
Switches aggregate at most two commands – set switch to 'on' or 'off' stage – and a sensor to update the switch model to the device's current switch state. This model contains all the protocol level details of a functioning switch unit.
This switch model is exposed to the User Interface designer as a single, unchangeable unit. The visual aspects of the switch – colors, labels, images, etc. – can be modified in the User Interface Designer view.

Image 3: New Switch Dialog
Give your switch a descriptive name – user interface designer is going to use this name to associate the switch model to UI components.
Then select one of the existing sensors to associate with the switch. This sensor should be 'switch' type and return the device's boolean switch status (see Designer 2.0 - Create New Sensor) for additional details).
Finally associate your switch with two distinct commands, one for setting the 'on' state and another for setting the 'off' state of the switch.
See Also