Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[avmfritz] changing the color of a fritz!dect 500 lightblub isn't working #12427

Closed
vich-667 opened this issue Mar 5, 2022 · 6 comments · Fixed by #13317
Closed

[avmfritz] changing the color of a fritz!dect 500 lightblub isn't working #12427

vich-667 opened this issue Mar 5, 2022 · 6 comments · Fixed by #13317
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@vich-667
Copy link
Contributor

vich-667 commented Mar 5, 2022

Expected Behavior

I have a Fritz!Dect500 LightBlub connected to my Fritzbox 7590, both with the actual firmware. I also own some other stuff for example a Fritz!Dect200 what works well.

In my things inbox a FRITZ!DECT 500 and a HAN_FUN_COLOR_BULB is shown. The FRITZ!DECT 500 uses the ain shown in the Fritz!Box UI. The HAN_FUN_COLOR_BULB uses the same ain with an -1 in addition.

Current Behavior

  • with the FRITZ!DECT 500 nothing is working
  • with the HAN_FUN_COLOR_BULB i can change the brightness and switch the light blub on and off, but it is not possible to change hue or saturation. See also community posts.

Possible Solution

Steps to Reproduce (for Bugs)

  1. configure the things from inbox, create items and add them to the semantic model
  2. try to change the bightness, hue and saturation.

Context

Your Environment

  • Version used: (e.g., openHAB and add-on versions) openhab 3.2.0-1 and openhab-3.2.0-1
  • Environment name and version (e.g. Chrome 76, Java 8, Node.js 12.9, ...): Rasperry Pi3
  • Operating System and version (desktop or mobile, Windows 10, Raspbian Buster, ...): Raspbian GNU/Linux 10 (buster) and OpenJDK 11.0.12
  • Fritz!Dect500: 34.10.16.16.015
  • Fritzbox 7590: 07.29
@vich-667 vich-667 added the bug An unexpected problem or unintended behavior of an add-on label Mar 5, 2022
@sommer
Copy link

sommer commented Mar 22, 2022

According to the AHA HTTP spec (section 3.5) I found online, color bulbs only accept a few select combinations of hue/saturation (maybe this is why the FRITZ!DECT 500 reports a mapping=true attribute). Legal hue/saturation combinations can be queried using the getcolordefaults switchcmd.

Crucially, any other combination is silently discarded.

Crude sample code for OpenHAB 3.2.0 to "snap" selected hue/saturation to a hardcoded table of legal combinations extracted from a sample light bulb might look as follows (edit: for completeness, I also added a color temperature channel and set the light to pure white for low saturations). Note that, color temperature aside, the same pre-filtering could be done in rules as well.

diff --git a/bundles/org.openhab.binding.avmfritz/README.md b/bundles/org.openhab.binding.avmfritz/README.md
index 8e1c8251c2..bccb38b077 100644
--- a/bundles/org.openhab.binding.avmfritz/README.md
+++ b/bundles/org.openhab.binding.avmfritz/README.md
@@ -187,6 +187,7 @@ The AIN (actor identification number) can be found in the FRITZ!Box interface ->
 | on_off          | Switch                   | Switchable device (ON/OFF)                                                                                                                         | HAN_FUN_ON_OFF                                                                                                      |
 | brightness      | Dimmer                   | Dimmable lights                                                                                                                                    | HAN_FUN_DIMMABLE_BULB                                                                                               |
 | color           | Color                    | Color lights                                                                                                                                       | FRITZ!DECT 500, HAN_FUN_COLOR_BULB                                                                                  |
+| color_temperature | Dimmer                 | Color lights temperature                                                                                                                           | FRITZ!DECT 500, HAN_FUN_COLOR_BULB                                                                                  |
 | actual_temp     | Number:Temperature       | Current temperature of heating thermostat                                                                                                          | FRITZ!DECT 301, FRITZ!DECT 300, Comet DECT                                                                          |
 | set_temp        | Number:Temperature       | Set Temperature of heating thermostat                                                                                                              | FRITZ!DECT 301, FRITZ!DECT 300, Comet DECT                                                                          |
 | eco_temp        | Number:Temperature       | Eco Temperature of heating thermostat                                                                                                              | FRITZ!DECT 301, FRITZ!DECT 300, Comet DECT                                                                          |
diff --git a/bundles/org.openhab.binding.avmfritz/build.sh b/bundles/org.openhab.binding.avmfritz/build.sh
new file mode 100755
index 0000000000..50b7231b2d
--- /dev/null
+++ b/bundles/org.openhab.binding.avmfritz/build.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+set -e
+
+mvn clean install -DskipChecks -Dspotless.check.skip=true -o
+
+echo "Build successful"
diff --git a/bundles/org.openhab.binding.avmfritz/install.sh b/bundles/org.openhab.binding.avmfritz/install.sh
new file mode 100755
index 0000000000..72d2120d88
--- /dev/null
+++ b/bundles/org.openhab.binding.avmfritz/install.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+set -e
+
+echo "Installing"
+
+rm -f /usr/share/openhab/addons/*.jar
+cp \
+	/usr/share/openhab/runtime/system/org/jupnp/org.jupnp/2.6.0/org.jupnp-2.6.0.jar \
+	/root/.m2/repository/org/openhab/core/bundles/org.openhab.core.config.discovery/3.2.0/org.openhab.core.config.discovery-3.2.0.jar \
+	/usr/share/openhab/runtime/system/org/openhab/core/bundles/org.openhab.core.config.discovery.upnp/3.2.0/org.openhab.core.config.discovery.upnp-3.2.0.jar \
+	/root/.m2/repository/org/openhab/addons/bundles/org.openhab.binding.avmfritz/3.2.0/org.openhab.binding.avmfritz-3.2.0.jar \
+	/usr/share/openhab/addons/
diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/AVMFritzBindingConstants.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/AVMFritzBindingConstants.java
index 0c30a57e25..3c094a8a0e 100644
--- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/AVMFritzBindingConstants.java
+++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/AVMFritzBindingConstants.java
@@ -139,6 +139,7 @@ public class AVMFritzBindingConstants {
     public static final String CHANNEL_LAST_CHANGE = "last_change";
     public static final String CHANNEL_ROLLERSHUTTER = "rollershutter";
     public static final String CHANNEL_COLOR = "color";
+    public static final String CHANNEL_COLORTEMPERATURE = "color_temperature";
     public static final String CHANNEL_BRIGHTNESS = "brightness";
     public static final String CHANNEL_ON_OFF = "on_off";
 
diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/handler/AVMFritzBaseThingHandler.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/handler/AVMFritzBaseThingHandler.java
index e9942d1224..556d205b25 100644
--- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/handler/AVMFritzBaseThingHandler.java
+++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/handler/AVMFritzBaseThingHandler.java
@@ -157,7 +157,8 @@ public abstract class AVMFritzBaseThingHandler extends BaseThingHandler implemen
                 if (deviceModel.isHANFUNBlinds()) {
                     updateLevelControl(deviceModel.getLevelControlModel());
                 } else if (deviceModel.isColorLight()) {
-                    updateColorLight(deviceModel.getColorControlModel(), deviceModel.getLevelControlModel());
+                    updateColorLight(deviceModel.getColorControlModel(), deviceModel.getLevelControlModel(),
+                            deviceModel.getSimpleOnOffUnit());
                 } else if (deviceModel.isDimmableLight() && !deviceModel.isHANFUNBlinds()) {
                     updateDimmableLight(deviceModel.getLevelControlModel());
                 } else if (deviceModel.isHANFUNUnit() && deviceModel.isHANFUNOnOff()) {
@@ -203,11 +204,24 @@ public abstract class AVMFritzBaseThingHandler extends BaseThingHandler implemen
     }
 
     private void updateColorLight(@Nullable ColorControlModel colorControlModel,
-            @Nullable LevelControlModel levelControlModel) {
+            @Nullable LevelControlModel levelControlModel, @Nullable SimpleOnOffModel simpleOnOffUnit) {
         if (colorControlModel != null && levelControlModel != null) {
             DecimalType hue = new DecimalType(colorControlModel.hue);
             PercentType saturation = ColorControlModel.toPercent(colorControlModel.saturation);
             PercentType brightness = new PercentType(levelControlModel.getLevelPercentage());
+
+            if (simpleOnOffUnit.state == false) {
+                if (brightness.toBigDecimal().compareTo(BigDecimal.ZERO) > 0) {
+                    logger.debug("device is off, but brightness is nonzero - deliberately misreporting as zero");
+                    brightness = new PercentType(0);
+                }
+            } else {
+                if (brightness.toBigDecimal().compareTo(BigDecimal.ZERO) <= 0) {
+                    logger.debug("device is on, but brightness is zero - deliberately misreporting as nonzero");
+                    brightness = new PercentType(1);
+                }
+            }
+
             updateThingChannelState(CHANNEL_COLOR, new HSBType(hue, saturation, brightness));
         }
     }
@@ -411,8 +425,54 @@ public abstract class AVMFritzBaseThingHandler extends BaseThingHandler implemen
                 if (command instanceof HSBType) {
                     HSBType hsbType = (HSBType) command;
                     brightness = hsbType.getBrightness().toBigDecimal();
-                    fritzBox.setHueAndSaturation(ain, hsbType.getHue().intValue(),
-                            ColorControlModel.fromPercent(hsbType.getSaturation()), 0);
+                    int hue = hsbType.getHue().intValue();
+                    int sat = ColorControlModel.fromPercent(hsbType.getSaturation());
+
+                    if (sat >= 25) {
+                        if      ((hue >= 0    ) && (hue <=  16.5 ) && (sat >= 146  )) { hue = 358 ; sat= 180 ; }
+                        else if ((hue >= 0    ) && (hue <=  16.5 ) && (sat >= 83   )) { hue = 358 ; sat= 112 ; }
+                        else if ((hue >= 0    ) && (hue <=  16.5 ) && (sat >= 0    )) { hue = 358 ; sat= 54  ; }
+                        else if ((hue >= 16.5 ) && (hue <=  43.5 ) && (sat >= 177  )) { hue = 35  ; sat= 214 ; }
+                        else if ((hue >= 16.5 ) && (hue <=  43.5 ) && (sat >= 106  )) { hue = 35  ; sat= 140 ; }
+                        else if ((hue >= 16.5 ) && (hue <=  43.5 ) && (sat >= 0    )) { hue = 35  ; sat= 72  ; }
+                        else if ((hue >= 43.5 ) && (hue <=  72   ) && (sat >= 127.5)) { hue = 52  ; sat= 153 ; }
+                        else if ((hue >= 43.5 ) && (hue <=  72   ) && (sat >= 76.5 )) { hue = 52  ; sat= 102 ; }
+                        else if ((hue >= 43.5 ) && (hue <=  72   ) && (sat >= 0    )) { hue = 52  ; sat= 51  ; }
+                        else if ((hue >= 72   ) && (hue <=  106  ) && (sat >= 101  )) { hue = 92  ; sat= 123 ; }
+                        else if ((hue >= 72   ) && (hue <=  106  ) && (sat >= 58.5 )) { hue = 92  ; sat= 79  ; }
+                        else if ((hue >= 72   ) && (hue <=  106  ) && (sat >= 0    )) { hue = 92  ; sat= 38  ; }
+                        else if ((hue >= 106  ) && (hue <=  140  ) && (sat >= 121  )) { hue = 120 ; sat= 160 ; }
+                        else if ((hue >= 106  ) && (hue <=  140  ) && (sat >= 60   )) { hue = 120 ; sat= 82  ; }
+                        else if ((hue >= 106  ) && (hue <=  140  ) && (sat >= 0    )) { hue = 120 ; sat= 38  ; }
+                        else if ((hue >= 140  ) && (hue <=  177.5) && (sat >= 114.5)) { hue = 160 ; sat= 145 ; }
+                        else if ((hue >= 140  ) && (hue <=  177.5) && (sat >= 62.5 )) { hue = 160 ; sat= 84  ; }
+                        else if ((hue >= 140  ) && (hue <=  177.5) && (sat >= 0    )) { hue = 160 ; sat= 41  ; }
+                        else if ((hue >= 177.5) && (hue <=  203.5) && (sat >= 148.5)) { hue = 195 ; sat= 179 ; }
+                        else if ((hue >= 177.5) && (hue <=  203.5) && (sat >= 88.5 )) { hue = 195 ; sat= 118 ; }
+                        else if ((hue >= 177.5) && (hue <=  203.5) && (sat >= 0    )) { hue = 195 ; sat= 59  ; }
+                        else if ((hue >= 203.5) && (hue <=  218.5) && (sat >= 146  )) { hue = 212 ; sat= 169 ; }
+                        else if ((hue >= 203.5) && (hue <=  218.5) && (sat >= 83   )) { hue = 212 ; sat= 110 ; }
+                        else if ((hue >= 0    ) && (hue <=  218.5) && (sat >= 0    )) { hue = 212 ; sat= 56  ; }
+                        else if ((hue >= 0    ) && (hue <=  245.5) && (sat >= 146  )) { hue = 225 ; sat= 204 ; }
+                        else if ((hue >= 0    ) && (hue <=  245.5) && (sat >= 83   )) { hue = 225 ; sat= 135 ; }
+                        else if ((hue >= 218.5) && (hue <=  245.5) && (sat >= 0    )) { hue = 225 ; sat= 67  ; }
+                        else if ((hue >= 245.5) && (hue <=  281  ) && (sat >= 146  )) { hue = 266 ; sat= 169 ; }
+                        else if ((hue >= 245.5) && (hue <=  281  ) && (sat >= 83   )) { hue = 266 ; sat= 110 ; }
+                        else if ((hue >= 245.5) && (hue <=  281  ) && (sat >= 0    )) { hue = 266 ; sat= 54  ; }
+                        else if ((hue >= 281  ) && (hue <=  315.5) && (sat >= 146  )) { hue = 296 ; sat= 140 ; }
+                        else if ((hue >= 281  ) && (hue <=  315.5) && (sat >= 83   )) { hue = 296 ; sat= 92  ; }
+                        else if ((hue >= 281  ) && (hue <=  315.5) && (sat >= 0    )) { hue = 296 ; sat= 46  ; }
+                        else if ((hue >= 315.5) && (hue <=  346.5) && (sat >= 146  )) { hue = 335 ; sat= 180 ; }
+                        else if ((hue >= 315.5) && (hue <=  346.5) && (sat >= 83   )) { hue = 335 ; sat= 107 ; }
+                        else if ((hue >= 315.5) && (hue <=  346.5) && (sat >= 0    )) { hue = 335 ; sat= 51  ; }
+                        else if ((hue >= 346.5) && (hue <=  360  ) && (sat >= 146  )) { hue = 358 ; sat= 180 ; }
+                        else if ((hue >= 346.5) && (hue <=  360  ) && (sat >= 83   )) { hue = 358 ; sat= 112 ; }
+                        else if ((hue >= 346.5) && (hue <=  360  ) && (sat >= 0    )) { hue = 358 ; sat= 54  ; }
+                        fritzBox.setHueAndSaturation(ain, hue, sat, 0);
+                    } else {
+                        int temperature = 4700;
+                        fritzBox.setColorTemperature(ain, temperature, 0);
+                    }
                 } else if (command instanceof PercentType) {
                     brightness = ((PercentType) command).toBigDecimal();
                 } else if (command instanceof OnOffType) {
@@ -420,6 +480,33 @@ public abstract class AVMFritzBaseThingHandler extends BaseThingHandler implemen
                 }
                 if (brightness != null) {
                     fritzBox.setLevelPercentage(ain, brightness);
+                    if (brightness.compareTo(BigDecimal.ZERO) > 0) {
+                        logger.debug("brightness is nonzero - also setting on");
+                        fritzBox.setSwitch(ain, true);
+                    } else {
+                        logger.debug("brightness is zero - also setting off");
+                        fritzBox.setSwitch(ain, false);
+                    }
+                }
+                break;
+            case CHANNEL_COLORTEMPERATURE:
+                BigDecimal color_temperature = null;
+                if (command instanceof PercentType) {
+                    color_temperature = ((PercentType) command).toBigDecimal();
+                }
+                if (color_temperature != null) {
+                    int pct = color_temperature.intValue();
+                    int temperature = 2700;
+                    if ((pct >= 0 ) && (pct <= 11 )) { temperature = 2700; }
+                    if ((pct >= 11) && (pct <= 22 )) { temperature = 3000; }
+                    if ((pct >= 22) && (pct <= 33 )) { temperature = 3400; }
+                    if ((pct >= 33) && (pct <= 44 )) { temperature = 3800; }
+                    if ((pct >= 44) && (pct <= 55 )) { temperature = 4200; }
+                    if ((pct >= 55) && (pct <= 66 )) { temperature = 4700; }
+                    if ((pct >= 66) && (pct <= 77 )) { temperature = 5300; }
+                    if ((pct >= 77) && (pct <= 88 )) { temperature = 5900; }
+                    if ((pct >= 88) && (pct <= 100)) { temperature = 6500; }
+                    fritzBox.setColorTemperature(ain, temperature, 0);
                 }
                 break;
             case CHANNEL_SETTEMP:
diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/FritzAhaWebInterface.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/FritzAhaWebInterface.java
index 599bc8a311..1ad41e25e0 100644
--- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/FritzAhaWebInterface.java
+++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/FritzAhaWebInterface.java
@@ -35,6 +35,7 @@ import org.openhab.binding.avmfritz.internal.hardware.callbacks.FritzAhaCallback
 import org.openhab.binding.avmfritz.internal.hardware.callbacks.FritzAhaSetBlindTargetCallback;
 import org.openhab.binding.avmfritz.internal.hardware.callbacks.FritzAhaSetBlindTargetCallback.BlindCommand;
 import org.openhab.binding.avmfritz.internal.hardware.callbacks.FritzAhaSetColorCallback;
+import org.openhab.binding.avmfritz.internal.hardware.callbacks.FritzAhaSetColorTemperatureCallback;
 import org.openhab.binding.avmfritz.internal.hardware.callbacks.FritzAhaSetHeatingModeCallback;
 import org.openhab.binding.avmfritz.internal.hardware.callbacks.FritzAhaSetHeatingTemperatureCallback;
 import org.openhab.binding.avmfritz.internal.hardware.callbacks.FritzAhaSetLevelPercentageCallback;
@@ -335,6 +336,11 @@ public class FritzAhaWebInterface {
         return asyncGet(callback);
     }
 
+    public FritzAhaContentExchange setColorTemperature(String ain, int temperature, int duration) {
+        FritzAhaSetColorTemperatureCallback callback = new FritzAhaSetColorTemperatureCallback(this, ain, temperature, duration);
+        return asyncGet(callback);
+    }
+
     public FritzAhaContentExchange setBlind(String ain, BlindCommand command) {
         FritzAhaSetBlindTargetCallback callback = new FritzAhaSetBlindTargetCallback(this, ain, command);
         return asyncGet(callback);
diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaSetColorTemperatureCallback.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaSetColorTemperatureCallback.java
new file mode 100644
index 0000000000..824769936a
--- /dev/null
+++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaSetColorTemperatureCallback.java
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2010-2021 Contributors to the openHAB project
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.openhab.binding.avmfritz.internal.hardware.callbacks;
+
+import static org.eclipse.jetty.http.HttpMethod.GET;
+
+import java.math.BigDecimal;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.openhab.binding.avmfritz.internal.hardware.FritzAhaWebInterface;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Callback implementation for updating colortemperature. Supports reauthorization
+ *
+ * @author Christoph Sommer - Initial contribution
+ */
+@NonNullByDefault
+public class FritzAhaSetColorTemperatureCallback extends FritzAhaReauthCallback {
+
+    private final Logger logger = LoggerFactory.getLogger(FritzAhaSetColorTemperatureCallback.class);
+
+    private final String ain;
+
+    /**
+     * Constructor
+     *
+     * @param webIface Interface to FRITZ!Box
+     * @param ain AIN of the device that should be switched
+     * @param temperature Color Temperature in Kelvin (typ.: 2700 to 6500)
+     * @param duration Duration of the change in 100ms. 0 immediately.
+     */
+    public FritzAhaSetColorTemperatureCallback(FritzAhaWebInterface webIface, String ain, int temperature, int duration) {
+        super(WEBSERVICE_PATH, "switchcmd=setcolortemperature&temperature=" + temperature + "&duration=" + duration + "&ain=" + ain, webIface, GET,
+                1);
+        this.ain = ain;
+    }
+
+    @Override
+    public void execute(int status, String response) {
+        super.execute(status, response);
+        if (isValidRequest()) {
+            logger.debug("Received response '{}' for item '{}'", response, ain);
+        }
+    }
+}
diff --git a/bundles/org.openhab.binding.avmfritz/src/main/resources/OH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.avmfritz/src/main/resources/OH-INF/thing/thing-types.xml
index 8ff4a8e806..409cb775b2 100644
--- a/bundles/org.openhab.binding.avmfritz/src/main/resources/OH-INF/thing/thing-types.xml
+++ b/bundles/org.openhab.binding.avmfritz/src/main/resources/OH-INF/thing/thing-types.xml
@@ -322,6 +322,7 @@
 
 		<channels>
 			<channel id="color" typeId="system.color"/>
+			<channel id="color_temperature" typeId="system.color-temperature"/>
 		</channels>
 
 		<representation-property>ain</representation-property>

@vich-667
Copy link
Contributor Author

@sommer Thank you for your replay. Sorry for my late response, but it cost me some time to be able to try out your code snippets. (I'm absolutly new to Java and I don't go into that internals of openhab).

In a first step I tried to work with a rule, waht don't works well to me.

Finally I was able to run your code https://github.com/vich-667/openhab-addons/pull/1/files what works fine to me. I also read the pdf you linked. As far as I understand it, fritz box only support that dedicated values. If only this values are supported currently by the fritz box and it's light bub it would be great to add this to openhab.

In addition I have the effect that my FRITZ!DECT 500 is detected as FRITZ_DECT_500 and HAN_FUN_COLOR_BLUB, where only the HAN FUN thing works do me. I saw you only added the light temperature to the HAN FUN device. Is it the same to you?

@cweitkamp
Copy link
Contributor

Hi all, I have some good news for you. There is an undocumented method "setunmappedcolor" available for the HTTP interface which allows to set a user-defined color for the bulbs without restrictions related to the predefined color mappings.

I already tried to implement a solution for this. A test version can be installed via UI.

Settings -> JSON third-party Add-Ons: Insert URL "https://christophweitkamp.de/openhab/addons.json"

2

Settings -> Bindings: In section "Other Add-Ons" choose "CW - AVM FRITZ! Binding (stable)" and start installation. Note: Uninstall original AVM FRITZ! Binding before installing the test version.

2 (1)

Happy to get some feedback.

@cweitkamp
Copy link
Contributor

I submitted my changes in PR #13317

@sommer Are you planning to contribute the code for the color temperature channel?

@vich-667
Copy link
Contributor Author

@cweitkamp: I justed tested your solution with "setunmappedcolor". Works fine to me. But the same effect here. Only the "HAN_FUN_COLOR_BLUB" works but not the "FRITZ_DECT_500"

@sommer I would also like to have the color temperature channel in.

@outerSpaceToast
Copy link

It seems that with the current version of openHAB 3.4 changing color is working now, BUT obviously it is not possible to change back to white mode, after once having set a color option.
Did I miss something?
Is it planned to bring it back?
Also currently it is not possible to just change brightness, because as soon as you change something the bulb switches to color mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants