1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Xiaomi RGB Bulb simple UDP server solution

Discussion in 'Hyperion Setup Showcase' started by navigonic, 10 December 2016.

  1. cmvac

    cmvac New Member

    Messages:
    18
    Hardware:
    RPi2, 32/64bit, Wetek
    No, both lights have LAN-Control on.
     
  2. soulsick

    soulsick New Member

    Messages:
    6
    Hardware:
    RPi2
    OK, I think you are listening on the wrong port. if you used the same ports as i did, you have to use port 20450 in the yee.py
     
  3. cmvac

    cmvac New Member

    Messages:
    18
    Hardware:
    RPi2, 32/64bit, Wetek
    That might be it! I was the whole day around my computer, RasPi and the lights that I might have overseen that. Let me check and I'll get back ASAP.
     
  4. cmvac

    cmvac New Member

    Messages:
    18
    Hardware:
    RPi2, 32/64bit, Wetek
    Ok, so I changed the port to 20450, but still nothing.

    Let me give you what I wrote in the yee.py file and in all the others:

    yee.py:

    yeelight1.config.json:
    yeelight1.config.json:

    main hyperion.config.json has the following added, as instructed:


    "forwarder" :
    {
    "json" : [ "192.168.1.29:20450", "192.168.1.59:20452" ],
    "proto" : [ "192.168.1.29:20451", "192.168.1.59:20453" ]
    },


    "endOfJson" : "endOfJson"
    }

    Again, there must be something escaping me. What am I doing wrong?
     
  5. soulsick

    soulsick New Member

    Messages:
    6
    Hardware:
    RPi2
    Assuming your IPs are correct, it's simply a port issue. Let's have a look step by step:

    yee.py looks ok, the IP here should be the IP of your first yeelight.
    For your second yeelight, you need another .py file, for example yee2.py. Obviously use the IP of your second yeelight and another port, for example port 20541.

    Regarding your yeelight.config.json files:
    In the "device" block, the "output" line must not be the same in both configs. Change the port in the second file, use 20451 as above. The IP here should match the IP of the RPi where the .py files are run (if your .py files run on the same RPi as hyperion you may also use 127.0.0.1 as the IP).
    Also, your "jsonServer" and "protoServer" ports are wrong. Use 19450 and 19451 in config1, 19452 and 19453 ind config 2. These ports must be different from the udp port you used above!

    Finally, change "forwarder" block to
    Code:
    "forwarder" :
    {
    "json" : [ "192.168.1.59:19450", "192.168.1.59:19452" ],
    "proto" : [ "192.168.1.59:19451", "192.168.1.59:19453" ]
    },
    Be careful with the IP here, you mixed up .29 and .59. Again this is the IP of your RPi, thus you can also use 127.0.0.1.

    I know it's a big mess with the IPs and ports. For me it helped doing small graphs. Essentially you need 3 servers for each yeelight, each with a different port: udp, json and proto server.
     
  6. Landixus

    Landixus New Member

    Messages:
    1
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
    It is possible to use this from windows pc (win7)
    I have a setup with USB Grabber: https://hyperion-project.org/wiki/HyperCon-GrabberTab is working fine.
    The source is my Windows 7 PC and i like to add a yeelight color bulb.

    the bad is that i use kodi openelec and this is only working for the internal grabber, because i cannot install with pip.
    But when i can execute python yeelight library, then i should be able to use this from there?

    Otherwise is there a solution that i can use with grabber setup for my yeelight?