Instructions and Steps to Implement LIFX API

Thanks for the files and directions. I managed up until the point where I need to add the ID for the light I’m trying to control. The only way I succeed at controlling a light is by entering “group:xxxxxxxxxx” (without quotes) into the ID field, because I’m not sure where to find the ID of the individual light.

I like the idea of a parent->child setup and it makes a lot more sense to me. It would be great if there were a way to have all of the steps involved in creating each new device handled by the plugin somehow since I have 9 bulbs at present and plan on buying another 6 to 10 in the future. Not sure what to do about those that choose to use more than one token, but I’m quite certain that cases like that are fairly rare. In fact, I can’t think of one reason why someone would want to generate multiple tokens to use on the same Vera.

My first request would be an additional control field for duration that allows us to enter a number in seconds for the transition duration. I believe the groundwork was already integrated in the original code posed in this thread, but I was never able to figure out how to use it.

Thanks again!

Sorry about that, the automation is on the TODO list. I kinda assumed that everyone in this thread had their id’s etc.

You can go to List Lights and in the “Try it out” section you put “all”. That will give you a list of all your lights and their id’s.

For the next update will automate this part of it.

Nice. No need to apologize! I had done that many months ago, but it’s difficult to remember the all of the steps involved. Thanks.

While I’m here, I thought of another request that would be handy – the ability to activate scenes. Using the original code, I’m able to use the syntax:
lifx_ctrl(“scene_id:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx”, “scene”)
Coupled with a duration feature (if that’s even possible) it would be very powerful. I have several scenes that I time to emulate a sunrise and a set for the sunset, but the changes are very abrupt and it sort of ruins the effect I’m going for. Those 2 abilities would solve that and more.

[quote=“Quixote, post:63, topic:191679”]Nice. No need to apologize! I had done that many months ago, but it’s difficult to remember the all of the steps involved. Thanks.

While I’m here, I thought of another request that would be handy – the ability to activate scenes. Using the original code, I’m able to use the syntax:
lifx_ctrl(“scene_id:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx”, “scene”)
Coupled with a duration feature (if that’s even possible) it would be very powerful. I have several scenes that I time to emulate a sunrise and a set for the sunset, but the changes are very abrupt and it sort of ruins the effect I’m going for. Those 2 abilities would solve that and more.[/quote]

I can think of a few elegant ways to do that but it will take time, since you appear to be familiar with and using the original script I can modify it to do what you wish to do.

I don’t know if my copy is the most updated, send me a copy (remove your api key [best practices])…and I should be able to create an amended version that will add a delay to the scene (that will be much quicker, maybe even tomorrow).

No rush… I just moved so I’m still installing light fixtures, etc.
It will be some time before I install many of the most important lights because I have a lot to organize here first.

I don’t have any special files here. The only update I used was the one available in the first post of the thread, so it would be simpler for you to grab it there if you don’t have an up-to-date set of files.

By delay, you mean a slow transition, correct? I know that the Android app has the ability to turn on a scene over a duration when you hold down the scene and select the time-frame, so it should be possible using the API.

Thanks

Yes, I’m referring to the transition delay for the lifx scene change. I thought you were using the old script, in that case I will put it on the list of things to do.

Yes, I am using the old script (old being the one that was current until you arrived on the scene :wink: ).
I do use the app as well though because I have yet to find a Zwave option that functions properly with the Vera that would give me the same flexibility as the app, or at least basic functionality even. I had high hopes for the Aeotec Wallmote Quad, but I don’t believe Mi Casa Verde has added it to their list of devices with full functionality yet.

Anyway, I’ll be following your progress as you find time to enhance your plugin. Keep up the great work and have a nice weekend!

This is so awesome!!!
I have been waiting for this for ages.

HOT TIP: you can use “group_id:xxxx” “scene_id:xxxxxx” etc instead of “id:xxxxx” to control a room from one switch

[quote=“lfairbank, post:68, topic:191679”]This is so awesome!!!
I have been waiting for this for ages.

HOT TIP: you can use “group_id:xxxx” “scene_id:xxxxxx” etc instead of “id:xxxxx” to control a room from one switch[/quote]

I know, right? This is this best way to use these bulbs so far (without putting an open-mic, internet connected bug in your home).
I figured out the scenes thing and posted instructions back in post #52 of this thread.

Uploaded a new plugin that now allows you to dynamically add all your lights and scenes from a parent device. TLDR; Add lights and Lifx Scenes to your vera with no tinkering.

[url=https://github.com/majimus/majimusLifx]https://github.com/majimus/majimusLifx[/url]

This is not compatible with the previous version I would recommend removing the previous devices before using this. If you are happy with the previous code feel free to keep using it since this version is less tolerant of manual changes.

Scenes and Lights are supported but not groups (coming soon). Also if anyone wants to donate an Icon for the parent feel free, I’m using the scene icon from vera.

if you are using groups and are having a blast manually editing the ID’s you will probably be better with the previous version for now.

Contributions are welcome (even if it’s the readme). The instructions for this version would be:
-remove the old devices
-upload the files (except the Readme)
-Manually add a new device with device_type “urn:schemas-majimus-com:device:LifxParent:1” , device_file “D_MajimusLifx_P.xml” , implementation_file “I_MajimusLifx.xml” and device_file “D_MajimusLifx_P.json”.

Once you have added your device, put in your api key in the settings and you can list and sync lights and scenes.

As always this is very Beta (may have errors) and work in progress , only for UI7. Unchecking an installed device (light or scene) and syncing will REMOVE the device from your vera

Feedback appreciated.

Nice!
I’ll give this a shot tomorrow when I’m more awake and able to focus.
I’d like to contribute more, but I’m not a programmer. However, I do have plenty of experience in design and I’d be more than happy to create any icons you need. I could even build templates so that we can have indicators that reflect different bulb states if that suits you.
Let me know, and thanks for your efforts

Something simple, the letter LIFX in two rows in a square?

Found these on google for inspiration.

I vote for the last one.

I can recreate that logo and experiment with different colors, as long as we won’t be breaking any copyrights or anything. I’ll have to take care of that sometime in the next three days because I have a lot lined up at the moment.
What resolution and image size must the logos be?

The plugin icons are 50x50 png’s.

I’ve uploaded another update to GitHub and also attached the files. This update adds support for groups.

Using LIFX’s cloud API works well for my needs so I probably won’t put too much focus on controlling the lights directly (LAN), however if someone would be willing to undertake that then I’m happy to help.

If you notice anything not working as expected do let me know.

UI5 icons are 50px X 50px…

UI7 icons are 60px X 60px…

The WiFi/UDP Sitch controller ([url=http://forum.micasaverde.com/index.php/topic,50722.0.html]http://forum.micasaverde.com/index.php/topic,50722.0.html[/url]) plugin already provides local control of LIFX, ECO, SengLED and TP-Link devices.

This is awesome, maybe we can route some commands through your plugin?

This is awesome, maybe we can route some commands through your plugin?[/quote]

Maybe you could ask the plugin developer if you could use some of his code and give him credit for it somewhere? It would be nice to keep plugin installations to a minimum in order to keep things clean and efficient.

Thanks for the revision! Have you had the opportunity to look at the transition change duration?

I’ll have those images for you tonight by the way.