Cant control OSRAM Smart+ Gardenpole RGBW (4058075036147)

configuration
items
zigbee2mqtt
Tags: #<Tag:0x00007f1e65378478> #<Tag:0x00007f1e65378298> #<Tag:0x00007f1e65378108>
(Martin Puff) #1

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

0 Likes

(Martin Puff) #2

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

0 Likes