Watch Onoff
Attributes
Common
ID
Sets the object's ID.
The ID identifies the object and is used to reference it in UISet actions, allowing to change its attributes dynamically.
The ID is not unique, it can be shared among multiple objects to quickly change a common attribute.
IDs can't be changed with a UISet action, but they can have a Value Binding assigned to them. Value Bindings on IDs allow an object to be dinamically attached to a set of attribute values.
E.g. the following Value Binding switches the ID of the object between mybutton1 and mybutton2 based on the value of the UISet button.address:
Value binding:
="mybutton" + ui('button', 'address')
UISet:
UISet('button', 'address', '1') switches the ID to mybutton1
UISet('button', 'address', '2') switches the ID to mybutton2
Label
Specifies the label.
Attribute Values
| Value | Description |
|---|---|
| <string> | Label text. |
Action
Specifies the action performed when tapped.
Attribute Values
| Value | Description |
|---|---|
| user | Sends a command to the server, with the specified name and parameter. |
| device | Toggles a datapoint. |
Name
Specifies the name of the command.
Attribute Values
| Value | Description |
|---|---|
| <string> | Command name. |
This attribute is available when action is "user".
Param
Specifies the parameter of the command.
Attribute Values
| Value | Description |
|---|---|
| <string> | Command parameter. |
This attribute is available when action is "user".
Address
Specifies the datapoint.
Attribute Values
| Value | Description |
|---|---|
| <string> | Datapoint address. |
This attribute is available when action is "device".
Confirm
Specifies whether the button needs to be tapped twice to perform the action.
Attribute Values
| Value | Description |
|---|---|
| false | Default value. Button needs to be tapped once. |
| true | Button needs to be tapped twice. |
The default value is: false.
Meta
Comment
Specifies a comment, visible only in the Project Editor. It can be used to add a note or a tag to the object. The filter in the object's SELECT panel applies to the comment as well.
This attribute is static. Its value can't be changed dynamically with a uiSet command or with a value binding.