The KODI Project
KODI ADDON - CONTROL YEELIGHT BULBS
by Dalibor Lanik
This addon controls Xiaomi Yeelight from Kodi. It is possible to set addon to turn on/off light(s) on video start, stop or pause. Also you can specify whether to turn it on/off immediately or smoothly and specify time in which to perform the transition (is smooth transition specified). You can also specify light color for all operation(s) individually as well as light intensity in percent.
If option is stop (video stopped), you can set to return to previous state (if it was on it will return to on if it was off it will return to off).
Advanced features allow you to specify time-frame i.e. turn lights on/off only between 10pm and 7am, and you can also disable light activation/deactivation for videos shorter than specified time.
You can set up to 8 YeeLights, and each can be set and controlled individually, i.e. different operation, color and intensity.
There is also Ambi option, so 1 or more Yeelights can be used as ambi lights during video play.
In order to install it, first install my REPO: Lanik Repo
Then install add-on, and configure it:
First set up how many Yeelights you have (1-8). Then set IP address for each Yeelight. Finally, set actions and options (color, transition, effect, brightness) for play, pause and stop.
Some instructions on how to get the bulb working:
First of all, you need to create an Mi-account on Xiaomi. With this account you will be able to connect to your bulb. It is needed to "activate" only once, after you will control it from your LAN.
Then you need to connect your Yeelight to your phone. With the instruction manual, there came a barcode with link to the app MiHome - don't use this. You will want to uninstall it (if you did install it) and use Yeelight app.
This Yeelight app is identiacal to MiHome, but has couple more options, one of them being to turn the "developer mode", which MiHome lacks. Developer mode means that you can use the Yeelight bulb with other devices and other software than Xiaomi's.
After I installed Yeelight app, I had to reset the bulb. Yeelight wouldn't find it because it was already found by MiHome. Reset the bulb by turning it off and on for 5 times. Wait 2 seconds after each turn off/on. At the 5th on, it should start cycling colors and after the cycle is finished (several seconds) it should light in pure white color. This means the bulb was reset.
Now, try searching for it from Yeelight app from your phone. It goes without saying that your phone should be connected to your WiFi. It will disconnect once, ask for a password to your WiFi, and then it will find the bulb. You will have the bulb in the list of devices.
Do this for all/any bulbs you have.
Now. I suggest giving your bulbs static IP adresses. You can do this on your router. Just make a reservation for the IP the bulb was already given by your DHCP server.
OK, now you need to go to the Yeelight app and turn on the developer mode. This will make the light bulb controllable by other software than Xiaomi's.
After you install the YeeMee addon, enter the bulb IP adress into the settings, and go to testing and test the bulb. Test function should light the bulb for 3 seconds and turn it off.
If it does not work on Android AMLogic Boxes, you just need to disable hardware decoding..... (all 3 options) i.e. for Jarvis: settings -> video -> acceleration, or Krypton: settings -> player -> video on Krypton
For RenderCapture debug (to see if screen capturing is working at all - i.e. Ambi function not working):
* In YeeMee settings, first set only 1 bulb (not necessary, but best for testing) and set "use as YeeMee Ambi" to "whole screen".
* Set, under "Ambi Options", "Ambi precision" to "Ultra High"
* Under "Testing" tab, set "Debug Render Capture" to "on"
Now, once you play a video, this will create JPEG image captures in your TEMP folder (please google where that is in Kodi), small JPG image files. These files should be CAPTURED screenshots of the movie played. Just open them and you will see either black/white pictures or the actual screens from your played movie. There will be many since naming is bulb IP - date-time, they should be sorted by bulb and then time. If capture works, you should get small thumbnails of your played video. If you just get black JPGs, then it doesn't work....
After debug, these JPGs are safe to delete. Just don't forget to turn off this option since it will keep creating JPGs until you run out of space