Page 1 of 12

Autolog LIFX Controller Discussion

PostPosted: Sun Jun 22, 2014 4:02 am
by autolog
Please use this thread for any suggestions or questions on the Autolog 'LIFX Controller' Plugin that I have just started to develop :)

I am currently testing out options on how to make this work. I can already control my LIFX lamp from an action group as part of this testing. At the moment I only have one lamp to test with but I have ordered some more now which will help with my testing.

I will keep this thread posted on progress and post an announcement when the plugin is available.

Re: Autolog LIFX Controller Discussion

PostPosted: Sun Jun 22, 2014 5:00 am
by durosity
Excellento, I'm looking forward to this.. I've been considering some lifx bulbs and this might be just what the doctor ordered... Now if only indigo touch had some way of displaying a colour chart in a pop up ;)


Sent from my iPad using Tapatalk

Re: Autolog LIFX Controller Discussion

PostPosted: Sun Jun 22, 2014 10:18 pm
by manwithavan
Kudos autolog! Bringing a warm white glow to my neural circuitry. :)


Sent from my iPad using Tapatalk

Re: Autolog LIFX Controller Discussion

PostPosted: Mon Jun 23, 2014 11:29 am
by Indy_Larry
This is GREAT news. I currently have 2 Lifx bulbs and would really like to have them working with Indigo.


Sent from my iPad using Tapatalk

Re: Autolog LIFX Controller Discussion

PostPosted: Mon Jun 23, 2014 2:22 pm
by autolog
I have started coding the plugin having finished my initial testing. :D

I am starting off by having two device types: A LIFX lamp and a LIFX preset (which will contain the values for Hue, Saturation and Brightness). As there isn't an easy way to set the colours (i.e. no colour sliders etc in Indigo) I though the easiest way would be to define a preset by saying save the current state of a lamp to a preset. That means the LIFX iPhone App can be used to set the required state and then an action can be run to save a preset. The plugin will provide an action to select a lamp and apply a preset to it. I also intend that the basic values of Hue, Saturation and Brightness can also be set by the plugin.

While not ideal, the plugin requires that Ruby 2.0 is installed so the lifx-http server can be run which the plugin communicates with. In the fullness of time and if and when an osx api is available then this could be changed.

I have some new lamps arriving Wednesday which will enable me to more easily test how to handle multiple lamps. :)

Re: Autolog LIFX Controller Discussion

PostPosted: Tue Jun 24, 2014 12:32 am
by manwithavan
Brilliant!


Sent from my iPad using Tapatalk

Re: Autolog LIFX Controller Discussion

PostPosted: Tue Jun 24, 2014 11:13 am
by autolog
Here is a quick update on progress :)

The basic plugin framework is in place and I can now toggle my LIFX Lamp on and off. I can also set the colour. All from Indigo Touch :D

The Plugin automatically defines devices for any LIFX Lamps it finds. At the moment I have only tested with one lamp. I get two more tomorrow (they have arrived at the store - I just need to go and pick them up).

Next steps that I have planned at the moment are to:
  • finish off the additional actions for lamp control
  • add in any functionality required for multiple lamps
  • set-up thread control sub-processing for the lifx-http server (at the moment I am running it in a terminal session)
  • code the Preset processing
  • do some documentation - how to install and basic running

Once it is in a reasonable state (maybe within a week or sooner), I will release it as an Alpha test version.

Re: Autolog LIFX Controller Discussion

PostPosted: Tue Jun 24, 2014 11:39 am
by Indy_Larry
I'm sure you've already seen this but the bulb have a firmware update.

http://updates.lifx.co


Sent from my iPad using Tapatalk

Re: Autolog LIFX Controller Discussion

PostPosted: Tue Jun 24, 2014 12:00 pm
by autolog
Indy_Larry wrote:
I'm sure you've already seen this but the bulb have a firmware update. ...

I hadn't - Thanks for the heads-up - I'll put it to the top of my to-do list :)

Re: Autolog LIFX Controller Discussion

PostPosted: Sat Jun 28, 2014 11:54 am
by autolog
Quick update on progress:

1. Additional LIFX bulbs acquired, firmware updated and all working OK
2. As anticipated, using multiple bulbs highlighted problems with the plugin code.
3. However, that is all now sorted and the following functions seem to be working:
  • LIFX Status
  • Turn On LIFX Lamp
  • Turn Off LIFX Lamp
  • Toggle LIFX Lamp On/Off
  • Color Set
  • Hue Set
  • Saturation Set
  • Brightness Set
  • Kelvin Set
  • Apply Preset
  • Define Preset

Presets are created and updated in Indigo Variables - allowing any number (within reason) to be defined.

The Plugin is probably fairly near a version that can be released for Alpha Testing. Over the next few days I will put together some documentation and upload a version that can be tested :)

Re: Autolog LIFX Controller Discussion

PostPosted: Sat Jun 28, 2014 1:44 pm
by Indy_Larry
Great work. I guess I'll have to wait until after vacation before I can DL it and try it out.

Re: Autolog LIFX Controller Discussion

PostPosted: Sun Jun 29, 2014 11:14 am
by autolog
Download now available - see announcement :)

Re: Autolog LIFX Controller Discussion

PostPosted: Sun Jun 29, 2014 8:03 pm
by Indy_Larry
Hi Autolog,

Thanks for getting this plugin up and going. I have installed the plugin but it does not show my bulbs (I have 2) individually, I just see "all bulbs". Also I'm not able to control the bulbs with triggers or action groups.

I have reloaded the plugin
I have reset both Lifx bulbs

Jun 29, 2014, 9:40:56 PM
Enabling plugin "Autolog LIFX 0.1.0"
Starting plugin "Autolog LIFX 0.1.0" (pid 5283)
Started plugin "Autolog LIFX 0.1.0"
Autolog LIFX Autolog 'LIFX Controller' initializing
Autolog LIFX Initialising LIFX Command thread for 127.0.0.1:56780 [lifx-http]
Autolog LIFX LIFX Command thread initialised for 127.0.0.1:56780 [lifx-http]
Autolog LIFX Started 'All: LIFX Lamps': 'ALL'
Autolog LIFX Started 'All: LIFX Lamps': 'ALL'

Again thanks for your work on getting this plugin developed and sharing it with everyone.

Re: Autolog LIFX Controller Discussion

PostPosted: Mon Jun 30, 2014 12:00 am
by autolog
For some reason it isn't detecting any of your lamps. The 'All: LIFX lamps' gets added in by default assuming that lamps will be found - I will maybe need to change how this works in a future version to avoid confusion. Also the custom states for 'All: LIFX lamps' and 'Group: ...' lamps don't mean anything - I will alter this as well.

I will have to enhance the error reporting and debugging to determine what is going on.

As an initial step, can you check that lifx-http is working correctly as detailed in the LIFX-HTTP API web-page.

I suggest the following steps:
  1. Disable my plugin
  2. Open a terminal window and enter 'lifx-http' - the server should start
  3. Open another terminal window and enter 'curl http://127.0.0.1:56780/lights.json' - your lights should be listed

If you can post back the results of the curl command then I can see if it highlights anything.

In the meanwhile I will improve the error checking - this may take a few days :)

Re: Autolog LIFX Controller Discussion

PostPosted: Mon Jun 30, 2014 2:36 am
by autolog
I found the problem - I had temporarily disabled the call to the LIFX-HTTP server :oops:

This meant it would never work on another system with a fresh install. It worked on mine because I had the LIFX-HTTP running in a terminal window as I was debugging some code.

Hopefully it will work now :)