preAlpha dreamWifiLight (Mi-Light like Philips Hue über Boblight steuern)

  • bespielwert:


    red 255
    green 110
    blue 177



    sollte nen rosa/pink sein, die lampen zeugen aber türkisähnliches


    ich hab das plugin provisorisch umgebaut, damit kann man r g b einstellen
    in 5er schrtten.


    zum loggen


    per telnet auf die box verbinden
    und setconsole eintippen, danach plugin öffnen und werte ändern
    dann siehst du rgb und h was gesendet wird


  • Zitat

    Original von addybo
    bespielwert:
    red 255
    green 110
    blue 177


    Hab das gerdae getestet und du hast recht, das stimmt so nicht! Danke werde versuchen es zu lösen!


    Edit: Habs gelöst, hatte da natürlich einen Fehler :aufsmaul:


    [php]
    import wifileds
    from Plugins.Plugin import PluginDescriptor
    from Components.PluginComponent import plugins
    from Screens.Screen import Screen
    from Components.Label import Label
    from Components.Sources.List import List
    from Components.config import *
    from Components.ConfigList import ConfigList, ConfigListScreen
    from Components.ActionMap import ActionMap
    config.plugins.milight = ConfigSubsection()
    #colors = [('off',_("off")),('white',_("white")),('violet',_('violet')),('royal_blue',_('royal_blue')),('baby_blue',_('baby_blue')),('aqua',_('aqua')),('mint',_('mint')),('seafoam_green',_('seafoam_green')),('green',_('green')),('lime_green',_('lime_green')),('yellow',_('yellow')),('yellow_orange',_('yellow_orange')),('orange',_('orange')),('red',_('red')),('pink',_('pink')),('fusia',_('fusia')),('lilac',_('lilac')),('lavendar',_('lavendar'))]
    #config.plugins.milight.zone1 = ConfigSelection(colors)
    #config.plugins.milight.zone2 = ConfigSelection(colors)
    #config.plugins.milight.zone3 = ConfigSelection(colors)
    #config.plugins.milight.zone4 = ConfigSelection(colors)
    #config.plugins.milight.zoneall = ConfigSelection(colors)


    config.plugins.milight.zoneall_static_color_r = ConfigSlider(default=255, increment=5, limits=(0,255))
    config.plugins.milight.zoneall_static_color_g = ConfigSlider(default=25, increment=5, limits=(0,255))
    config.plugins.milight.zoneall_static_color_b = ConfigSlider(default=2, increment=5, limits=(0,255))


    config.plugins.milight.brightness = ConfigSlider(default=27, limits=(2, 27))
    config.plugins.milight.zone1brightness = ConfigSlider(default=27, limits=(2, 27))
    config.plugins.milight.zone2brightness = ConfigSlider(default=27, limits=(2, 27))
    config.plugins.milight.zone3brightness = ConfigSlider(default=27, limits=(2, 27))
    config.plugins.milight.zone4brightness = ConfigSlider(default=27, limits=(2, 27))
    config.plugins.milight.ip = ConfigIP(default=[192,168,2,106])
    config.plugins.milight.port = ConfigInteger(default=8899, limits=(1, 9999))
    class HDMU_MilightControl(Screen, ConfigListScreen):
    def __init__(self, session):
    Screen.__init__(self, session)
    skin = """<screen name="HDMU_MilightControl" position="280,75" size="720,605" title="Milight Control" flags="wfNoBorder" backgroundColor="#ff000000">
    <eLabel position="0,0" zPosition="-3" size="720,605" backgroundColor="black" />
    <widget name="config" zPosition="2" position="253,215" size="400,300" scrollbarMode="showOnDemand" foregroundColor="white" backgroundColor="black" transparent="1"/>
    <ePixmap position="250,530" zPosition="2" size="35,25" pixmap="skin_default/buttons/key_red.png" alphatest="blend"/>
    <ePixmap position="250,560" zPosition="2" size="35,25" pixmap="skin_default/buttons/key_green.png" alphatest="blend"/>
    <ePixmap position="450,530" zPosition="2" size="35,25" pixmap="skin_default/buttons/key_yellow.png" alphatest="blend"/>
    <ePixmap position="450,560" zPosition="2" size="35,25" pixmap="skin_default/buttons/key_blue.png" alphatest="blend"/>
    <widget name="red" zPosition="2" halign="left" position="300,530" size="150,25" foregroundColor="white" backgroundColor="black" transparent="1" font="Regular;20"/>
    <widget name="green" zPosition="2" halign="left" position="300,560" size="150,25" foregroundColor="white" backgroundColor="black" transparent="1" font="Regular;20"/>
    <widget name="yellow" zPosition="2" halign="left" position="500,530" size="150,25" foregroundColor="white" backgroundColor="black" transparent="1" font="Regular;20"/>
    <widget name="blue" zPosition="2" halign="left" position="500,560" size="150,25" foregroundColor="white" backgroundColor="black" transparent="1" font="Regular;20"/>
    </screen>"""
    self.skin = skin
    self["green"] = Label(_("All zones on"))
    self["red"] = Label(_("All zones off"))
    self["yellow"] = Label(_("All zones min brightness"))
    self["blue"] = Label(_("All zones max brightness"))
    self.ip = '%d.%d.%d.%d' % tuple(config.plugins.milight.ip.value)
    self.led_connection = wifileds.limitlessled.connect(self.ip, int(config.plugins.milight.port.value))
    self.list = [ ]
    self.onChangedEntry = [ ]
    ConfigListScreen.__init__(self, self.list, session = session, on_change = self.changedEntry)
    self["actions"] = ActionMap(["OkCancelActions", "DirectionActions", "ColorActions", "NumberActions"],
    {
    "cancel": self.exit,
    "ok": self.OK,
    "left": self.keyLeft,
    "right": self.keyRight,
    "green": self.allon,
    "red": self.alloff,
    "yellow": self.minbright,
    "blue": self.maxbright,
    }, -1)
    self.createsetup()
    def changedEntry(self):
    for x in self.onChangedEntry:
    x()
    def exit(self):
    for x in self["config"].list:
    x[1].cancel()
    self.close()
    def createsetup(self):
    list = [
    getConfigListEntry(_('IP'), config.plugins.milight.ip),
    getConfigListEntry(_('Port'), config.plugins.milight.port),
    # getConfigListEntry(_("All Zone Color:"), config.plugins.milight.zoneall),
    getConfigListEntry(_("All Zone red color:"), config.plugins.milight.zoneall_static_color_r),
    getConfigListEntry(_("All Zone green color:"), config.plugins.milight.zoneall_static_color_g),
    getConfigListEntry(_("All Zone blue color:"), config.plugins.milight.zoneall_static_color_b),
    # getConfigListEntry(_("Zone 1 Color:"), config.plugins.milight.zone1),
    # getConfigListEntry(_("Zone 2 Color:"), config.plugins.milight.zone2),
    # getConfigListEntry(_("Zone 3 Color:"), config.plugins.milight.zone3),
    # getConfigListEntry(_("Zone 4 Color:"), config.plugins.milight.zone4),
    getConfigListEntry(_("All Zone Brightness:"), config.plugins.milight.brightness),
    # getConfigListEntry(_("Zone 1 Brightness:"), config.plugins.milight.zone1brightness),
    # getConfigListEntry(_("Zone 2 Brightness:"), config.plugins.milight.zone2brightness),
    # getConfigListEntry(_("Zone 3 Brightness:"), config.plugins.milight.zone3brightness),
    # getConfigListEntry(_("Zone 4 Brightness:"), config.plugins.milight.zone4brightness),
    ]
    self["config"].list = list
    self["config"].setList(list)
    self.ip = '%d.%d.%d.%d' % tuple(config.plugins.milight.ip.value)
    self.led_connection = wifileds.limitlessled.connect(self.ip, int(config.plugins.milight.port.value))
    def keyLeft(self):
    self["config"].handleKey(KEY_LEFT)
    self.update()
    def keyRight(self):
    self["config"].handleKey(KEY_RIGHT)
    self.update()
    def update(self):
    if self["config"].getCurrent()[1] in (config.plugins.milight.zoneall_static_color_r, config.plugins.milight.zoneall_static_color_g, config.plugins.milight.zoneall_static_color_b):
    import colorsys
    r = float(config.plugins.milight.zoneall_static_color_r.value)
    g = float(config.plugins.milight.zoneall_static_color_g.value)
    b = float(config.plugins.milight.zoneall_static_color_b.value)
    print "red: " + str(config.plugins.milight.zoneall_static_color_r.value)
    print "green: " + str(config.plugins.milight.zoneall_static_color_g.value)
    print "blue: " + str(config.plugins.milight.zoneall_static_color_b.value)
    h, l, s = colorsys.rgb_to_hls(r/255.0,g/255.0,b/255.0)
    h = abs(int(round((h) * 360))-170)
    print "gesendet" + str(h)
    self.led_connection.rgbw.set_color_hex(chr(h))
    def alloff(self):
    self.led_connection.rgbw.all_off()
    def allon(self):
    self.led_connection.rgbw.white()
    self.led_connection.rgbw.all_on()
    def minbright(self):
    self.led_connection.rgbw.min_brightness()
    def maxbright(self):
    self.led_connection.rgbw.max_brightness()
    def OK(self):
    for x in self["config"].list:
    x[1].save()
    self.close()
    def menu(session, **kwargs):
    session.open(HDMU_MilightControl)
    def Plugins(**kwargs):
    return [PluginDescriptor(name = "MiLight Control", description = "Controll your MiLight", where = [PluginDescriptor.WHERE_PLUGINMENU], fnc = menu),]
    [/php]


    Sag mal muss ich bei jeder Pluginänderung neu starten um die pyo zu aktualisieren oder kann ich das auch händich über die konsole?

  • es gibt ein plugin das heisst plugload
    das sollte die py zur pyo machen und auch sofort bereit sein im e2




    super, werde später mal testen und das plugin umschreiben, wenn zeit da ist und nicht so warm :grinning_squinting_face:



    habs jetzt kurz gegengetestet



    red: 180
    green: 15
    blue: 255
    gesendet111


    angezeigte farbe= grün


    sollfarbe lila/pink


    haut immer noch nich ganz hin

  • Zitat

    Original von addybo
    es gibt ein plugin das heisst plugload
    das sollte die py zur pyo machen und auch sofort bereit sein im e2


    Perfekt, suche ich mir raus danke!






    Jetzt ist aber Langsam mal gut du mit deinen Rottönen :tongue: :tongue:


    So alle gute Dinge sind ja 3, also 3 von denen :einschenken: und nochmla alles in Ruhe angesehen.
    Da ist nicht nur eine Verschiebung sondern auch eine Spiegelung drin, sieht man wenn man sich die 2 Kreise ansieht:


    Chinakreis (LED Lampen)
    Original HLS Kreis


    Und das kommt bei mir raus:
    [php]
    import wifileds
    from Plugins.Plugin import PluginDescriptor
    from Components.PluginComponent import plugins
    from Screens.Screen import Screen
    from Components.Label import Label
    from Components.Sources.List import List
    from Components.config import *
    from Components.ConfigList import ConfigList, ConfigListScreen
    from Components.ActionMap import ActionMap
    config.plugins.milight = ConfigSubsection()
    #colors = [('off',_("off")),('white',_("white")),('violet',_('violet')),('royal_blue',_('royal_blue')),('baby_blue',_('baby_blue')),('aqua',_('aqua')),('mint',_('mint')),('seafoam_green',_('seafoam_green')),('green',_('green')),('lime_green',_('lime_green')),('yellow',_('yellow')),('yellow_orange',_('yellow_orange')),('orange',_('orange')),('red',_('red')),('pink',_('pink')),('fusia',_('fusia')),('lilac',_('lilac')),('lavendar',_('lavendar'))]
    #config.plugins.milight.zone1 = ConfigSelection(colors)
    #config.plugins.milight.zone2 = ConfigSelection(colors)
    #config.plugins.milight.zone3 = ConfigSelection(colors)
    #config.plugins.milight.zone4 = ConfigSelection(colors)
    #config.plugins.milight.zoneall = ConfigSelection(colors)


    config.plugins.milight.zoneall_static_color_r = ConfigSlider(default=255, increment=5, limits=(0,255))
    config.plugins.milight.zoneall_static_color_g = ConfigSlider(default=25, increment=5, limits=(0,255))
    config.plugins.milight.zoneall_static_color_b = ConfigSlider(default=2, increment=5, limits=(0,255))


    config.plugins.milight.brightness = ConfigSlider(default=27, limits=(2, 27))
    config.plugins.milight.zone1brightness = ConfigSlider(default=27, limits=(2, 27))
    config.plugins.milight.zone2brightness = ConfigSlider(default=27, limits=(2, 27))
    config.plugins.milight.zone3brightness = ConfigSlider(default=27, limits=(2, 27))
    config.plugins.milight.zone4brightness = ConfigSlider(default=27, limits=(2, 27))
    config.plugins.milight.ip = ConfigIP(default=[192,168,2,106])
    config.plugins.milight.port = ConfigInteger(default=8899, limits=(1, 9999))
    class HDMU_MilightControl(Screen, ConfigListScreen):
    def __init__(self, session):
    Screen.__init__(self, session)
    skin = """<screen name="HDMU_MilightControl" position="280,75" size="720,605" title="Milight Control" flags="wfNoBorder" backgroundColor="#ff000000">
    <eLabel position="0,0" zPosition="-3" size="720,605" backgroundColor="black" />
    <widget name="config" zPosition="2" position="253,215" size="400,300" scrollbarMode="showOnDemand" foregroundColor="white" backgroundColor="black" transparent="1"/>
    <ePixmap position="250,530" zPosition="2" size="35,25" pixmap="skin_default/buttons/key_red.png" alphatest="blend"/>
    <ePixmap position="250,560" zPosition="2" size="35,25" pixmap="skin_default/buttons/key_green.png" alphatest="blend"/>
    <ePixmap position="450,530" zPosition="2" size="35,25" pixmap="skin_default/buttons/key_yellow.png" alphatest="blend"/>
    <ePixmap position="450,560" zPosition="2" size="35,25" pixmap="skin_default/buttons/key_blue.png" alphatest="blend"/>
    <widget name="red" zPosition="2" halign="left" position="300,530" size="150,25" foregroundColor="white" backgroundColor="black" transparent="1" font="Regular;20"/>
    <widget name="green" zPosition="2" halign="left" position="300,560" size="150,25" foregroundColor="white" backgroundColor="black" transparent="1" font="Regular;20"/>
    <widget name="yellow" zPosition="2" halign="left" position="500,530" size="150,25" foregroundColor="white" backgroundColor="black" transparent="1" font="Regular;20"/>
    <widget name="blue" zPosition="2" halign="left" position="500,560" size="150,25" foregroundColor="white" backgroundColor="black" transparent="1" font="Regular;20"/>
    </screen>"""
    self.skin = skin
    self["green"] = Label(_("All zones on"))
    self["red"] = Label(_("All zones off"))
    self["yellow"] = Label(_("All zones min brightness"))
    self["blue"] = Label(_("All zones max brightness"))
    self.ip = '%d.%d.%d.%d' % tuple(config.plugins.milight.ip.value)
    self.led_connection = wifileds.limitlessled.connect(self.ip, int(config.plugins.milight.port.value))
    self.list = [ ]
    self.onChangedEntry = [ ]
    ConfigListScreen.__init__(self, self.list, session = session, on_change = self.changedEntry)
    self["actions"] = ActionMap(["OkCancelActions", "DirectionActions", "ColorActions", "NumberActions"],
    {
    "cancel": self.exit,
    "ok": self.OK,
    "left": self.keyLeft,
    "right": self.keyRight,
    "green": self.allon,
    "red": self.alloff,
    "yellow": self.minbright,
    "blue": self.maxbright,
    }, -1)
    self.createsetup()
    def changedEntry(self):
    for x in self.onChangedEntry:
    x()
    def exit(self):
    for x in self["config"].list:
    x[1].cancel()
    self.close()
    def createsetup(self):
    list = [
    getConfigListEntry(_('IP'), config.plugins.milight.ip),
    getConfigListEntry(_('Port'), config.plugins.milight.port),
    # getConfigListEntry(_("All Zone Color:"), config.plugins.milight.zoneall),
    getConfigListEntry(_("All Zone red color:"), config.plugins.milight.zoneall_static_color_r),
    getConfigListEntry(_("All Zone green color:"), config.plugins.milight.zoneall_static_color_g),
    getConfigListEntry(_("All Zone blue color:"), config.plugins.milight.zoneall_static_color_b),
    # getConfigListEntry(_("Zone 1 Color:"), config.plugins.milight.zone1),
    # getConfigListEntry(_("Zone 2 Color:"), config.plugins.milight.zone2),
    # getConfigListEntry(_("Zone 3 Color:"), config.plugins.milight.zone3),
    # getConfigListEntry(_("Zone 4 Color:"), config.plugins.milight.zone4),
    getConfigListEntry(_("All Zone Brightness:"), config.plugins.milight.brightness),
    # getConfigListEntry(_("Zone 1 Brightness:"), config.plugins.milight.zone1brightness),
    # getConfigListEntry(_("Zone 2 Brightness:"), config.plugins.milight.zone2brightness),
    # getConfigListEntry(_("Zone 3 Brightness:"), config.plugins.milight.zone3brightness),
    # getConfigListEntry(_("Zone 4 Brightness:"), config.plugins.milight.zone4brightness),
    ]
    self["config"].list = list
    self["config"].setList(list)
    self.ip = '%d.%d.%d.%d' % tuple(config.plugins.milight.ip.value)
    self.led_connection = wifileds.limitlessled.connect(self.ip, int(config.plugins.milight.port.value))
    def keyLeft(self):
    self["config"].handleKey(KEY_LEFT)
    self.update()
    def keyRight(self):
    self["config"].handleKey(KEY_RIGHT)
    self.update()
    def update(self):
    if self["config"].getCurrent()[1] in (config.plugins.milight.zoneall_static_color_r, config.plugins.milight.zoneall_static_color_g, config.plugins.milight.zoneall_static_color_b):
    import colorsys
    r = float(config.plugins.milight.zoneall_static_color_r.value)
    g = float(config.plugins.milight.zoneall_static_color_g.value)
    b = float(config.plugins.milight.zoneall_static_color_b.value)
    print "red: " + str(config.plugins.milight.zoneall_static_color_r.value)
    print "green: " + str(config.plugins.milight.zoneall_static_color_g.value)
    print "blue: " + str(config.plugins.milight.zoneall_static_color_b.value)
    h, l, s = colorsys.rgb_to_hls(r/255.0,g/255.0,b/255.0)
    h=int(int(h * 360) + 120)
    if h>=360:
    h = h - 360
    h=abs(h-360)
    h = int((h / 360.0) * 255.0)
    print "gesendet" + str(h)
    self.led_connection.rgbw.set_color_hex(chr(h))
    def alloff(self):
    self.led_connection.rgbw.all_off()
    def allon(self):
    self.led_connection.rgbw.white()
    self.led_connection.rgbw.all_on()
    def minbright(self):
    self.led_connection.rgbw.min_brightness()
    def maxbright(self):
    self.led_connection.rgbw.max_brightness()
    def OK(self):
    for x in self["config"].list:
    x[1].save()
    self.close()
    def menu(session, **kwargs):
    session.open(HDMU_MilightControl)
    def Plugins(**kwargs):
    return [PluginDescriptor(name = "MiLight Control", description = "Controll your MiLight", where = [PluginDescriptor.WHERE_PLUGINMENU], fnc = menu),]
    [/php]

  • Zitat

    Original von Newan
    [quote]Original von addybo
    genial, jetzt scheints endlich zu passen :grinning_squinting_face:


    ich vergehe mich mal ans plugin^^


    Ich hätte da noch einen vorschlage fürs Plugin. Könntest du für mein Ambilight Script noch Anpassungen machen?


    Kann du einen Schalter bauen, AmbilightMilight on/off?


    Dazu dann einfach einen File (bsp. milight.lock) in einen bestimmten Ordner legen (bsp. /tmp), oder mir die Möglichkeit geben von außen die Einstellung abzufragen. Dann würde ich das Ambilightscript mal vornehmen und verbessern!
    Kanns auch versuchen, aber wenn du schonmal dran bist :grinning_face_with_smiling_eyes:



    edit: sorry für Doppelpost

  • bin immer noch begeistert, tolle arbeit.


    cool wäre noch wenn mann on/off und die zonen oder farben auf einen Quiqbotton legen könnte. Dann könnte man zumbeispiel mit einem langen tastendruck auf grün einschalten und mit gelb abschalten. dann könnte man das auch einer Universalfernbedienung beibringen und das lich ein und aus zu schalten


    Meine konfig ist im moment.


    eine LED Tube
    https://www.youtube.com/watch?v=HSBvRQ8wP-k


    mit oben und unten milight e27 watt und in der mitte 5 meter LED RGB Stripp um die mitte gewickelt und auch mit einem milight rgbw controller. dann nochmals 2x2 LED Tubes mit je zwei e27 lampen.


    Die philips hue lampen sind im moment ausser betrieb


    gruss



  • sorry bringe den doppel post nicht mehr raus

  • mh echt komisches image was du da hast^^


    muss gestehen hab keine dreambox^^


    bei mir schauts so aus, muss man wohl für dein image an den werten feilen..hab extra center gemacht, weil mittig :grinning_squinting_face:



    edit:


    schau mal obs so passt:
    https://github.com/HDMU/MiLigh…22628ad9a795deb2461b18a31

  • Zitat

    Original von pierrecinema
    bin immer noch begeistert, tolle arbeit.


    cool wäre noch wenn mann on/off


    kann man
    einfach alle farben auf 0 stellen
    also rot grün blau alles 0, dann is aus
    bei 255 weiss



    Zitat

    Original von pierrecinema
    bin immer noch begeistert, tolle arbeit.


    die zonen oder farben auf einen Quiqbotton legen könnte. Dann könnte man zumbeispiel mit einem langen tastendruck auf grün einschalten und mit gelb abschalten. dann könnte man das auch einer Universalfernbedienung beibringen und das lich ein und aus zu schalten


    da hab ich bewusst nur alle zonen ein/aus und hell/dunkel auf die farbtasten gelegt


    vielleicht fällt mir da noch was zu ein

  • ich benutze ein aktuellle orginal image mit gemini plugin, habe diverse skins getestet, habe das mit der center funktion gesehen die scheint aber nicht zu gehen. wegen dem quiqbutton meine ich was anderes , da du keine box hast kennst du das nicht. ich versuche es mal einzubauen.


    gruss


  • Jup jetzt passt es


  • das mit den farb tasten ist perfekt, vvorallem das runter faden und danach aus. soft off quasi.


    ich dachte an den bluepanal quiqbutton oder dann eben im plugin zumbeispiel wenn ich die 1 drücke zone 1 on off die 2 zone 2 on off. so könnte man diese direkt anwählen


    ist aber keineswegs eine kritik, bin jetzt schon sehr zufrieden

  • Boblight button



    eine frage, welche funktion hat der boblight on off button. ich kann keinen unterschied feststellen


    danke