Release Integration plugin - LIFX Theater experience
#1
Lightbulb 
Hello folks!

A friend of mine requested me to develop a basic scrip based on the Lifx api to ingratiate the bulb with xbmc/kodi.

The plugin features several predefined lighting settings:
1.Blue* blinks when library is updated on the first run then light returns to previous setting. (*Default color of xbmc interface)
2.Gradually fade out when movie starts playing.(2 seconds dimming time)
3.Gradually fade in to medium brightness when paused (30% brightness in 2 seconds time).
4.Gradually fade in full brightness when movie ends/stopped.


This Plug-in is based on the awesome work done by Arrian Purcell


Download
Google Drive Folder


How to install
XBMC Wiki


Tested and it works with the latest lifx firmware 1.5 & windows 7
Reply
#2
I get the following error in OSX:

Error Type: <type 'exceptions.Exception'>
Error Contents: Handshake timed out.
Traceback (most recent call last):
File "/Users/Username/Library/Application Support/Kodi/addons/service.YazeedKodiLIFX/service.py", line 11, in <module>
lights = lifx.Lifx()
File "/Users/Username/Library/Application Support/Kodi/addons/service.YazeedKodiLIFX/lifx/lifx.py", line 11, in __init__
self.network = Network()
File "/Users/Username/Library/Application Support/Kodi/addons/service.YazeedKodiLIFX/lifx/network.py", line 27, in __init__
self.connect()
File "/Users/Username/Library/Application Support/Kodi/addons/service.YazeedKodiLIFX/lifx/network.py", line 57, in connect
raise Exception('Handshake timed out.')
Exception: Handshake timed out.

Doesn't seem to connect, anyway to fix this?
Reply
#3
I bought my first LIFX bulb today, installed your add-on and it worked as described. Well done and thanks for sharing.

I then updated the firmware on the bulb (from v1.1 to v1.5) and the add-on no longer works. Hopefully this helps to diagnose what needs to be amended. Good luck, can't wait to get it integrated again :-)
Main TV: LibreELEC 7.0.1 / Kodi 16.1, with Xonfluence skin on Asus Chromebox (1.4GHz, 4Gb RAM, 64Gb SSD) + DVB-S and DVB-T with TVH.
Plus testing v17 nighlies on Macbook, and using Estuary skin.
Reply
#4
(2015-01-11, 15:26)IIINeOIIINL Wrote: I get the following error in OSX:

Error Type: <type 'exceptions.Exception'>
Error Contents: Handshake timed out.
Traceback (most recent call last):
File "/Users/Username/Library/Application Support/Kodi/addons/service.YazeedKodiLIFX/service.py", line 11, in <module>
lights = lifx.Lifx()
File "/Users/Username/Library/Application Support/Kodi/addons/service.YazeedKodiLIFX/lifx/lifx.py", line 11, in __init__
self.network = Network()
File "/Users/Username/Library/Application Support/Kodi/addons/service.YazeedKodiLIFX/lifx/network.py", line 27, in __init__
self.connect()
File "/Users/Username/Library/Application Support/Kodi/addons/service.YazeedKodiLIFX/lifx/network.py", line 57, in connect
raise Exception('Handshake timed out.')
Exception: Handshake timed out.

Doesn't seem to connect, anyway to fix this?

I'm sorry to hear that. This add-on should work in all environments.
I'll investigate more about what could be the problem, and i'll update the the version to support MAC.

(2015-01-21, 00:15)gshodg Wrote: I bought my first LIFX bulb today, installed your add-on and it worked as described. Well done and thanks for sharing.

I then updated the firmware on the bulb (from v1.1 to v1.5) and the add-on no longer works. Hopefully this helps to diagnose what needs to be amended. Good luck, can't wait to get it integrated again :-)

I'm happy that you liked it :-)

Could you please share your XBMC logs in order to diagnose the problem?
Reply
#5
Works with Lifx 1.1 and not 1.5 since I have a bulb that wont update I found that out. Don't know how to enable debugging
Reply
#6
Hiya Sultan et Al..

As one of the kickstarters for lifx i've been wanting to do this for 2 years but never had the coding prowess to figure it out! Very happy to have found this!

Only thing is I have 12 Lifx bulbs, but only one seems to react to XBMC integration! Is there a config somewhere that I am missing?

Thanks!
Reply
#7
(2015-02-09, 23:11)theCheek Wrote: Hiya Sultan et Al..

As one of the kickstarters for lifx i've been wanting to do this for 2 years but never had the coding prowess to figure it out! Very happy to have found this!

Only thing is I have 12 Lifx bulbs, but only one seems to react to XBMC integration! Is there a config somewhere that I am missing?

Thanks!

All 12 bulbs should be in the same network as your PC running XBMC.
Reply
#8
(2015-02-10, 08:11)SultanMA Wrote: All 12 bulbs should be in the same network as your PC running XBMC.

Yep that's how its set up. All bulbs connected to the only router in the house, which also handles the ethernet connected devices (xbmc on openelec).

Perhaps its something to do with the new firmware 2.0, with lights now being controlled via the cloud and not the local network? This doesn't quite explain why just 1 bulb works now!

Let me know what you need from me to help the bugfix. Thanks mate!
Reply
#9
Awesome..

I only just found this but I've not actually tested it yet (not at home).. however just having a quick look into the code.. is there a way of finding out the "name" of the group of bulbs you want it to effect.. and possibly add some user defined settings and such so the lights can be customised not just hard coded.

Mostly I don't want ALL the lights to be effected in the whole house I just want the living room lights to dim and or turn back on etc. Could kinda be sucky for everyone else in the house.
Reply
#10
Just got home and tried to test it.. and yes I'm having the same issue.. only one light is effected when you press play on Kodi and lucky me it's out in the other room... so kinda un-helpfull lol.
Reply
#11
I think it has to do with the most recent update, as Lifx has now disabled the mesh networking of the bulbs. Looking at my router, I see that all 12 bulbs are connected to the router via wifi. Before it used to be 1 or 2 'gateway' bulbs, which then connected the other bulbs via mesh. I could obviously be wrong about this but just a theory.

Update: looks like my suspicions are correct, based on the LifxTend apps' author's comments on firmware version 2.0:

http://blog.striking.ch/archives/207-Som...e-2.0.html
Reply
#12
Understand.. can you think of any way to improve / correct the script? -- besides waiting 12 months for LIFX to get a new API out?
Reply
#13
This is great, but I am not a fan of the bulb 'states'.

The bulb returns an ugly milky orange colour and nowhere near full brightness for me, and I would prefer a very dim state rather than off for when the movie is playing.

Is there a guide on what to edit in the service.py file to set the bulb 'states' to your own preference?
Reply
#14
For anyone interested.. I'm rewriting the code fot he new API which is seeming to work pretty well.. Hitting a few snags.. but I'll put something up soon.
Reply
#15
I'm interested.

Thanks.
Reply

Logout Mark Read Team Forum Stats Members Help
Integration plugin - LIFX Theater experience1