Reading attributes
Commands, state and messages all use the same three numbers: the element, the attribute and its values.
{ "<element>": { "<attribute>": [attribute, value 1, value 2, …] } }- Element: a part of the device you control separately. A one-gang switch has one element, a
three-gang switch three. Their numbers come from the device (
elementIds). - Attribute: what is set or reported, by number.
1is On Off,28Brightness. - Values: after the attribute id, in a fixed order. The attribute tables say what each one means.
Examples
Section titled “Examples”| You see | It means |
|---|---|
"1": [1, 1] |
On Off: on |
"1": [1, 0] |
On Off: off |
"28": [28, 750] |
Brightness: 750 out of 1000 |
"29": [29, 4000] |
Colour temperature: 4000 K |
"2": [2, 3, 40] |
Open Close Control: go to a position (3), 40% |
"49": [49, 265] |
Temperature: 26.5 °C. This attribute is divided by 10 |
"9": [9, 80] |
Battery: 80% |
A command uses the same array: send [1, 1] to switch an element on. See
Controlling devices.
Kinds of attribute
Section titled “Kinds of attribute”| Kind | What it is | Table |
|---|---|---|
| Commands | What you can tell a device to do | Commands |
| States | What a device reports about itself | States |
| Events | Something that happened, such as a button press | Events |
| Information | Facts such as a version | Information |
Ranges with decimals
Section titled “Ranges with decimals”Values are whole numbers. When an attribute has decimals, its table says what to divide by: a
temperature of 265 with “divide by 10” is 26.5.