Kodi Community Forum
Release YeeMee - (Control Yeelight Smart Bulb + Ambi from Kodi) - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Service Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=152)
+---- Thread: Release YeeMee - (Control Yeelight Smart Bulb + Ambi from Kodi) (/showthread.php?tid=313197)



YeeMee - (Control Yeelight Smart Bulb + Ambi from Kodi) - DaLanik - 2017-04-26

http://projects.lanik.org/KodiProject_YeeMee.htm

YeeMee addon

Image


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 4 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-4). Then set IP address for each Yeelight. There is an option to automatically search for bulbs but it doesn't work every time. Try it several times if it doesn't work. Eventually it will find the bulbs Smile DO NOT FORGET TO TURN ON THE DEVELOPER MODE ON THE BULBS! Finally, set actions and options (color, transition, effect, brightness) for play, pause and stop.

This should work on all platforms. Any comments welcome.


Like addon Facebook page!

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

Image

RENDER CAPTURE DEBUGGING:


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




Video demo and tutorials on Youtube:

Control Lights from Kodi and Ambilight effect with Yeelight bulbs




Configuring bulbs in YeeMee addon for Kodi





Donate Here

Image


RE: YeeMee - (Control Yeelight Smart Bulb from Kodi) - DaLanik - 2017-04-26

Discover Yeelights function demo




Test of YeeMee Ambilight project HD with actual video





RE: YeeMee - (Control Yeelight Smart Bulb from Kodi) - DaLanik - 2017-04-27

Some instructions on how to get this 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.

That's it!


RE: YeeMee - (Control Yeelight Smart Bulb from Kodi) - DaLanik - 2017-04-27

v0.8
- Improved settings

v0.7
- Option to turn the light(s) on Kodi start


RE: YeeMee - (Control Yeelight Smart Bulb from Kodi) - DaLanik - 2017-04-27

v0.9
- Fixed bug with short videos less than 1 hr


RE: YeeMee - (Control Yeelight Smart Bulb from Kodi) - DaLanik - 2017-04-28

v.91
- Option to blink bulbs at startup
- Option to blink bulbs at startup and turn them on
- Small code and settings cleanup


RE: YeeMee - (Control Yeelight Smart Bulb from Kodi) - DaLanik - 2017-04-29

v.92
- Updated translations
- Option to set active time to sunrise-sunset


The new option to set active time - no can be set to manual (you set the hours) or automatic - then it gets your IP adress from the internet and according to your adress it gets position and sunrise and sunset times for your city, and set active hours accordingly. It works automatically, so it sets the times on each run.


RE: YeeMee - (Control Yeelight Smart Bulb from Kodi) - nickr - 2017-04-30

Thanks for this. I don't have a yeelight but I have other xioami products and the beginnings of a home automation system.


RE: YeeMee - (Control Yeelight Smart Bulb from Kodi) - mishmashed - 2017-04-30

Great work, would it be possible to have presets for colours, maybe including flow mode as well as the rgb value option? I really like the "home" preset on the Yeelight app but don't know the rgb value for this setting.


RE: YeeMee - (Control Yeelight Smart Bulb from Kodi) - DaLanik - 2017-04-30

Probably possible but I have to take a look at it... Smile You mean to have flow all the time, i.e. when the pause is pressed?


RE: YeeMee - (Control Yeelight Smart Bulb from Kodi) - DaLanik - 2017-04-30

v.93
- Fixed problem that it executed lights actions on non-video stop


RE: YeeMee - (Control Yeelight Smart Bulb from Kodi) - DaLanik - 2017-05-01

v1.0
- Displays test results
- Automatic bulb IP adress discovery
- Display active time even when on automatic
- Differentiate between bulb types (color, mono)

In normal repository (not test repo!)


RE: YeeMee - (Control Yeelight Smart Bulb from Kodi) - mishmashed - 2017-05-01

(2017-04-30, 12:46)DaLanik Wrote: Probably possible but I have to take a look at it... Smile You mean to have flow all the time, i.e. when the pause is pressed?

Yes would be nice to have the option of flow continual when pause pressed.
Is it possible to extract the RGB values from the yeelight app presets myself so that i could manually enter them into Yeemee settings?


RE: YeeMee - (Control Yeelight Smart Bulb from Kodi) - DaLanik - 2017-05-01

I thouht of adding option to have flow when music is played.

I could probably attach flow to color 000000 because that one is not used as it is black Smile so when you set 000000 it does flow....


RE: YeeMee - (Control Yeelight Smart Bulb from Kodi) - DaLanik - 2017-05-02

(2017-05-01, 21:48)mishmashed Wrote: Is it possible to extract the RGB values from the yeelight app presets myself so that i could manually enter them into Yeemee settings?

I don't know how to extract colors - that is all in Yeelight/MiHome app...