[SOVLED] Cant control OSRAM Smart+ Gardenpole RGBW (4058075036147)

Hello Community,

i have the OSRAM Smart+ Gardenpole RGBW, it is connectet to zigbee2mqtt, but i cant control it.
Has someone a sample how to control it?

i have tried this configuration:

Switch OSRAM_Smart_Gardenpole_RGBW_1                        "Spot Garten 1"                                   <light>       (Lights, Lampe, Spot_Garten, Garden)        {mqtt=">[mosquitto:zigbee2mqtt2/OSRAM_Smart_Gardenpole_RGBW_1/set:command:*:JS(setZigbeeState.js)],<[mosquitto:zigbee2mqtt2/OSRAM_Smart_Gardenpole_RGBW_1:state:JSONPATH($.state)]"}
Color  OSRAM_Smart_Gardenpole_RGBW_1_Color                  "Spot Color"                                      <light>       (Garden)                                    {mqtt=">[mosquitto:zigbee2mqtt2/OSRAM_Smart_Gardenpole_RGBW_1/set:command:*:JS(hsv2xyz.js)]"}
Dimmer OSRAM_Smart_Gardenpole_RGBW_1_Dimmen                 "Spot Garten 1 Dimmen"                            <light>       (Spot_Garten, Garden)                       {mqtt=">[mosquitto:zigbee2mqtt2/OSRAM_Smart_Gardenpole_RGBW_1/set:command:*:JS(setZigbeeBrightness.js)],<[mosquitto:zigbee2mqtt2/OSRAM_Smart_Gardenpole_RGBW_1:state:JS(getZigbeeBrightness.js)]"}
  • setZigbeeState.js
(function(x){

    var result = new Object();
    result.state = x;
 
    return JSON.stringify(result);
    
})(input)
  • hsv2xyz.js
/**
 * hsv2xyz.js Convert OpenHab HSV to xy for Hue/Lightify
 * 8/2018 C.Schmidhuber 
 * @param str string "h,s,v"
 * @return json-string 
 */
(function(str){

    var gamma = function (c)
    {
        return (c > 0.04045) ? Math.pow((c + 0.055) / (1.0 + 0.055), 2.4) : (c / 12.92);
    };

    // hsv/hsb to rgb
    // h,s,v = [0..1]
    var hsvToRgb = function(h, s, v) 
    {
        // @see https://gist.github.com/mjackson/5311256
        var r, g, b;
      
        var i = Math.floor(h * 6);
        var f = h * 6 - i;
        var p = v * (1 - s);
        var q = v * (1 - f * s);
        var t = v * (1 - (1 - f) * s);
      
        switch (i % 6) {
          case 0: r = v, g = t, b = p; break;
          case 1: r = q, g = v, b = p; break;
          case 2: r = p, g = v, b = t; break;
          case 3: r = p, g = q, b = v; break;
          case 4: r = t, g = p, b = v; break;
          case 5: r = v, g = p, b = q; break;
        }
      
        return [ r , g , b  ];
      };

    x = str.split(",");
    x = hsvToRgb(x[0]/360, x[1]/100, x[2]/100);
    red = x[0];
    green =x[1];
    blue = x[2]; 

    // gamma 
    red = gamma(red);
    green = gamma(green);
    blue = gamma(blue);
        // @see https://github.com/mikz/PhilipsHueSDKiOS/blob/master/ApplicationDesignNotes/RGB%20to%20xy%20Color%20conversion.md
    // rgb to XYZ
    var X = red * 0.649926 + green * 0.103455 + blue * 0.197109; 
    var Y = red * 0.234327 + green * 0.743075 + blue * 0.022598;
    var Z = red * 0.0000000 + green * 0.053077 + blue * 1.035763;    

    // XYZ to xy
    var x = X / (X + Y + Z); 
    var y = Y / (X + Y + Z);

    return JSON.stringify({
        'color': {'x':x,'y':y,'brightness':Y} // brightness currently not supported this way by zigbee-shepard
    });
    
})(input)
  • setZigbeeBrightness.js
(function(x){

    var brightness = x*255/100;

    var result = new Object();
    result.brightness = brightness;
 
    return JSON.stringify(result);
    
})(input)

i have the setZigbeeBrightness.js also in use for Ikea Tradfri_GU10, and this is workin.

i get no data from the Osram light when i subscribe zigbee2mqtt2/OSRAM_Smart_Gardenpole_RGBW_1

kind regards,
Martin

The Problem was a bug in the zigbee2mqtt 1.3.0 version.
now with v1.3.1 its working!

Hi Martin,

I have bought the OSRAM Gardenpole and got stuck configuring the device. Could you post the relevant things you configured?

Thanks in advance.

Hello Sebastian,

this is my config (i have 3 Osram Gardenpole)

item file:

Switch OSRAM_Smart_Gardenpole_RGBW                          "Licht Garten"                                    <light>       (Lights, Lampe, Spot_Garten, Garden) ["Lighting"]
Dimmer OSRAM_Smart_Gardenpole_RGBW_Dimmen                   "Licht Garten Dimmen"                             <light>       (Garden, Spot_Garten) ["Lighting"]
Color OSRAM_Smart_Gardenpole_RGBW_Color                     "Licht Garten Farbe"                              <light>       (Garden)              ["Lighting"]

Switch OSRAM_Smart_Gardenpole_RGBW_1                        "Licht Garten"                                   <light>                                                   {mqtt=">[mosquitto:zigbee2mqtt2/OSRAM_Smart_Gardenpole_RGBW_1/set:command:*:MAP(json_onoff.map)],<[mosquitto:zigbee2mqtt2/OSRAM_Smart_Gardenpole_RGBW_1:state:JSONPATH($.state)]"}
Color  OSRAM_Smart_Gardenpole_RGBW_1_Color                  "Licht Garten Farbe 1"                             <light>                                                   {mqtt=">[mosquitto:zigbee2mqtt2/OSRAM_Smart_Gardenpole_RGBW_1/set:command:*:JS(hsv2xyz.js)]"}
Dimmer OSRAM_Smart_Gardenpole_RGBW_1_Dimmen                 "Licht Garten Dimmen"                            <light>                                                   {mqtt=">[mosquitto:zigbee2mqtt2/OSRAM_Smart_Gardenpole_RGBW_1/set:command:*:JS(setZigbeeBrightness.js)],<[mosquitto:zigbee2mqtt2/OSRAM_Smart_Gardenpole_RGBW_1:state:JS(getZigbeeBrightness.js)]"}

Switch OSRAM_Smart_Gardenpole_RGBW_2                        "Licht Garten"                                   <light>                                                   {mqtt=">[mosquitto:zigbee2mqtt2/OSRAM_Smart_Gardenpole_RGBW_2/set:command:*:MAP(json_onoff.map)],<[mosquitto:zigbee2mqtt2/OSRAM_Smart_Gardenpole_RGBW_2:state:JSONPATH($.state)]"}
Color  OSRAM_Smart_Gardenpole_RGBW_2_Color                  "Licht Garten Farbe"                             <light>                                                   {mqtt=">[mosquitto:zigbee2mqtt2/OSRAM_Smart_Gardenpole_RGBW_2/set:command:*:JS(hsv2xyz.js)]"}
Dimmer OSRAM_Smart_Gardenpole_RGBW_2_Dimmen                 "Licht Garten Dimmen"                            <light>                                                   {mqtt=">[mosquitto:zigbee2mqtt2/OSRAM_Smart_Gardenpole_RGBW_2/set:command:*:JS(setZigbeeBrightness.js)],<[mosquitto:zigbee2mqtt2/OSRAM_Smart_Gardenpole_RGBW_2:state:JS(getZigbeeBrightness.js)]"}

Switch OSRAM_Smart_Gardenpole_RGBW_3                        "Licht Garten"                                   <light>                                                   {mqtt=">[mosquitto:zigbee2mqtt2/OSRAM_Smart_Gardenpole_RGBW_3/set:command:*:MAP(json_onoff.map)],<[mosquitto:zigbee2mqtt2/OSRAM_Smart_Gardenpole_RGBW_3:state:JSONPATH($.state)]"}
Color  OSRAM_Smart_Gardenpole_RGBW_3_Color                  "Licht Garten Farbe"                             <light>                                                   {mqtt=">[mosquitto:zigbee2mqtt2/OSRAM_Smart_Gardenpole_RGBW_3/set:command:*:JS(hsv2xyz.js)]"}
Dimmer OSRAM_Smart_Gardenpole_RGBW_3_Dimmen                 "Licht Garten Dimmen"                            <light>                                                   {mqtt=">[mosquitto:zigbee2mqtt2/OSRAM_Smart_Gardenpole_RGBW_3/set:command:*:JS(setZigbeeBrightness.js)],<[mosquitto:zigbee2mqtt2/OSRAM_Smart_Gardenpole_RGBW_3:state:JS(getZigbeeBrightness.js)]"}

rule file:

	rule "Spots im Garten einschalten"
	when
        	Item OSRAM_Smart_Gardenpole_RGBW changed to ON
	then
		OSRAM_Smart_Gardenpole_RGBW_1.sendCommand(ON)
		OSRAM_Smart_Gardenpole_RGBW_2.sendCommand(ON)
		OSRAM_Smart_Gardenpole_RGBW_3.sendCommand(ON)
end

	rule "Spots im Garten ausschalten"
	when
        	Item OSRAM_Smart_Gardenpole_RGBW changed to OFF
	then
		OSRAM_Smart_Gardenpole_RGBW_1.sendCommand(OFF)
		OSRAM_Smart_Gardenpole_RGBW_2.sendCommand(OFF)
		OSRAM_Smart_Gardenpole_RGBW_3.sendCommand(OFF)
end

rule "Spots im Garten Dimmen"
when
    Item OSRAM_Smart_Gardenpole_RGBW_Dimmen received command
then
    var value = OSRAM_Smart_Gardenpole_RGBW_Dimmen.state as PercentType
    OSRAM_Smart_Gardenpole_RGBW_1_Dimmen.sendCommand(value)
    OSRAM_Smart_Gardenpole_RGBW_2_Dimmen.sendCommand(value)
	OSRAM_Smart_Gardenpole_RGBW_3_Dimmen.sendCommand(value)
end

rule "Spots im Garten Farbe ändern"
when
    Item OSRAM_Smart_Gardenpole_RGBW_Color received command
then
    var value = OSRAM_Smart_Gardenpole_RGBW_Color.state as PercentType
    OSRAM_Smart_Gardenpole_RGBW_1_Color.sendCommand(value)
    OSRAM_Smart_Gardenpole_RGBW_2_Color.sendCommand(value)
	OSRAM_Smart_Gardenpole_RGBW_3_Color.sendCommand(value)
end

transform files:

json_onoff.map:

ON={"state":"ON"}
OFF={"state":"OFF"}
1={"state":"ON"}
0={"state":"OFF"}

getZigbeeBrightness:

(function(x){

    var result;
 
    var json = JSON.parse(x);  
    result = json.brightness * 100 / 255;

    return result;
    
})(input)

hsv2xyz.js:

/**
 * hsv2xyz.js Convert OpenHab HSV to xy for Hue/Lightify
 * 8/2018 C.Schmidhuber 
 * @param str string "h,s,v"
 * @return json-string 
 */
(function(str){

    var gamma = function (c)
    {
        return (c > 0.04045) ? Math.pow((c + 0.055) / (1.0 + 0.055), 2.4) : (c / 12.92);
    };

    // hsv/hsb to rgb
    // h,s,v = [0..1]
    var hsvToRgb = function(h, s, v) 
    {
        // @see https://gist.github.com/mjackson/5311256
        var r, g, b;
      
        var i = Math.floor(h * 6);
        var f = h * 6 - i;
        var p = v * (1 - s);
        var q = v * (1 - f * s);
        var t = v * (1 - (1 - f) * s);
      
        switch (i % 6) {
          case 0: r = v, g = t, b = p; break;
          case 1: r = q, g = v, b = p; break;
          case 2: r = p, g = v, b = t; break;
          case 3: r = p, g = q, b = v; break;
          case 4: r = t, g = p, b = v; break;
          case 5: r = v, g = p, b = q; break;
        }
      
        return [ r , g , b  ];
      };

    x = str.split(",");
    x = hsvToRgb(x[0]/360, x[1]/100, x[2]/100);
    red = x[0];
    green =x[1];
    blue = x[2]; 

    // gamma 
    red = gamma(red);
    green = gamma(green);
    blue = gamma(blue);
        // @see https://github.com/mikz/PhilipsHueSDKiOS/blob/master/ApplicationDesignNotes/RGB%20to%20xy%20Color%20conversion.md
    // rgb to XYZ
    var X = red * 0.649926 + green * 0.103455 + blue * 0.197109; 
    var Y = red * 0.234327 + green * 0.743075 + blue * 0.022598;
    var Z = red * 0.0000000 + green * 0.053077 + blue * 1.035763;    

    // XYZ to xy
    var x = X / (X + Y + Z); 
    var y = Y / (X + Y + Z);

    return JSON.stringify({
        'color': {'x':x,'y':y,'brightness':Y} // brightness currently not supported this way by zigbee-shepard
    });
    
})(input)

Okay, I think I found the issue I am having. You are using the MQTT1 binding? I wasn’t aware until now, that there are different syntax for both versions and another ways of configuring the items as well.

Generally I would like to use the MQTT2 binding. Is there any reason not to use MQTT2? Will it be possible to use this approach also with MQTT2?

Thanks so far. :slight_smile:

Okay, nevermind. I just found your other thread where you had the same problem.

I will give the MQTT1 binding a try as well.