Philips Hue mit VU+ und Boblight oder Ambilight

    Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

    • So, alle Lampen gehen.
      Lag natürlich daran, das die anderen beiden Lampen im Script ausgeklammert waren.
      Jetzt habe ich noch das Problem, das alle Lampen den selben Farbraum wieder geben.
      Wie ermittel ich die besten Einstellungen für vscan und hscan?
      Desweiteren benötige ich für left 2 Lampen.
      Wie kann ich das bewerkstelligen?

      LG kalle

      Vielen Dank nochmal für diesen Thread.
      Hat mir vorerst den neuen TV erspart.
    • So, habe jetzt 4 Lampen am Laufen.
      Statt eine 2. linke, habe ich jetzt noch eine als top eingefügt.
      Allerdings bekomme ich das Problem nicht gelöst, das alle Lampen die selben Farben wiedergeben.
      Ich habe schon etliche Einstellungen in der enigmalight.conf getestet.
      Habe mir sogar eine Config mit dem Boblight Config Tool erstellt und die Werte übernommen.
      Da ich einen Philips TV mmit Ambilight besitze (allerdings noch ohne die Hue Unterstützung)
      irritiert das schon etwas.
      Vielleicht hat von euch noch jemand einer eine Idee, wie ich dies ändern kann.

      P.S. Wie lange kann man hier eigentlich seine Beiträge editieren?

      LG kalle
    • Einen guten Abend,

      ich habe es jetzt endlich hinbekommen und es funzt wunderbar.

      Ich getraue mich ja gar nicht zu sagen was jetzt das Problem war. Manchmal sieht man einfach den Wald vor Bäumen nicht. Aber ich hatte doch tatsächlich einen Schreibfehler in der IP-Adresse der Bridge. Dies ist mir aber jetzt erst aufgefallen, nachdem ich 3 Wochen nicht daran gearbeitet habe. Ich hatte doch tatsächlich eine 114 statt 104. Die 114 ist dabei die VU+ nicht die Bridge. Geändert und schon geht's.

      Supi und riesen Dank
    • Guten Tag ich bastel nun seit 3 Tage,

      ist zustand

      - duo2
      - DreamX als Software um die config uns skripte einzufügen
      - links und rechts LLC007 (Aura) unten LST001 LightStripe

      enigma light läuft zu 0,5/3, light stripe geht an hat nur die falschen färben zum Bild, Links und Rechts gehen nicht.

      vielleicht könnt ihr mir helfen. aber meine config
      Dateien
      • dkhue.py.txt

        (2,09 kB, 24 mal heruntergeladen, zuletzt: )
      • enigmalight.conf.txt

        (1,15 kB, 36 mal heruntergeladen, zuletzt: )
      • rgb_xy.py.txt

        (9,43 kB, 10 mal heruntergeladen, zuletzt: )
    • Kann jemand bitte über meine Einstellungen schauen.


      Soweit,läuft es- ein wenig mit Verzögerung, aber nur 2 statt 3 LED´s.
      Sehr wahrscheinlich keine große Sache,aber ich weiß nicht wo der Hund begraben ist.
      Spoiler anzeigen
      import sys
      import colorsys
      import time
      import json
      import math
      import httplib

      def popen():
      spidev = file('/usr/dk/aufruf.log', "wb")
      key = "6CXb0WDe2u91DN0NGNZLX0CfnoFsiVT"
      ip = "192.168.1.191"
      url = '/api/' + key + '/lights/'
      lurl = url + '1/state'
      rurl = url + '2/state'
      burl = url + '3/state'

      while True:
      eingabe = sys.stdin.readline()

      if len(eingabe)>0:

      # Get Input
      lr,lg,lb,rr,rg,rb,x = eingabe.split(' ')

      lr = float(lr)
      lg = float(lg)
      lb = float(lb)
      rr = float(rr)
      rg = float(rg)
      rb = float(rb)


      # Make RED more vivid
      if (lr > 0.04045):
      lr = float( math.pow((lr + 0.055) / (1.0 + 0.055), 2.4) )
      else:
      lr = float(lr / 12.92)

      if (rr > 0.04045):
      rr = float( math.pow((rr + 0.055) / (1.0 + 0.055), 2.4))
      else:
      rr = float(rr / 12.92)


      # Make GREEN more vivid
      if (lg > 0.04045):
      lg = float( math.pow((lg + 0.055) / (1.0 + 0.055), 2.4) )
      else:
      lg = float(lg / 12.92)

      if (rg > 0.04045):
      rg = float( math.pow((rg + 0.055) / (1.0 + 0.055), 2.4))
      else:
      rg = float(rg / 12.92)


      # Make BLUE more vivid
      if (lb > 0.04045):
      lb = float( math.pow((lb + 0.055) / (1.0 + 0.055), 2.4) )
      else:
      lb = float(lb / 12.92)

      if (rb > 0.04045):
      rb = float( math.pow((rb + 0.055) / (1.0 + 0.055), 2.4))
      else:
      rb = float(rb / 12.92)


      # Calculate Luminance
      h,l,s = colorsys.rgb_to_hls(lr,lg,lb)
      #if (l >= 0.25):
      # l = 0.25
      l = round(255 * l)
      l = 100 + l
      #l = l * 4
      #l = l * 25
      l = max(2,int(round(l)))

      if (l >=255):
      l = 254

      if (l<1):
      l = 1


      lxx = lr * 0.649926 + lg * 0.103455 + lb * 0.197109
      lyy = lr * 0.234327 + lg * 0.743075 + lb * 0.022598
      lzz = lr * 0.0000000 + lg * 0.053077 + lb * 1.035763
      lsum = lxx + lyy + lzz

      if (lsum > 0):
      lx = lxx / lsum
      ly = lyy / lsum
      else:
      lx = 0
      ly = 0

      rxx = rr * 0.649926 + rg * 0.103455 + rb * 0.197109
      ryy = rr * 0.234327 + rg * 0.743075 + rb * 0.022598
      rzz = rr * 0.0000000 + rg * 0.053077 + rb * 1.035763
      rsum = rxx+ryy+rzz

      if (rsum > 0):
      rx = rxx / rsum
      ry = ryy / rsum
      else:
      rx = 0
      ry = 0

      lon = True
      ron = True

      if (rx < 0.21 and ry < 0.21):
      l = 1
      ron = False

      if (lx < 0.21 and ly < 0.21):
      l = 1
      lon = False

      lparams = {'xy': [lx, ly], 'colormode': 'xy', 'bri': l, 'on': lon}
      rparams = {'xy': [rx, ry], 'colormode': 'xy', 'bri': l, 'on': ron}

      connection = httplib.HTTPConnection(ip, timeout=10)

      connection.request('PUT', lurl, json.dumps(lparams))
      response = connection.getresponse()

      connection.request('PUT', rurl, json.dumps(rparams))
      response = connection.getresponse()

      #data = response.read()

      connection.close()

      #spidev.write("RGB left: " + str(lr*255) + ":" + str(lg*255) + ":" + str(lb*255) + "\n")
      #spidev.write("RGB right: " + str(rr*255) + ":" + str(rg*255) + ":" + str(rb*255) + "\n")

      #spidev.write("XY left: " + str(lx) + ":" + str(ly) + "\n")
      #spidev.write("XY right: " + str(rx) + ":" + str(ry) + "\n")

      #spidev.write("Luminance left: " + str(lluminance) + "\n")
      #spidev.write("Luminance right: " + str(rluminance) + "\n")

      #spidev.write("Birghtness left: " + str(ll) + "\n")
      #spidev.write("Birghtness right: " + str(rl) + "\n")

      #spidev.write("put: " + str(json.dumps(lparams)) + "\n")
      #spidev.write("put: " + str(json.dumps(rparams)) + "\n")
      #spidev.write("data: " + str(data) + "\n")

      #spidev.write("-----------" + "\n")
      #spidev.flush()
      else:
      break

      import time
      time.sleep(7)
      popen()
      Spoiler anzeigen

      Spoiler anzeigen
      [global]
      [device]
      name ambilight
      output python /usr/dk/dkhue.py
      channels 6
      type popen
      interval 800000
      debug off
      [color]
      name red
      rgb FF0000
      [color]
      name green
      rgb 00FF00
      [color]
      name blue
      rgb 0000FF
      [light]
      position left
      name AL1
      color red ambilight 1
      color green ambilight 2
      color blue ambilight 3
      hscan 0 50
      vscan 0 100
      [light]
      position right
      name AL2
      color red ambilight 4
      color green ambilight 5
      color blue ambilight 6
      hscan 50 100
      vscan 0 100


      [light]
      position bottom
      name AL3
      color red ambilight 7
      color green ambilight 8
      color blue ambilight 9
      hscan 50 100
      vscan 0 100



      Vielen Dank !!!
    • Hallo.

      Ich habe eine Frage zu Ehue auf meiner Uno 4K: Ehue ansich funktioniert, ich kann alle Lampen an- und ausschalten.

      Was nicht funktioniert, ist die Ambilight-Funktion: sobald ich in Ehue die gelbe Ambilight-Taste drücke,
      kommt die Fehlermeldung "daemon abid is not running!"
      Ich habe die entsprechende ipk aber vorher auf der Box installiert.

      Über die telnet-Session bekomme ich das auch alles nicht hin, da kommt immer die Fehlermeldung:
      /usr/bin/ambid: line 1: syntax error: unexpedted newline (expecting ")")

      Zusammengefasst: ich habe keine Ahnung von Linux und kriege dieses Ambid-Zusatztool einfach nicht ans Laufen.
      Wäre für Hilfe sehr dankbar!



      Gruß,
      el_richie.
    • el_richie schrieb:

      Hallo.

      Ich habe eine Frage zu Ehue auf meiner Uno 4K: Ehue ansich funktioniert, ich kann alle Lampen an- und ausschalten.

      Was nicht funktioniert, ist die Ambilight-Funktion: sobald ich in Ehue die gelbe Ambilight-Taste drücke,
      kommt die Fehlermeldung "daemon abid is not running!"
      Kann ich so bestätigen. Habe die Uno4k seit ein paar Tagen. Also auch nur Fan, aber noch kein VU Spezi. Vermute es liegt an der Architektur.
      Grüße

      Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von axs77 () aus folgendem Grund: Zu doof zum zitieren...

    • nabend Leute

      ich muss mal aus aktuellem Anlass den angestaubten thread rauskramen.
      Meine Duo2 mit enigmalight_0.1r5-b12 und Hue Lightstrip+ läuft bei mir, darum gehts mir nicht.

      Aaber: Ich bekomme das Licht nicht mehr ohne enigmalight gesteuert wie zB. durch
      die Hue App oder auch Alexa.
      Das Licht geht zwar immer kurz wie gewünscht an, erlischt aber dann sofort.

      Kann mir da jemand von euch helfen?
    • Hallo zusammen. Ich bekomme Enigmalight leider mit folgendem Setup nicht zum laufen:
      VU Solo2
      Phillips Hue Strippen 2+1 Meter

      Wenn ich grün für Lichter ein drücke geht auf "läuft" und Status "Lichter an" doch nach wenigen Sekunden wieder aus.
      Vielleicht kann sich jemand den Fehler mal ansehen.
      IP der Bridge: 192.168.2.116
      Key aus Api Debug: LjTK4qRXdrn3-kHa7mIKoAvLJpO1NpL4My-J46YG


      Enigmalight.comfig
      Spoiler anzeigen
      01
      02
      03
      04
      05
      06
      07
      08
      09
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      23
      24
      25
      26
      27
      28
      29
      30
      31
      32
      33
      34
      35
      36
      37
      38
      39
      [global]
      [device]
      name ambilight
      output python /usr/dk/dkhue.py
      channels 6
      type popen
      interval 200000
      debug off
      [color]
      name red
      rgb FF0000
      [color]
      name green
      rgb 00FF00
      [color]
      name blue
      rgb 0000FF
      [light]
      position left
      name AL1
      color red ambilight 1
      color green ambilight 2
      color blue ambilight 3
      hscan 0 50
      vscan 0 100
      [light]
      position right
      name AL2
      color red ambilight 4
      color green ambilight 5
      color blue ambilight 6
      hscan 50 100
      vscan 0 100/spoiler]

      dkhue.py

      Spoiler anzeigen
      #!/usr/bin/env python
      import sys
      import os
      import time
      import json
      import httplib
      from rgb_xy import Converter
      from rgb_xy import GamutC # or GamutB, GamutC
      counter = 0


      def popen():
      converter = Converter(GamutC)
      spidev = file( os.getcwd()+'/aufruf.log', "wb")
      key = "LjTK4qRXdrn3-kHa7mIKoAvLJpO1NpL4My-J46YG"
      ip = "192.168.2.116"
      url = '/api/' + key + '/lights/'
      lurl = url + '2/state'
      rurl = url + '1/state'
      burl = url + '33/state'
      #need to be sure that its not 0
      MINIMAL_VALUE=0.000000001

      while True:
      eingabe = sys.stdin.readline()

      if len(eingabe)>0:
      global counter
      counter+= 1
      # Get Input
      try:
      lr,lg,lb,rr,rg,rb,br,bg,bb,x = eingabe.split(' ')
      except ValueError:
      spidev.write("Not enough input parameter, do you have the same amount of lights (channels) in your enigmalight config?")
      spidev.flush()
      raise

      lr = (float(lr)+MINIMAL_VALUE)*255
      lg = (float(lg)+MINIMAL_VALUE)*255
      lb = (float(lb)+MINIMAL_VALUE)*255
      rr = (float(rr)+MINIMAL_VALUE)*255
      rg = (float(rg)+MINIMAL_VALUE)*255
      rb = (float(rb)+MINIMAL_VALUE)*255
      br = (float(br)+MINIMAL_VALUE)*255
      bg = (float(bg)+MINIMAL_VALUE)*255
      bb = (float(bb)+MINIMAL_VALUE)*255

      lon = True
      ron = True
      bon = True

      if (lr + lg + lb < 10):
      lll = 1
      lon = False
      else:
      lll = (lr + lg + lb)

      if (rr + rg + rb < 10):
      llr = 1
      ron = False
      else:
      llr = (rr + rg + rb)

      if (br + bg + bb < 10):
      llb = 1
      bon = False
      else:
      llb = (br + bg + bb)

      if (lll >=255):
      lll = 254

      if (lll<1):
      lll = 1

      if (llr >=255):
      llr = 254

      if (llr<1):
      lllr = 1

      if (llb >=255):
      llb = 254

      if (llb<1):
      llb = 1

      lparams = {'xy': converter.rgb_to_xy(lr,lg,lb), 'colormode': 'xy', 'bri': int(lll), 'on': lon}
      rparams = {'xy': converter.rgb_to_xy(rr,rg,rb), 'colormode': 'xy', 'bri': int(llr), 'on': ron}
      bparams = {'xy': converter.rgb_to_xy(br,bg,bb), 'colormode': 'xy', 'bri': int(llb), 'on': bon}

      if (counter>=10):
      connection = httplib.HTTPConnection(ip, timeout=10)

      #connection.request('PUT', lurl, json.dumps(lparams))
      #response = connection.getresponse()

      #connection.request('PUT', rurl, json.dumps(rparams))
      #response = connection.getresponse()

      connection.request('PUT', burl, json.dumps(bparams))
      response = connection.getresponse()

      #data = response.read()

      connection.close()
      counter=0
      else:
      break

      import time
      time.sleep(7)
      popen()/spoiler]

      rgb_xy.py

      Spoiler anzeigen
      # -*- coding: utf-8 -*-
      """
      Library for RGB / CIE1931 "x, y" coversion.
      Based on Philips implementation guidance:
      User account | Philips Hue API
      Copyright (c) 2016 Benjamin Knight / MIT License.
      """
      import math
      import random
      from collections import namedtuple


      # Represents a CIE 1931 XY coordinate pair.
      XYPoint = namedtuple('XYPoint', ['x', 'y'])

      # LivingColors Iris, Bloom, Aura, LightStrips
      GamutA = (
      XYPoint(0.704, 0.296),
      XYPoint(0.2151, 0.7106),
      XYPoint(0.138, 0.08),
      )

      # Hue A19 bulbs
      GamutB = (
      XYPoint(0.675, 0.322),
      XYPoint(0.4091, 0.518),
      XYPoint(0.167, 0.04),
      )

      # Hue BR30, A19 (Gen 3), Hue Go, LightStrips plus
      GamutC = (
      XYPoint(0.692, 0.308),
      XYPoint(0.17, 0.7),
      XYPoint(0.153, 0.048),
      )


      def get_light_gamut(modelId):
      """Gets the correct color gamut for the provided model id.
      Docs: User account | Philips Hue API
      """
      if modelId in ('LST001', 'LLC010', 'LLC011', 'LLC012', 'LLC006', 'LLC007', 'LLC013'):
      return GamutA
      elif modelId in ('LCT001', 'LCT007', 'LCT002', 'LCT003', 'LLM001'):
      return GamutB
      elif modelId in ('LCT010', 'LCT014', 'LCT011', 'LLC020', 'LST002'):
      return GamutC
      else:
      raise ValueError
      return None


      class ColorHelper:

      def __init__(self, gamut=GamutB):
      self.Red = gamut[0]
      self.Lime = gamut[1]
      self.Blue = gamut[2]

      def hex_to_red(self, hex):
      """Parses a valid hex color string and returns the Red RGB integer value."""
      return int(hex[0:2], 16)

      def hex_to_green(self, hex):
      """Parses a valid hex color string and returns the Green RGB integer value."""
      return int(hex[2:4], 16)

      def hex_to_blue(self, hex):
      """Parses a valid hex color string and returns the Blue RGB integer value."""
      return int(hex[4:6], 16)

      def hex_to_rgb(self, h):
      """Converts a valid hex color string to an RGB array."""
      rgb = (self.hex_to_red(h), self.hex_to_green(h), self.hex_to_blue(h))
      return rgb

      def rgb_to_hex(self, r, g, b):
      """Converts RGB to hex."""
      return '%02x%02x%02x' % (r, g, b)

      def random_rgb_value(self):
      """Return a random Integer in the range of 0 to 255, representing an RGB color value."""
      return random.randrange(0, 256)

      def cross_product(self, p1, p2):
      """Returns the cross product of two XYPoints."""
      return (p1.x * p2.y - p1.y * p2.x)

      def check_point_in_lamps_reach(self, p):
      """Check if the provided XYPoint can be recreated by a Hue lamp."""
      v1 = XYPoint(self.Lime.x - self.Red.x, self.Lime.y - self.Red.y)
      v2 = XYPoint(self.Blue.x - self.Red.x, self.Blue.y - self.Red.y)

      q = XYPoint(p.x - self.Red.x, p.y - self.Red.y)
      s = self.cross_product(q, v2) / self.cross_product(v1, v2)
      t = self.cross_product(v1, q) / self.cross_product(v1, v2)

      return (s >= 0.0) and (t >= 0.0) and (s + t <= 1.0)

      def get_closest_point_to_line(self, A, B, P):
      """Find the closest point on a line. This point will be reproducible by a Hue lamp."""
      AP = XYPoint(P.x - A.x, P.y - A.y)
      AB = XYPoint(B.x - A.x, B.y - A.y)
      ab2 = AB.x * AB.x + AB.y * AB.y
      ap_ab = AP.x * AB.x + AP.y * AB.y
      t = ap_ab / ab2

      if t < 0.0:
      t = 0.0
      elif t > 1.0:
      t = 1.0

      return XYPoint(A.x + AB.x * t, A.y + AB.y * t)

      def get_closest_point_to_point(self, xy_point):
      # Color is unreproducible, find the closest point on each line in the CIE 1931 'triangle'.
      pAB = self.get_closest_point_to_line(self.Red, self.Lime, xy_point)
      pAC = self.get_closest_point_to_line(self.Blue, self.Red, xy_point)
      pBC = self.get_closest_point_to_line(self.Lime, self.Blue, xy_point)

      # Get the distances per point and see which point is closer to our Point.
      dAB = self.get_distance_between_two_points(xy_point, pAB)
      dAC = self.get_distance_between_two_points(xy_point, pAC)
      dBC = self.get_distance_between_two_points(xy_point, pBC)

      lowest = dAB
      closest_point = pAB

      if (dAC < lowest):
      lowest = dAC
      closest_point = pAC

      if (dBC < lowest):
      lowest = dBC
      closest_point = pBC

      # Change the xy value to a value which is within the reach of the lamp.
      cx = closest_point.x
      cy = closest_point.y

      return XYPoint(cx, cy)

      def get_distance_between_two_points(self, one, two):
      """Returns the distance between two XYPoints."""
      dx = one.x - two.x
      dy = one.y - two.y
      return math.sqrt(dx * dx + dy * dy)

      def get_xy_point_from_rgb(self, red, green, blue):
      """Returns an XYPoint object containing the closest available CIE 1931 x, y coordinates
      based on the RGB input values."""

      r = ((red + 0.055) / (1.0 + 0.055))**2.4 if (red > 0.04045) else (red / 12.92)
      g = ((green + 0.055) / (1.0 + 0.055))**2.4 if (green > 0.04045) else (green / 12.92)
      b = ((blue + 0.055) / (1.0 + 0.055))**2.4 if (blue > 0.04045) else (blue / 12.92)

      X = r * 0.664511 + g * 0.154324 + b * 0.162028
      Y = r * 0.283881 + g * 0.668433 + b * 0.047685
      Z = r * 0.000088 + g * 0.072310 + b * 0.986039

      cx = X / (X + Y + Z)
      cy = Y / (X + Y + Z)

      # Check if the given XY value is within the colourreach of our lamps.
      xy_point = XYPoint(cx, cy)
      in_reach = self.check_point_in_lamps_reach(xy_point)

      if not in_reach:
      xy_point = self.get_closest_point_to_point(xy_point)

      return xy_point

      def get_rgb_from_xy_and_brightness(self, x, y, bri=1):
      """Inverse of `get_xy_point_from_rgb`. Returns (r, g, b) for given x, y values.
      Implementation of the instructions found on the Philips Hue iOS SDK docs: kWKXKl
      """
      # The xy to color conversion is almost the same, but in reverse order.
      # Check if the xy value is within the color gamut of the lamp.
      # If not continue with step 2, otherwise step 3.
      # We do this to calculate the most accurate color the given light can actually do.
      xy_point = XYPoint(x, y)

      if not self.check_point_in_lamps_reach(xy_point):
      # Calculate the closest point on the color gamut triangle
      # and use that as xy value See step 6 of color to xy.
      xy_point = self.get_closest_point_to_point(xy_point)

      # Calculate XYZ values Convert using the following formulas:
      Y = bri
      X = (Y / xy_point.y) * xy_point.x
      Z = (Y / xy_point.y) * (1 - xy_point.x - xy_point.y)

      # Convert to RGB using Wide RGB D65 conversion
      r = X * 1.656492 - Y * 0.354851 - Z * 0.255038
      g = -X * 0.707196 + Y * 1.655397 + Z * 0.036152
      b = X * 0.051713 - Y * 0.121364 + Z * 1.011530

      # Apply reverse gamma correction
      r, g, b = map(
      lambda x: (12.92 * x) if (x <= 0.0031308) else ((1.0 + 0.055) * pow(x, (1.0 / 2.4)) - 0.055),
      [r, g, b]
      )

      # Bring all negative components to zero
      r, g, b = map(lambda x: max(0, x), [r, g, b])

      # If one component is greater than 1, weight components by that value.
      max_component = max(r, g, b)
      if max_component > 1:
      r, g, b = map(lambda x: x / max_component, [r, g, b])

      r, g, b = map(lambda x: int(x * 255), [r, g, b])

      # Convert the RGB values to your color object The rgb values from the above formulas are between 0.0 and 1.0.
      return (r, g, b)


      class Converter:

      def __init__(self, gamut=GamutB):
      self.color = ColorHelper(gamut)

      def hex_to_xy(self, h):
      """Converts hexadecimal colors represented as a String to approximate CIE
      1931 x and y coordinates.
      """
      rgb = self.color.hex_to_rgb(h)
      return self.rgb_to_xy(rgb[0], rgb[1], rgb[2])

      def rgb_to_xy(self, red, green, blue):
      """Converts red, green and blue integer values to approximate CIE 1931
      x and y coordinates.
      """
      point = self.color.get_xy_point_from_rgb(red, green, blue)
      return (point.x, point.y)

      def xy_to_hex(self, x, y, bri=1):
      """Converts CIE 1931 x and y coordinates and brightness value from 0 to 1
      to a CSS hex color."""
      r, g, b = self.color.get_rgb_from_xy_and_brightness(x, y, bri)
      return self.color.rgb_to_hex(r, g, b)

      def xy_to_rgb(self, x, y, bri=1):
      """Converts CIE 1931 x and y coordinates and brightness value from 0 to 1
      to a CSS hex color."""
      r, g, b = self.color.get_rgb_from_xy_and_brightness(x, y, bri)
      return (r, g, b)

      def get_random_xy_color(self):
      """Returns the approximate CIE 1931 x,y coordinates represented by the
      supplied hexColor parameter, or of a random color if the parameter
      is not passed."""
      r = self.color.random_rgb_value()
      g = self.color.random_rgb_value()
      b = self.color.random_rgb_value()
      return self.rgb_to_xy(r, g, b)

      /spoiler]

      Vielen Dank