Beiträge von navigonic

    So this is to use the RGB Bulb as a cheap ambilight:


    Set the mode as udp (new implementation is what I use)
    Set it up as 1 LED (use left or right), port 19446


    then set the ip to whatever computer can run this script:.


    You'll need to "pip install yeelight"


    The script/server:
    import socket
    import time
    from yeelight import *


    #UDP SERVER
    port = 19446
    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    s.bind(("", port))
    print("waiting on port:", port)


    #YEELIGHT
    bulb = Bulb("BULB_IP_ADDRESS")
    bulb.turn_on()
    bulb.effect = "sudden"


    #Stop/Start music mode, bypasses lamp rate limits, ensures that previous sockets close before starting
    bulb.stop_music()
    time.sleep(1)
    bulb.start_music()
    time.sleep(1)


    while True:
    d = s.recvfrom(3)
    bulb.set_rgb(*bytearray(d[0]))

    Hi! (Double-post from Hardware, realized this is a generic software feature/request/problem )


    I'm attempting to create a lowcost rgbw ambilight setup, using a wifi-connected rgbw lightbulb from xiaomi that allows python/json commands to set rgb-colors. I'm attempting to see if Hyperion can be setup to work with Kodi on a Raspberry Pi 3 to average screen color and then run submit rgbw colors as arguments to a python script.


    Has anyone tried something similar and could perhaps direct me towards a resource to read up on how to get hyperion to forward rgb colors to a python script?


    This is what I'm trying to use (using python-yeelight library):


    [INDENT]from yeelight import *
    import sys


    bulb = Bulb(IPADDRESS)
    bulb.turn_on()



    while True:
    input = sys.stdin.readline()
    print(input)
    inputData=input.split(' ')
    if(len(inputData)>3):
    r = float(inputData[0])
    g = float(inputData[1])
    b = float(inputData[2])
    bulb.set_rgb(r, g, b)[/INDENT]



    I can see it can output a file, but is it possible to get it outputting as a continuous stream to a python script as above?


    Sorry if the question is vague..

    Hi!


    I'm attempting to create a lowcost rgbw ambilight setup, using a wifi-connected rgbw lightbulb from xiaomi / yeelight that allows python/json commands to set rgb-colors. I'm attempting to see if Hyperion can be setup to work with Kodi on a Raspberry Pi 3 to average screen color and then run submit rgbw colors as arguments to a python script.


    Has anyone tried something similar and could perhaps direct me towards a resource to read up on how to get hyperion to forward rgb colors to a python script?


    This is what I'm trying to use (using python-yeelight library):


    [INDENT]from yeelight import *
    import sys


    bulb = Bulb(IPADDRESS)
    bulb.turn_on()



    while True:
    input = sys.stdin.readline()
    print(input)
    inputData=input.split(' ')
    if(len(inputData)>3):
    r = float(inputData[0])
    g = float(inputData[1])
    b = float(inputData[2])
    bulb.set_rgb(r, g, b)[/INDENT]



    I can see it can output a file, but is it possible to get it outputting as a continuous stream to a python script as above?


    Sorry if the question is vague..