Instructions and Steps to Implement LIFX API

Ok, well I’m confident that whatever you think is best will work out better since you have a much deeper understanding of how this works, obviously.
So if we are running the same lifx scenes with different transition periods within Vera scenes, we would just include a line to change the variable that dictates the scene change duration before the command to execute the LIFX scene (or as I understand now, “device”) and then include a line at the end to return the variable to its previous value before the script ends?
Thanks

[quote=“Quixote, post:180, topic:191679”]Ok, well I’m confident that whatever you think is best will work out better since you have a much deeper understanding of how this works, obviously.
So if we are running the same lifx scenes with different transition periods within Vera scenes, we would just include a line to change the variable that dictates the scene change duration before the command to execute the LIFX scene (or as I understand now, “device”) and then include a line at the end to return the variable to its previous value before the script ends?
Thanks[/quote]

Alright, that sounds a little convoluted.

I will modify the script, won’t test it though (fairly harmless change) so someone will have to take the plunge (harmless is in the eyes of the beholder).

Best…

This will work in the following way:

lifx_ctrl("scene_id:XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", "scene", nil, nil, nil, DURATION)

the last parameter will control the duration…very much aware of the dire need for a new thread with updated instructions and usage guidelines etc etc.

Excellent! Thanks for taking care of that so quickly. Just in the middle of installing a bunch of recessed lights at the moment (to take advantage of my new LIFX abilities ;)), but I’ll try that file out tonight for sure!
Maybe I’ll set up a bunch of scripts for my wake up routine tomorrow morning and put it through the gauntlet. I’ll let you know how it goes.

One of these days soon I’ll go through the 13 pages of this thread and collect all of the important stuff, then I’ll see if there is anything I can add to that, send it to you for your review and you can post it in a new thread. Maybe we can request that the post is “stickied” while we’re at it.

Take care!

Unfortunately, it’s not working for me.
I’ve uploaded the new file, changed the syntax of my script and rebooted the Vera. The scene says that it’s been executed successfully, but I see no results.

I will check later…so I’ve tested the code and it works, what did you do?

example usage is:

lifx_ctrl(“scene_id:xxxxx-xxx-xxxx-xxxx”, “scene”, nil, nil, nil, 3)

I’ve created a new topic for the plugin

[url=http://forum.micasaverde.com/index.php/topic,80853.0.html]http://forum.micasaverde.com/index.php/topic,80853.0.html[/url]

We can take up further discussion over there, not having access to the first post makes it hard to consolidate information.

maj…

[quote=“mhickey, post:169, topic:191679”]I have been using the lifx_ctrl plugin for some time. Mine stopped working a few weeks ago for no apparent reason. Specifically just turning lights on. Turing off and toggle seems fine. I suspect a change in API. Sounds like I am not alone reading Ifairbank and Quixote posts.

I was pleased to see the development work from Majimus (thank you for your efforts!) and installed the V0.7 plugin. Happy with the result, just not sure how to configure the colours/whites to be specific? ie. With the lifx_ctrl I could specify 2750K white colour temperature. Is there a way I can get this type of control in my scenes?

Thanks,[/quote]

Did you ever figure out the “turning on” problem? I just installed the script… a bit confused about the actual plugin though. Like you, I’m able to luup code turning off a light. Can’t get it to turn on though.

What about the plugin confuses you?

It doesn’t show up in the devices list. The older plugin says “Lifx starting…” or something like that. No devices show up after installing either plugin. I got the lifx_ctrl script to work… but only to turn off a light. Can’t seem to turn it on.

Oh wait! I’m reading the new thread and didnt see the 3 updated files. I’ll try that!

ok nevermind. Luup code to turn on light still doesnt work. plugin is not showing up. Yeah Im a bit confused. Is the plugin only for UI7?

EDIT
Ok I see Lifx Plugin shows up in advance scene editor (after reading some more, my fault). But there are really no options for actual control of the lights. Im rebooting the vera right now.

The plugin is only for UI7, that is all I have to test. I don’t know if/how it will work for you.

The plugin is a totally separate entity from the scripts that I tried to update and keep going for the other folks…they have nothing to do one with the other. I assume that the scripts are working fine, else someone would have complained already.

Ahh I see. The script works. I just can’t get the “on” function to work. Somebody else had the same issue on this thread. He mentioned Lifx might have changed somethings in the API. I tried different strings in their API and still can’t get “on” to work. “off” works though. Thanks, I’ll try the plugin in a UI7 box.

This plugin is broken and the new thread has not been migrated to this forum.
Specifically, pulsing/breathing lights through a script no longer functions as of last week or maybe the week before that. What has changed?
Yet another reason to ditch the Vera ASAP.

Quixote,

Yes the plugin was broken and while I use the it daily most folks here have a far more advanced usage than me. I noticed a few glitches but thought it was transient, finally looked into it last weekend and resolved a number of issues.

The new thread was migrated and can be found here

I almost didn’t bother to publish any fixes because I went to the new thread and didn’t see any complaints and assumed that no one used this thing anymore.

The plugin is community driven in the sense that I wanted to use Lifx and there was no support so I wrote a plugin. As a third party community developer the ground is often moving beneath me and it is not unheard of that something happens that breaks the existing code. I’ve made several updates to the plugin over the weekend and will upload a new version of “the script” so that everyone else can keep going.

The Vera/MIOS/EzLo folks have gone through a transition and there is still a bit of confusion, up to this point I have not touched my vera in a very long time (it just works). Yes it took me a very long time (and many many lines of custom code) to get to that point but the thing just works so far.

I do strongly dislike the new forum and the change-over has been poorly executed at best.

-Majimus

Hi! Long time, no see! Glad you are still with us. I’ve been away, sulking, but noticed your post.
I’m thankful that you’ve adapted your plugin and I will be trying it as soon as I have a chance. To be honest, it is one of the few plugins that I use, and I consider it definitely one of, if not THE most important one. In fact, I almost went and bought an Intel NUC just to migrate to Homeseer after my LIFX scripts failed.
Thanks for getting back to me.

I did some testing on the lua code and not had success in getting it to work. Not sure where the issue is. I can communicate and control the lifx via os.execute or using curl on the commandline, so is something to do when executing in luup.

Example works:
os.execute(‘curl -k -u “TOKEN:” -X POST -d “cycles=7” -d “power_on=true” -d “persist=false” -d “color=red” -d “period=0.2” “https://api.lifx.com/v1/lights/all/effects/breathe”’)

Ah … found an issue and will have an update to the lua code. Needed to add support for tls v1.2. Will need to do more testing.

update: found a couple other minor issues that I fixed. Everything seems to working well. I’ll be working on the lua code and will post an update.

Joe

Since not able to edit my original post any longer I’ve moved here to continue on: Instructions and Steps to Implement LIFX API - Part II - Lighting & Load Control - Ezlo Community