v15 [wip] Milights / LimitlessLED control
#1
Information 
Quote:Hello everyone

As my first post to the Kodi forums, may I present to you my first incarnation of a kodi addon to control milights and any other LimitlessLED-based controller. I made this because I was not able to find anything already made.

install my repo from: https://github.com/mookfist/repo

then install the Mookfist Milights addon.

This is a work in progress but I felt it was good enough to announce.

What it can do currently:

1. It will fade out and fade in lights when a movie and/or TV show starts or stops playing (you can enable/disable movie and TV dimming)
2. It can set the initial state of your lights (brightness and color)

Immediate short term future plans:

1. A configurable interval between pausing a video, and the lights coming back on
2. Adjust the speed that the light dims in and out (the setting is there, but it does nothing)
3. Have the fade in fade out happen in a separate thread so it can be interrupted and resumed
4. Additional timing tricks to prevent lights from turning on and off when changing videos quickly (like going from one episode of a TV show to another).

Long term plans:

1. Movie theaters often dim the lights maybe 50% when playing trailers. There is the Cinema Experience plugin that plays trailers and commercials before a film starts. Can I make the two work together?
2. I have no idea how this will work with video plugins like Youtube yet.
3. PseudoTV Live (my favorite kodi addon of all time) integration? I'm not sure how it would integrate or if it even should integrate but at least I'll explore.
4. Something like f.lux? F.lux is an awesome program (not a kodi addon) that adjusts the color temperature of your screen based on what time of day it is. Very handy for the late night hacker. It seems like a similar concept might be useful for my living room lights as well.

If you want to submit a feature request or bug report, feel free to do so. You'll have better luck doing it through github than through the forums mind you. This is a work in progress, but it's not far off from a real initial release.

edit: note that all my addon development has been tested on Kodi 15.x

-- Current Version: 0.0.12 --

Changelog:

version 0.0.12
- Added settings to control how lights behave when pausing
- Fixed issue with group no. 4 not working

version 0.0.11
- Refactoring of internals
- Added ability to turn logging on or off
- Respects minimum and maximum brightness settings (issue #15)
- Updates configuration without having to restart service (issue #16)
- German translation (thanks to brindosch)

version 0.0.10
- Add a "Command Delay" setting to change the the delay amount (in
milliseconds) between commands sent to the light bulbs

Version 0.0.9
- Multiple light groups will fade out simultaneously
- If lights are in the middle of fading out, and they receive a fade in
command, they will fade in immediately now, instead of waiting for the fade
out to finish (and vice versa).

Version 0.0.8
- Revamped configuration
- Speed configuration respected
- Ability to control multiple groups at once
- Fading done in a separate thread
Reply
#2
@mookfist

Code:
<addon id="repository.mookfist" name="Mookfist Repo" version="1.6" provider-name="Mookfist">
    <extension point="xbmc.addon.repository" name="Official PseudoTV Live Repository">
</addon>

Oh really, lol... news to me Tongue

I don't see why we can't get this integrated with PseudoTV Live
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#3
Can't install repo from zip... KODI mentions wrong structure
Reply
#4
(2015-11-06, 22:03)Lunatixz Wrote: @mookfist

Code:
<addon id="repository.mookfist" name="Mookfist Repo" version="1.6" provider-name="Mookfist">
    <extension point="xbmc.addon.repository" name="Official PseudoTV Live Repository">
</addon>

Oh really, lol... news to me Tongue

I don't see why we can't get this integrated with PseudoTV Live

oh wow, I'm sorry. I did copy the addon.xml just as a template, I guess I missed a few things. I will fix this right now!

edit: I fixed the XML file but I'll update the ZIP file tonight.
Reply
#5
(2015-11-08, 18:05)kurniawan77 Wrote: Can't install repo from zip... KODI mentions wrong structure

hmm, I will take a look at it a bit later. I tested the zip last week on a fresh install of Kodi 15 and did not have any issues.

Were you using Kodi 15.2?
Reply
#6
(2015-11-06, 22:03)Lunatixz Wrote: I don't see why we can't get this integrated with PseudoTV Live

Well, there are a few things I'd need to do first in order for it to make sense. The big one is threading the actual work to fade lights. I don't think many people would like it if every time a new episode starts playing, the lights fade in and out Wink

I'm quite new to kodi plugin development, but from what I gather, there is only ever one instance of a "player". I wish the API would make this a bit more obvious because code-wise, you're creating a new instance of a player, but what really seems to be happening is that you're getting a singleton. Took me a while to figure this out.

So my assumption is that PseudoTV is just using this player class like anything else so I may not have to do anything at all.
Reply
#7
(2015-11-09, 21:09)mookfist Wrote:
(2015-11-06, 22:03)Lunatixz Wrote: I don't see why we can't get this integrated with PseudoTV Live

Well, there are a few things I'd need to do first in order for it to make sense. The big one is threading the actual work to fade lights. I don't think many people would like it if every time a new episode starts playing, the lights fade in and out Wink

I'm quite new to kodi plugin development, but from what I gather, there is only ever one instance of a "player". I wish the API would make this a bit more obvious because code-wise, you're creating a new instance of a player, but what really seems to be happening is that you're getting a singleton. Took me a while to figure this out.

So my assumption is that PseudoTV is just using this player class like anything else so I may not have to do anything at all.


I think you might be over complicating integration... If you want my advice... I would:

1. allow arguments to control light on/off, fade in/out, etc... ie.
Code:
xbmc.executebuiltin("XBMC.RunScript(script.module.python-milight,action=fadeIn)")
2. contact @CinemaVision-Scott and have them integrate with your plugin.
3. PTVL already has planned integration with CV...
4. One happy family Smile
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#8
(2015-11-09, 20:17)mookfist Wrote:
(2015-11-06, 22:03)Lunatixz Wrote: @mookfist

Code:
<addon id="repository.mookfist" name="Mookfist Repo" version="1.6" provider-name="Mookfist">
    <extension point="xbmc.addon.repository" name="Official PseudoTV Live Repository">
</addon>

Oh really, lol... news to me Tongue

I don't see why we can't get this integrated with PseudoTV Live

oh wow, I'm sorry. I did copy the addon.xml just as a template, I guess I missed a few things. I will fix this right now!

edit: I fixed the XML file but I'll update the ZIP file tonight.

I figured as much, No harm... I appreciate you fixing it, Thank you
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#9
(2015-11-09, 21:25)Lunatixz Wrote: I think you might be over complicating integration... If you want my advice... I would:

1. allow arguments to control light on/off, fade in/out, etc... ie.
Code:
xbmc.executebuiltin("XBMC.RunScript(script.module.python-milight,action=fadeIn)")
2. contact @CinemaVision-Scott and have them integrate with your plugin.
3. PTVL already has planned integration with CV...
4. One happy family Smile

thanks for the input.

I'm not sure how to expose actions yet, but I'm sure I can figure it out. If I'm getting you right, I'm just effectively exposing a simple API and it will be up to plugin to developers such as yourself to figure out the best way to integrate, rather than me figuring out how to integrate, which makes a bit more sense.
Reply
#10
(2015-11-09, 21:56)mookfist Wrote:
(2015-11-09, 21:25)Lunatixz Wrote: I think you might be over complicating integration... If you want my advice... I would:

1. allow arguments to control light on/off, fade in/out, etc... ie.
Code:
xbmc.executebuiltin("XBMC.RunScript(script.module.python-milight,action=fadeIn)")
2. contact @CinemaVision-Scott and have them integrate with your plugin.
3. PTVL already has planned integration with CV...
4. One happy family Smile

thanks for the input.

I'm not sure how to expose actions yet, but I'm sure I can figure it out. If I'm getting you right, I'm just effectively exposing a simple API and it will be up to plugin to developers such as yourself to figure out the best way to integrate, rather than me figuring out how to integrate, which makes a bit more sense.

Yes... you have the idea. Passing arguments is really easy...
http://kodi.wiki/view/HOW-TO:Write_Pytho..._Arguments
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#11
Just wanted to say a big thank you for this plugin. I'm an Emby user, but I use Kodi as my front end, and being able to dim the lights is pretty cool! As an FYI to anyone reading the thread, this plugin works with Mi.Lights, Easybulb and LimitlessLed bulbs as they are all the same thing. Big Grin
Reply
#12
Great plugin so far!

This is on of the reasons, why i bought the milight couple days ago. It´s very good.
I played around with the settings and i can´t get the minimum brightness to work?


My personal feature/ideas list:

1. minimum brightness
2. one more group (with it´s own min brightness)
3. fade speed adjustment
4. support for streams (is there something like "video is playing" information in kodi? / maybe an option for all videos that are played)
5. an option for fast fadeUp if the player is at "pause"? (if you go to toilet or forgot something at the kitchen Big Grin )

Keep up the good work and thank you Smile
Reply
#13
Thanx for this cool plugin.

App works fine on Windows but not on Android Sad.
The Service doesn't start on my Nvidia Shield, Fire TV and Ramos i9 Tablet (Kodi 15.2 and clean install).

Please check my log file HERE

I hope you can fix it.
Reply
#14
Hi All,

Has anyone managed to get the addon working on an openelec system?

I've downloaded the repo and installed the addon, configured it with the wifi bridge IP and port number, set it to enable on both TV and Movie, but when i play video, nothing happens Sad Any suggestions?

One feature request would be to check the time of the day and only turn the lights on if it its after sun set Smile I've had it working on the Pi previously but would be awesome to get a fully integrated solution, rather than a hack!

E Smile
Reply
#15
Hello egvbeeey,

i run it on an raspi2 with openelec 6.0.

I using it with the RGB Controller for led strips (not a bulb). Just the "Lamptyp" RGB+W is working for me. Also after the update from the previous version just a delete and reinstall helped.
Reply

Logout Mark Read Team Forum Stats Members Help
[wip] Milights / LimitlessLED control2