Philips Hue Leuchten mit Enigmalight steuern

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

    • habe mal die config für 3 HUE-Lampen genommen, meine Zugangsdaten eingetragen:
      Spoiler anzeigen


      import sys
      import os
      import time
      import json
      import httplib
      from rgb_xy import Converter
      from rgb_xy import GamutC # or GamutB, GamutC (you must look for the type of your lamps)
      counter = 9



      def popen():
      converter = Converter(GamutC)
      spidev = file( os.getcwd()+'/aufruf.log', "wb")
      key = "6YhDQmlf6NqEMto72v8FW7sumlXi19JUyHhSMfnR"
      ip = "192.168.0.21"
      url = '/api/' + key + '/lights/'
      lurl = url + '1/state' # die 1 ersetzen mit der Nummer deiner Leuchte
      rurl = url + '2/state' # die 2 ersetzen mit der Nummer deiner Leuchte
      aurl = url + '3/state' # usw.

      MINIMAL_VALUE=0.000000000

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

      if len(eingabe)>0:
      global counter
      counter += 1

      try:
      lr,lg,lb,rr,rg,rb,ar,ag,ab,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))*255
      lg = (float(lg))*255
      lb = (float(lb))*255
      rr = (float(rr))*255
      rg = (float(rg))*255
      rb = (float(rb))*255
      ar = (float(ar))*255
      ag = (float(ag))*255
      ab = (float(ab))*255


      lll = calcLuminance(lr,lg,lb)
      llr = calcLuminance(rr,rg,rb)
      lla = calcLuminance(ar,ag,ab)

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

      lparams = {'xy': converter.rgb_to_xy(lr,lg,lb), 'colormode': 'xy', 'bri': int(lll), 'on': True}
      connection.request('PUT', lurl, json.dumps(lparams))
      response = connection.getresponse()

      rparams = {'xy': converter.rgb_to_xy(rr,rg,rb), 'colormode': 'xy', 'bri': int(llr), 'on': True}
      connection.request('PUT', rurl, json.dumps(rparams))
      response = connection.getresponse()

      aparams = {'xy': converter.rgb_to_xy(ar,ag,ab), 'colormode': 'xy', 'bri': int(lla), 'on': True}
      connection.request('PUT', aurl, json.dumps(aparams))
      response = connection.getresponse()


      connection.close()
      counter=0
      else:
      os.system("curl -d '{\"on\":false}' -X PUT 192.168.0.21/api/6YhDQmlf6NqEMto72v8FW7sumlXi19JUyHhSMfnR/groups/0/action")
      break

      def calcLuminance(r,g,b):
      LUM_VALUE=20
      luminance=1
      if (r + g + b > 1):
      luminance= r + g + b + LUM_VALUE
      if (luminance>=255):
      luminance=254
      return luminance
      import time
      time.sleep(1)
      popen()


      und bekomme folgenden Log:
      Spoiler anzeigen


      [InitLog]
      start of log /home/elight-addons/.enigmalight/enigmalight.log
      [CConfig::LoadConfigFromFile] Opening /etc/enigmalight.conf
      [CConfig::CheckConfig] checking config lines
      [CConfig::CheckConfig] config lines valid
      [CConfig::LoadConfigFromFile] Opening /etc/enigmalight.conf
      [CConfig::BuildConfig] building config
      [CConfig::BuildConfig] built config successfully
      [main] Start device 1 from 1
      [CDevice::Process] ambilight: starting with output "python /home/elight-addons/wifilight/philips_hue/enigmalight_hue_1x.py"
      [CDevice::Process] ambilight: setting up
      [CEnigmaLight::SetColorSequence]Set colorsequence to RGB
      [CGuiServer::Process] Start GuiServerset adjust 0 0 0

      1[CGuiServer::Process] Opening listening socket for Enigma2 GUI on 127.0.0.1:6767
      [CDevice::Process] ambilight: setup succeeded
      [CFlagManager::SetVideoGamma] Gamma not set, using 2.2 since this is default for video
      [CMainLoop::Process] Starting grabber..
      [CGrabber::Setup] Lights: 1, Cluster leds: 1 as one led
      [CGrabber::Setup] Channels: 3
      [CGrabber::Setup] Interval: 0.10
      [CGrabber::Run] Mode -> Dynamic
      [CGrabber::Run] Framegrabber initialized
      [CGrabber::Run] Framegrabber Image initialized
      [CGrabber::Run] Blackbar Detection i
      nitialized
      [CFrameGrabber::Setup] Debug mode: enabled
      [CGrabber::Run] Framegrabber set up
      [CGrabber::Run] entering grabloop
      [CFrameGrabber::CheckRes] Set Scanrange to 120x67 (Source 538976288x538976288)


      [CBlackbarDetection::FindBounds]DBG -> FindBounds
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Scanning top: 36 - 36, bottom: 36 - 36, left: 20 - 46, right: 20 - 46
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 1
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found top line: 1
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 1
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found left line: 1
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 119
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found right line: 119
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 66
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found bottom line: 66


      [CBlackbarDetection::FindBounds]DBG -> FindBounds
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Scanning top: 36 - 36, bottom: 36 - 36, left: 20 - 46, right: 20 - 46
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 1
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found top line: 1
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 1
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found left line: 1
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 119
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found right line: 119
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 66
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found bottom line: 66


      [CBlackbarDetection::FindBounds]DBG -> FindBounds
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Scanning top: 36 - 36, bottom: 36 - 36, left: 20 - 46, right: 20 - 46
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 1
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found top line: 1
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 1
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found left line: 1
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 119
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found right line: 119
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 66
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found bottom line: 66


      [CBlackbarDetection::FindBounds]DBG -> FindBounds
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Scanning top: 36 - 36, bottom: 36 - 36, left: 20 - 46, right: 20 - 46
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 1
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found top line: 1
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 1
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found left line: 1
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 119
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found right line: 119
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 66
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found bottom line: 66


      [CBlackbarDetection::FindBounds]DBG -> FindBounds


      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Scanning top: 36 - 36, bottom: 36 - 36, left: 20 - 46, right: 20 - 46
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 1
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found top line: 1
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 1
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found left line: 1
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 119
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found right line: 119
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 66
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found bottom line: 66


      [CBlackbarDetection::FindBounds]DBG -> FindBounds
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Scanning top: 36 - 36, bottom: 36 - 36, left: 20 - 46, right: 20 - 46
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 1
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found top line: 1
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 1
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found left line: 1
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 119
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found right line: 119
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 66


      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found bottom line: 66


      [CBlackbarDetection::FindBounds]DBG -> FindBounds


      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Scanning top: 36 - 36, bottom: 36 - 36, left: 20 - 46, right: 20 - 46
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 1
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found top line: 1
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 1
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found left line: 1
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 119
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found right line: 119
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 66
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found bottom line: 66


      [CBlackbarDetection::FindBounds]DBG -> FindBounds
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Scanning top: 36 - 36, bottom: 36 - 36, left: 20 - 46, right: 20 - 46
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 1
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found top line: 1
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 1
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found left line: 1
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 119
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found right line: 119
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 66
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found bottom line: 66


      [CBlackbarDetection::FindBounds]DBG -> FindBounds
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Scanning top: 36 - 36, bottom: 36 - 36, left: 20 - 46, right: 20 - 46
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 1
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found top line: 1
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 1
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found left line: 1
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 119
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found right line: 119
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 66
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found bottom line: 66


      [CBlackbarDetection::FindBounds]
      DBG -> FindBounds
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Scanning top: 36 - 36, bottom: 36 - 36, left: 20 - 46, right: 20 - 46
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 1
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found top line: 1
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 1
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found left line: 1
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 119
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found right line: 119
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 66
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found bottom line: 66


      [CBlackbarDetection::FindBounds]DBG -> FindBounds
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Scanning top: 36 - 36, bottom: 36 - 36, left: 20 - 46, right: 20 - 46
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 1
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found top line: 1
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 1
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found left line: 1
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 119
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found right line: 119
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 66
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found bottom line: 66
      [CFrameGrabber::updateInfo] DBG -> gFPS:10.4 | Res:120x67 (538976288x538976288)


      [CBlackbarDetection::FindBounds]DBG -> FindBounds


      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Scanning top: 36 - 36, bottom: 36 - 36, left: 20 - 46, right: 20 - 46
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 1
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found top line: 1
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 1
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found left line: 1
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 119
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found right line: 119
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 66
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found bottom line: 66
      Traceback (most recent call last):
      File "/home/elight-addons/wifilight/philips_hue/enigmalight_hue_1x.py", line 82, in <module>
      popen()
      File "/home/elight-addons/wifilight/philips_hue/enigmalight_hue_1x.py", line 31, in popen
      lr,lg,lb,rr,rg,rb,ar,ag,ab,x = eingabe.split(' ')
      ValueError: need more than 4 values to unpack


      [CBlackbarDetection::FindBounds]
      DBG -> FindBounds
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Scanning top: 36 - 36, bottom: 36 - 36, left: 20 - 46, right: 20 - 46
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 1
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found top line: 1
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 1
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found left line: 1
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 119
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found right line: 119
      [CBlackbarDetection::ScanLine] DBG -> Scanning line 66
      [CBlackbarDetection::IsContent] DBG -> IsContent: Max : R{0}, G{1}, B{2}
      [CBlackbarDetection::FindBounds]DBG -> FindBounds: Found bottom line: 66
      root@vuultimo4k:~# [6n

      Meine Lampen reagieren also nicht und ich brauche Hilfe.

      Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von sweet17051983 ()

    • Hallo zusammen,

      morgen bekomme ich meine LED Stripes und wollte sie auch über meine VU Box steuern. Ich habe Enigmalight installiert, habe gestern meine HUE einen Benutzernamen gegeben, damit ich morgen die benötigten Daten auslesen kann, wenn ich diese denn finde.

      Wie kann ich dann die benötigten Daten in meiner VU Box ändern, damit ich die ansteuern kann.

      sorry aber ich hab die Box zwar schon länger, aber an solche Einstellungen hab ich mich bis jetzt nicht gewagt.

      Über hilfe wäre ich sehr dankbar.

      Gruß Patrick
    • Hey,

      ich hab jetzt meine Stripes installiert und hab mich mit der Installation bei meiner VU Box beschäftigt. Aber irgendwas klappt nicht. folgende schritte hab ich gemacht:

      1. Installation Enigmalight
      2. HUE Bridge meinen Namen gegeben
      3. HUE Bridge ausgelesen. Die Stripes habe ich den Namen TV1 und TV2 über die iPhone App gegeben.
      4. in den Ordner /home/elight-addons/wifilight/philips_hue die detain enigmaliht_hue_4x.py und die rob_xy.py copiert
      5. in den Ordner etc enigmalight.conf kopiert.

      Ich weiß leider nicht, wo ich das Log finde. jedenfalls wenn ich in der EnigmaLight die Einstellung für den Ordner ändern möchte, dann startet die Box neu.
      Ich wäre um Hilfe echt dankbar.

      Gruß Patrick

      enigmalight_hue_4x.py:
      Spoiler anzeigen


      import sys
      import os
      import time
      import json
      import httplib
      from rgb_xy import Converter
      from rgb_xy import GamutC # or GamutA, GamutB (you must look for the type of your lamps in rgb_xy.py from line 42)
      counter = 12


      def popen():
      converter = Converter(GamutC)
      spidev = file( os.getcwd()+'/aufruf.log', "wb")
      key = "f1eceTOv03LrhJohH6SsLTMWDqVZF8uzE7qhNjm9"
      ip = "192.68.178.53"
      url = '/api/f1eceTOv03LrhJohH6SsLTMWDqVZF8uzE7qhNjm9/lights/'
      lurl = url + 'TV1/state' # die 1 ersetzen mit der Nummer deiner Leuchte
      rurl = url + 'TV2/state' # die 2 ersetzen mit der Nummer deiner Leuchte

      MINIMAL_VALUE=0.000000000

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

      if len(eingabe)>0:
      global counter
      counter += 1

      try:
      lr,lg,lb,rr,rg,rb,ar,ag,ab,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))*255
      lg = (float(lg))*255
      lb = (float(lb))*255
      rr = (float(rr))*255
      rg = (float(rg))*255
      rb = (float(rb))*255
      ar = (float(ar))*255
      ag = (float(ag))*255
      ab = (float(ab))*255
      br = (float(br))*255
      bg = (float(bg))*255
      bb = (float(bb))*255

      lll = calcLuminance(lr,lg,lb)
      llr = calcLuminance(rr,rg,rb)
      lla = calcLuminance(ar,ag,ab)
      llb = calcLuminance(br,bg,bb)

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

      lparams = {'xy': converter.rgb_to_xy(lr,lg,lb), 'colormode': 'xy', 'bri': int(lll), 'on': True}
      connection.request('PUT', lurl, json.dumps(lparams))
      response = connection.getresponse()

      rparams = {'xy': converter.rgb_to_xy(rr,rg,rb), 'colormode': 'xy', 'bri': int(llr), 'on': True}
      connection.request('PUT', rurl, json.dumps(rparams))
      response = connection.getresponse()

      aparams = {'xy': converter.rgb_to_xy(ar,ag,ab), 'colormode': 'xy', 'bri': int(lla), 'on': True}
      connection.request('PUT', aurl, json.dumps(aparams))
      response = connection.getresponse()

      bparams = {'xy': converter.rgb_to_xy(br,bg,bb), 'colormode': 'xy', 'bri': int(llb), 'on': True}
      connection.request('PUT', burl, json.dumps(bparams))
      response = connection.getresponse()

      connection.close()
      counter=0
      else:
      os.system("curl -d '{\"on\":false}' -X PUT 192.168.178.53apif1eceTOv03LrhJohH6SsLTMWDqVZF8uzE7qhNjm9/groups/0/action")
      break


      def calcLuminance(r,g,b):
      LUM_VALUE=5
      luminance=1
      if (r + g + b > 1):
      luminance= r + g + b + LUM_VALUE
      if (luminance>=255):
      luminance=254

      return luminance

      import time
      time.sleep(1)
      popen()

      enigmalight.conf

      #[global]
      [device]
      name ambilight
      output python /home/elight-addons/wifilight/philips_hue/enigmalight_hue_4x.py
      channels 12
      type popen
      interval 200000
      debug off
      [color]
      name red
      rgb 0000FF
      [color]
      name green
      rgb 00FF00
      [color]
      name blue
      rgb FF0000
      [light]
      position left
      name 1HU
      color red ambilight 1
      color green ambilight 2
      color blue ambilight 3
      hscan 0 5
      vscan 10 90
      [light]
      position right
      name 2HU
      color red ambilight 4
      color green ambilight 5
      color blue ambilight 6
      hscan 95 100
      vscan 10 90

      [light]
      position top
      name TV1
      color red ambilight 7
      color green ambilight 8
      color blue ambilight 9
      hscan 10 90
      vscan 10 90

      [light]
      position top
      name TV2
      color red ambilight 10
      color green ambilight 11
      color blue ambilight 12
      hscan 10 90
      vscan 10 90

      Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von hgdo ()

    • lurl = url + 'TV1/state' # die 1 ersetzen mit der Nummer deiner Leuchte

      TV1 ist nicht die Nummer. Ich weiß ja nicht, wieviele Hue-Leuchten du bisher hattest, aber wenn du bis gestern 5 hattest, dürfte dein Strip heute die Nummer 6 sein (bei mir wurde stur durchnummeriert).
      Wieviele Lichter willst du steuern? 4? Dann kann der Counter so bleiben. Wenn du nur ein Licht (eine Stripe) steuern willst, muss du am besten die Dateien für ein Licht nehmen.
      Hast du Beitrag 1 überhaupt gelesen???
      Rückwärtslesen: Man fängt nicht vorne an zu lesen, man liest ein paar Posts bevor man selber postet.
      Boardsuche: Funktioniert fast wie Google. Bei mir ist sie oben rechts.
    • Ah ok, mal versuchen.

      Ja ich hab mir alle Beiträge durchgelesen. Aber ich mach sowas das erste mal. Entschuldige, dass ich da nicht auf anhieb durchsteige.
    • @BarnyXX: Bist du schon weiter gekommen?
      Ich habe mich gestern nochmal versucht aber musste auch bei python-dev aufgeben. Die Version die ich mir besorgt habe war eine 2.7.9-11 und die spielt nicht mit den alten Python Paketen auf dem VTI Image. (Sind ja generell viele deprecated packages drin)
      Der Teufel stellte seine Sense in die Ecke und sprang auf den Rasenmäher, denn es war Krieg
    • Ne, ich hab erstmal aufgegeben. Wenn ich irgendwann mal mehr Zeit habe, würde ich mich nochmal dran versuchen. Aber in den Sommermonaten hab ich erstmal anderes zu tun ;) Wenns wieder kälter wird, schaue ich mir das auf jedenfall nochmal an, wenn nicht schon jemand anderes eine Lösung dafür hat.
    • Besser ists wohl. :)
      Wäre das Python Package n bisschen aktueller könnte man da wohl mehr machen...naja. :)

      Schöne Sommerzeit. :)
      Der Teufel stellte seine Sense in die Ecke und sprang auf den Rasenmäher, denn es war Krieg
    • habe mal die config für 3 HUE-Lampen (links / rechts und hinter dem TV den Hue-Stripe) genommen, meine Zugangsdaten eingetragen:

      Spoiler anzeigen

      import sys
      import os
      import time
      import json
      import httplib
      from rgb_xy import Converter
      from rgb_xy import GamutC # or GamutB, GamutC (you must look for the type of your lamps)
      counter = 9


      def popen():
      converter = Converter(GamutC)
      spidev = file( os.getcwd()+'/aufruf.log', "wb")
      key = "***"
      ip = "10.168.1.50"
      url = '/api/' + key + '/lights/'
      lurl = url + '1/state' # die 1 ersetzen mit der Nummer deiner Leuchte
      rurl = url + '2/state' # die 2 ersetzen mit der Nummer deiner Leuchte
      aurl = url + '4/state' # usw.
      MINIMAL_VALUE=0.000000000
      while True:
      eingabe = sys.stdin.readline()

      if len(eingabe)>0:
      global counter
      counter += 1

      try:
      lr,lg,lb,rr,rg,rb,ar,ag,ab,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))*255
      lg = (float(lg))*255
      lb = (float(lb))*255
      rr = (float(rr))*255
      rg = (float(rg))*255
      rb = (float(rb))*255
      ar = (float(ar))*255
      ag = (float(ag))*255
      ab = (float(ab))*255

      lll = calcLuminance(lr,lg,lb)
      llr = calcLuminance(rr,rg,rb)
      lla = calcLuminance(ar,ag,ab)

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

      lparams = {'xy': converter.rgb_to_xy(lr,lg,lb), 'colormode': 'xy', 'bri': int(lll), 'on': True}
      connection.request('PUT', lurl, json.dumps(lparams))
      response = connection.getresponse()

      rparams = {'xy': converter.rgb_to_xy(rr,rg,rb), 'colormode': 'xy', 'bri': int(llr), 'on': True}
      connection.request('PUT', rurl, json.dumps(rparams))
      response = connection.getresponse()

      aparams = {'xy': converter.rgb_to_xy(ar,ag,ab), 'colormode': 'xy', 'bri': int(lla), 'on': True}
      connection.request('PUT', aurl, json.dumps(aparams))
      response = connection.getresponse()

      connection.close()
      counter=0
      else:
      os.system("curl -d '{\"on\":false}' -X PUT 10.168.1.50/api/Pp78BSS36nYMvHMlXRmSSrf-hQlpYxZcb1uyyjJA/groups/0/action")
      break

      def calcLuminance(r,g,b):
      LUM_VALUE=20
      luminance=1
      if (r + g + b > 1):
      luminance= r + g + b + LUM_VALUE
      if (luminance>=255):
      luminance=254
      return luminance
      import time
      time.sleep(1)
      popen()


      und bekomme die folgende Fehlermeldung:
      Spoiler anzeigen
      2:16:43.678617 [InitLog] start of log /home/elight-addons/.enigmalight/enigmalight.log
      12:16:43.679074 [CConfig::LoadConfigFromFile] Opening /etc/enigmalight.conf
      12:16:43.679771 [CConfig::CheckConfig] checking config lines
      12:16:43.681006 [CConfig::CheckConfig] config lines valid
      12:16:43.682222 [CConfig::LoadConfigFromFile] Opening /etc/enigmalight.conf
      12:16:43.683194 [CConfig::BuildConfig] building config
      12:16:43.684870 [CConfig::BuildConfig] built config successfully
      12:16:43.684925 [main] Start device 1 from 1
      12:16:43.685288 [CDevice::Process] ambilight: starting with output "python /home/elight-addons/wifilight/philips_hue/enigmalight_hue_4x.py
      "
      12:16:43.685344 [CDevice::Process] ambilight: setting up
      12:16:43.685863 [CDevice::Process] ambilight: setup succeeded
      12:16:43.686344 [CEnigmaLight::SetColorSequence] Set colorsequence to RGB
      12:16:43.686401 [CMainLoop::Process] Start EnigmaLight Server
      12:16:43.686434 [CMainLoop::Process] Opening listening socket on *:19333
      12:16:43.686525 [CGuiServer::Process] Start GuiServer
      12:16:43.686572 [CGuiServer::Process] Opening listening socket for Enigma2 GUI on 127.0.0.1:6767
      12:16:43.885613 [CDevicePopen::WriteOutput] ERROR: ambilight: fprintf() python /home/elight-addons/wifilight/philips_hue/enigmalight_hue_4x.py
      Broken pipe
      12:16:43.885718 [CDevice::Process] ambilight: io operation failed...
      12:16:43.885748 [CDevice::Process] Exiting EnigmaLight...


      Leider habe ich zu dieser Fehlermeldung (Broken Pipe) keine Lösungsansätze im Forum gefunden. :(

      Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von silentwings ()

    • Enigmalight.config

      Spoiler anzeigen
      #[global]
      [device]
      name ambilight
      output python /home/elight-addons/wifilight/philips_hue/enigmalight_hue_4x.py
      channels 9
      type popen
      interval 200000
      debug off
      [color]
      name red
      rgb 0000FF
      [color]
      name green
      rgb 00FF00
      [color]
      name blue
      rgb FF0000
      [light]
      position left
      name 1HU
      color red ambilight 1
      color green ambilight 2
      color blue ambilight 3
      hscan 0 5
      vscan 10 90
      [light]
      position right
      name 2HU
      color red ambilight 4
      color green ambilight 5
      color blue ambilight 6
      hscan 95 100
      vscan 10 90

      [light]
      position top
      name 4HU
      color red ambilight 7
      color green ambilight 8
      color blue ambilight 9
      hscan 10 90
      vscan 10 90


      Freue mich über nützliche Tipps. Vielen Dank.

      Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von silentwings ()

    • Für mich ist es ja auch nur raten, aber:
      In der ersten Datei steht " if (counter>=13): " . Die 13 würde ich durch eine 10 ersetzen.
      ip = "10.168.1.50". Das ist deine Heimnetz-IP?
      Den Key hast du nur oben gelöscht, unten steht noch Pp78BSS36nYMvHMlXRmSSrf-hQlpYxZcb1uyyjJA. Ist deiner, oder?

      In der config fehlt:
      [global]
      interface 127.0.0.1
      port19333

      [device]

      Die enigmalight_hue_4x.py und die rgb_xy.py haben die Attribute 744?

      Mehr fällt mir auf Schlag nicht auf. Welchen Router benutzt du? So eine IP habe ich als interne IP noch nie gesehen :D
      Rückwärtslesen: Man fängt nicht vorne an zu lesen, man liest ein paar Posts bevor man selber postet.
      Boardsuche: Funktioniert fast wie Google. Bei mir ist sie oben rechts.
    • Philips Hue Leuchten mit Enigmalight steuern

      In der config fehlt:
      [global]
      interface 127.0.0.1
      port19333

      Dies sollte nicht mit hue lampen getan werden.

      habe auch 3 Lichter und das ist meine Konfiguration
      Spoiler anzeigen

      Quellcode: enigmalight_hue_LMR.py

      1. import sys
      2. import os
      3. import time
      4. import json
      5. import httplib
      6. from rgb_xy import Converter
      7. from rgb_xy import GamutA # or GamutA, GamutB (you must look for the type of your lamps in rgb_xy.py from line 42)
      8. counter = 9 # 6 - 7 (regel 46) bij 2 lampen, bij 3L 9 -10 bij 4L 12 -13 enz
      9. def popen():
      10. converter = Converter(GamutA)
      11. spidev = file( os.getcwd()+'/aufruf.log', "wb")
      12. key = "..."
      13. ip = "192.168.1.69"
      14. url = '/api/' + key + '/lights/'
      15. lurl = url + '3/state'
      16. rurl = url + '6/state' # 2=links achter 3=linkstv 4=rechts achter 6=rechtstv
      17. aurl = url + '5/state' # 5= Spot keuken
      18. MINIMAL_VALUE=0.000000000
      19. while True:
      20. eingabe = sys.stdin.readline()
      21. if len(eingabe)>0:
      22. global counter
      23. counter += 1
      24. try:
      25. lr,lg,lb,rr,rg,rb,ar,ag,ab,x = eingabe.split(' ')
      26. except ValueError:
      27. spidev.write("Not enough input parameter, do you have the same amount of lights (channels) in your enigmalight.config?")
      28. spidev.flush()
      29. raise
      30. lr = (float(lr))*255
      31. lg = (float(lg))*255
      32. lb = (float(lb))*255
      33. rr = (float(rr))*255
      34. rg = (float(rg))*255
      35. rb = (float(rb))*255
      36. ar = (float(ar))*255
      37. ag = (float(ag))*255
      38. ab = (float(ab))*255
      39. if (lr + lg + lb < 0.6):
      40. lr = 0.01
      41. lg = 0.01
      42. lb = 0.01
      43. if (rr + rg + rb < 0.6):
      44. rr = 0.01
      45. rg = 0.01
      46. rb = 0.01
      47. if (ar + ag + ab < 0.6):
      48. ar = 0.01
      49. ag = 0.01
      50. ab = 0.01
      51. lll = calcLuminance(lr,lg,lb)
      52. llr = calcLuminance(rr,rg,rb)
      53. lla = calcLuminance(ar,ag,ab)
      54. if (counter>=10):
      55. connection = httplib.HTTPConnection(ip, timeout=10)
      56. lparams = {'xy': converter.rgb_to_xy(lr,lg,lb), 'colormode': 'xy', 'bri': int(lll), 'on': True}
      57. connection.request('PUT', lurl, json.dumps(lparams))
      58. response = connection.getresponse()
      59. rparams = {'xy': converter.rgb_to_xy(rr,rg,rb), 'colormode': 'xy', 'bri': int(llr), 'on': True}
      60. connection.request('PUT', rurl, json.dumps(rparams))
      61. response = connection.getresponse()
      62. rparams = {'xy': converter.rgb_to_xy(ar,ag,ab), 'colormode': 'xy', 'bri': int(lla), 'on': True}
      63. connection.request('PUT', aurl, json.dumps(rparams))
      64. response = connection.getresponse()
      65. connection.close()
      66. counter=0
      67. else:
      68. os.system("curl -d '{\"on\":false}' -X PUT 192.168.1.69/api/yp4tZZQaLvYBQipVbZYG7ih6hC3Bb0beOqIL538n/lights/3/state")
      69. os.system("curl -d '{\"on\":false}' -X PUT 192.168.1.69/api/yp4tZZQaLvYBQipVbZYG7ih6hC3Bb0beOqIL538n/lights/6/state")
      70. os.system("curl -d '{\"on\":false}' -X PUT 192.168.1.69/api/yp4tZZQaLvYBQipVbZYG7ih6hC3Bb0beOqIL538n/lights/5/state")
      71. #os.system("curl -d '{\"on\":false}' -X PUT 192.168.1.69/api/yp4tZZQaLvYBQipVbZYG7ih6hC3Bb0beOqIL538n/groups/0/action")
      72. break
      73. def calcLuminance(r,g,b):
      74. LUM_VALUE=10
      75. luminance=1
      76. if (r + g + b > 1):
      77. luminance= r + g + b + LUM_VALUE
      78. if (luminance>=255):
      79. luminance=254
      80. return luminance
      81. import time
      82. time.sleep(1)
      83. popen()
      Alles anzeigen



      Quellcode: enigmalight.conf

      1. #[global]
      2. [device]
      3. name ambilight
      4. output python /home/elight-addons/wifilight/philips_hue/enigmalight_hue_LMR.py
      5. channels 9
      6. type popen
      7. interval 200000
      8. debug off
      9. [color]
      10. name red
      11. rgb FF0000
      12. [color]
      13. name green
      14. rgb 00FF00
      15. [color]
      16. name blue
      17. rgb 0000FF
      18. [light]
      19. position left
      20. name 1XX
      21. color red ambilight 1
      22. color green ambilight 2
      23. color blue ambilight 3
      24. hscan 1 7 #0 10
      25. vscan 55 75 #0 100
      26. [light]
      27. position right
      28. name 2XX
      29. color red ambilight 4
      30. color green ambilight 5
      31. color blue ambilight 6
      32. hscan 92 99 #0 10
      33. vscan 55 75 #0 100
      34. [light]
      35. position top
      36. name 3XX
      37. color red ambilight 7
      38. color green ambilight 8
      39. color blue ambilight 9
      40. hscan 40 60 #0 10
      41. vscan 1 7 #0 100
      Alles anzeigen

      [list=1][*]
      [/list]

      Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von hgdo ()

    • Ja - das ist der Key und die Heimnetz-IP. Fritbox 4090 - den Aufbau habe ich selber festgelegt.

      Leider haben die Änderungen nicht zum Erfolg geführt.
      Auch die Config von Happy 2000 zeigt die gleiche Fehlermeldung in der log-Datei.

      Kann es an der nicht Ip-Adresse. In einer der Beiträge ist davon die Rede, dass das Format falsch angegeben wurde.
    • Versuchen Sie Folgendes:
      Erstellen Sie eine Datei (script) namens light-on.sh
      Kopiere das in die Datei (script), siehe Source code spoiler.

      Shell-Script

      1. #!/bin/sh
      2. curl -X PUT -d "{\"on\":true}" "http://192.168.1.69/api/azbbgdJY7hhdnr6mmywaldnfh2BliGFpuinfea9X/lights/1/state" > /dev/null 2>&1
      3. exit
      Schlüssel, IP und Lampennummer ändern.
      Lege die Datei in das Verzeichnis / usr / script / und setze die Rechte auf 755.
      Starten Sie nun die Datei (script). Und ist die lampe an?
    • Hallo zusammen,

      hat beim mir dank der tollen Anleitung auf Anhieb geklappt mit einem Hue LED Lightstrip hinterm TV - die langsama Reaktionszeit wird wohl so bleiben...
      Nur ein Problem: Beim Schalten der VU+ auf Standby bleibt das Licht im letzten Zustand an - ich muss dann immer noch mit der Hue app manuell ausschalten...

      Gibts da eine Lösung?

      Klaus
    • Sie können dies in der enigmalight App unter Einstellungen festlegen.

      Und Siehe mein letztes gepostetes enigmalight_hue_LMR.py oben. In den Zeilen 69 bis 80 können Sie es pro Lampe einstellen.




      WoW, Google Translate ist mein Freund :thumbsup:
    • @silentwings: Schick mir die 3 Dateien doch mal per PM, dann gleiche ich das mit meiner alten Zusammenstellung mal ab.

      Ansonsten bin ich hier raus, weil es mir zu mühselig ist, die Sätze zu erraten.
      Rückwärtslesen: Man fängt nicht vorne an zu lesen, man liest ein paar Posts bevor man selber postet.
      Boardsuche: Funktioniert fast wie Google. Bei mir ist sie oben rechts.