The resolution provided is 1/10s.
If no value is provided, the default value of the device is used.
+`extendedcolorlight` and `colorlight` have different modes for setting the color.
+Some devices accept only XY, others HSB, others both modes and the binding tries to autodetect the correct mode.
+If this fails, the advanced `colormode` parameter can be set to `xy` or `hs`.
+
### Textual Thing Configuration - Retrieving an API Key
If you use the textual configuration, the thing file without an API key will look like this, for example:
*/
private LightState lightStateCache = new LightState();
private LightState lastCommand = new LightState();
+ private String colorMode = "";
// set defaults, we can override them later if we receive better values
private int ctMax = ZCL_CT_MAX;
}
} else if (command instanceof HSBType) {
HSBType hsbCommand = (HSBType) command;
- if ("xy".equals(lightStateCache.colormode)) {
+ if ("xy".equals(colorMode)) {
PercentType[] xy = hsbCommand.toXY();
if (xy.length < 2) {
logger.warn("Failed to convert {} to xy-values", command);
}
LightMessage lightMessage = (LightMessage) stateResponse;
+
if (needsPropertyUpdate) {
// if we did not receive an ctmin/ctmax, then we probably don't need it
needsPropertyUpdate = false;
logger.trace("Ignoring differing update after last command until {}", lastCommandExpireTimestamp);
return;
}
+ if (colorMode.isEmpty()) {
+ String cmode = lightState.colormode;
+ if (cmode != null && ("hs".equals(cmode) || "xy".equals(cmode))) {
+ // only set the color mode if it is hs or xy, not ct
+ colorMode = cmode;
+ }
+ }
lightStateCache = lightState;
if (Boolean.TRUE.equals(lightState.reachable)) {
updateStatus(ThingStatus.ONLINE);
public String id = "";
public int lastSeenPolling = 1440;
public @Nullable Double transitiontime;
+ public String colormode = "";
}
</parameter>
</config-description>
-
<config-description uri="thing-type:deconz:light">
<parameter name="id" type="text" required="true">
<label>Device ID</label>
</parameter>
</config-description>
+ <config-description uri="thing-type:deconz:colorlight">
+ <parameter name="id" type="text" required="true">
+ <label>Device ID</label>
+ <description>The deCONZ bridge assigns an integer number ID to each device.</description>
+ </parameter>
+ <parameter name="transitiontime" type="decimal" required="false" min="0" unit="s">
+ <label>Transition Time</label>
+ <description>Time to move between two states. If empty, the default of the device is used. Resolution is 1/10 second.</description>
+ </parameter>
+ <parameter name="colormode" type="text" required="false">
+ <label>Color Mode</label>
+ <description>Override the default color mode (auto-detect)</description>
+ <options>
+ <option value="hs">HSB</option>
+ <option value="xy">XY</option>
+ </options>
+ <advanced>true</advanced>
+ </parameter>
+ </config-description>
+
</config-description:config-descriptions>
<representation-property>uid</representation-property>
- <config-description-ref uri="thing-type:deconz:light"/>
+ <config-description-ref uri="thing-type:deconz:colorlight"/>
</thing-type>
<thing-type id="extendedcolorlight">
<representation-property>uid</representation-property>
- <config-description-ref uri="thing-type:deconz:light"/>
+ <config-description-ref uri="thing-type:deconz:colorlight"/>
</thing-type>
<thing-type id="doorlock">