Device: Dimmable Light
This device description describes a dimmable light.
Dimmable Light introduction
A dimmable-light resembles a light with dimming capabilities and an optional color and temperature (for warm/cold white light).
Profile name
The profile for this device is homie-light-dimmable/1/0. It is located in the device description JSON document in the device level $profile attribute, and the $profile topic.
Examples
Description:
{
  "homie": "5.0",
  "name": "main-light",
  "version": 3,
  "$profile": ["homie-light-dimmable/1/0"],
  "nodes": {
    "power": {
      "$profile": ["homie-power-switch/1/0"],
      ...
    },
    "brightness": {
      "$profile": ["homie-level/1/0"],
      ...
    }
    "color": {
      "name": "color",
      "value": {
        "settable": true,
        "retained": true,
        "type": "color",
        "format": "rgb",
      },
      ...
    }
    "temperature": {
      "$profile": ["homie-level/1/0"],
      ...
    }
    "action": {
      "$profile": ["homie-action/1/0"],
      ...
    }
  }
}
Topics:
homie/5/main-light/$profile/homie-light-dimmable/1 → "0"
Device logic
Power and Brightness are independent. The brightness value cannot be 0, as the light would be off. The brightness value must be between 1 and 100. To turn the device off, the power node must be set to false.
Some properties have related or overlapping values. The temperature value overlaps with the color value. And if the color is encoded as hsv or rgb, the brightness value is also included in the color value.
Nodes
This device-profile implements the following nodes and capability-profiles:
| Node-ID | Capability-Profile | required | additional requirements | 
|---|---|---|---|
| power | homie-power-switch/1/0 | yes | yes | 
| brightness | homie-level/1/0 | yes | yes | 
| action | homie-action/1/0 | no | yes | 
| temperature | homie-level/1/0 | no | yes | 
| color | n.a. | no | yes | 
Additional nodes MAY be added to the device.
power (required)
The brightness node MUST conform to the following additional requirements:
- A change in state of the powernode MUST NOT affect thebrightnessvalue. They are independent.
brightness (required)
The brightness node MUST conform to the following additional requirements:
- The unitattribute of thevalueproperty MUST be set to%(percent).
- The formatattribute of thevalueproperty MUST be set to a minimum of1and a maximum of100.
- 1represents the lowest possible brightness at which the light is still visibly on.
- A change in brightnessvalue MUST NOT affect thepowerstate. They are independent.
- Changing the brightness value MUST change the valueproperty of thecolornode if it is represented ashsvorrgb(since they include brightness information).
action (optional)
The action node (optional) implements the following actions:
| action | optional | description | 
|---|---|---|
| toggle | yes | maps to the powernode, implementing thetoggleaction of thehomie-power-switchcapability. | 
| step-up | yes | maps to the brightnessnode, implementing thestep-upaction of thehomie-levelcapability. | 
| step-down | yes | maps to the brightnessnode, implementing thestep-downaction of thehomie-levelcapability. | 
temperature (optional)
The temperature node (optional) MUST conform to the following additional requirements:
- The unitattribute of thevalueproperty MUST be set toK(Kelvin).
- Changing the temperature value MUST change the valueproperty of thecolornode. Thevalueproperty of thecolornode MUST be set to the color matching the temperature and the current brightness.
color (optional)
The color node (optional) represents the color of the light.
Property: value
The value property (required) is the property of type color that holds the color value and allows to update it.
| attributes | value | remark | 
|---|---|---|
| property-id | " value" | |
| settable | true | |
| retained | true | |
| type | " color" | |
| format | the standard formatfor colors. It MUST includergb, other color formats MAY be specified in addition. | 
Upon updating the value, the brightness property MUST be updated accordingly if the value is set as an rgb or hsv value (since they include brightness information).