Hallo,könnte mir bitte jemand helfen beim Homematic RGBW Modul
<?
/**
* Set_HM_RGBW_Color
*
* Umwandeln eines HEX-RGB Wertes von einem IPS-Color-Picker in
* den benötigten Wert von 0-199 für den HomeMatic RGBW-Controller
*
* Christian Wolter
* Version 1.0, 28.10.2015
*/// Speichert des HEX-Wert vom Color-Picker
$Farbe = $_IPS[‚VALUE‘];
SetValue($_IPS[‚VARIABLE‘], $_IPS[‚VALUE‘]);// HEX-Wert in einzelne Werte für Rot / Grün / Blau zerlegen
$r = (($Farbe >> 16) & 0xFF);
$g = (($Farbe >> 8) & 0xFF);
$b = (($Farbe >> 0) & 0xFF);// Umwandeln der RGB Werte
$hsv = RGBtoHSV($r, $g, $b);// Schreiben des Homematic Hue Wert in den Controller
HM_WriteValueInteger(22849 /[Räume\Wohnzimmer\RGBW_COLOR]/, ‚COLOR‘, $hsv);/**
Umwandeln der RGB-Werte in ein Farbwert des HSV-Farbraum
RGB Werte: 0-255, 0-255, 0-255
H Wert: 0-360°
Homematic H Wert: 0-199
*/
function RGBtoHSV($R, $G, $B)
{
$R = ($R / 255);
$G = ($G / 255);
$B = ($B / 255);$maxRGB = max($R, $G, $B); $minRGB = min($R, $G, $B); $chroma = $maxRGB - $minRGB; if ($chroma == 0) return 0; if ($R == $minRGB) $h = 3 - (($G - $B) / $chroma); elseif ($B == $minRGB) $h = 1 - (($R - $G) / $chroma); else // $G == $minRGB $h = 5 - (($B - $R) / $chroma); $Hue = (60 * $h); $HomematicHue = ($Hue/1.8); if ($HomematicHue == 200) $HomematicHue = 199; return $HomematicHue;
}
?>
Es funktioniert aber leider kommt immer eine Fehlermeldung und zwar :
Notice: Undefined index: VALUE in C:\IP-Symcon\scripts\35161.ips.php on line 14
Notice: Undefined index: VARIABLE in C:\IP-Symcon\scripts\35161.ips.php on line 15
Notice: Undefined index: VALUE in C:\IP-Symcon\scripts\35161.ips.php on line 15
Warning: Variable #0 existiert nicht in C:\IP-Symcon\scripts\35161.ips.php on line 15
kann mir bitte jemand sagen was ich da falsch mache,danke??
MFG
Robert