Author Topic: Instructions and Steps to Implement LIFX API  (Read 7504 times)

Offline Quixote

  • Full Member
  • ***
  • Posts: 230
  • Karma: +8/-32
Re: Instructions and Steps to Implement LIFX API
« Reply #60 on: August 13, 2017, 12:19:19 am »
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!
My "Karma" has been modified by 2 or 3 douchebags that didn't like that I criticized the plugin that they worship. I'm not actually a bad person.

Offline Majimus

  • Newbie
  • *
  • Posts: 9
  • Karma: +1/-0
Re: Instructions and Steps to Implement LIFX API
« Reply #61 on: August 13, 2017, 12:37:49 am »
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 https://api.developer.lifx.com/docs/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.

Offline Quixote

  • Full Member
  • ***
  • Posts: 230
  • Karma: +8/-32
Re: Instructions and Steps to Implement LIFX API
« Reply #62 on: August 13, 2017, 12:45:49 am »
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.
My "Karma" has been modified by 2 or 3 douchebags that didn't like that I criticized the plugin that they worship. I'm not actually a bad person.

Offline Majimus

  • Newbie
  • *
  • Posts: 9
  • Karma: +1/-0
Re: Instructions and Steps to Implement LIFX API
« Reply #63 on: August 13, 2017, 01:01:26 am »
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.

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).

Offline Quixote

  • Full Member
  • ***
  • Posts: 230
  • Karma: +8/-32
Re: Instructions and Steps to Implement LIFX API
« Reply #64 on: August 13, 2017, 01:09:33 am »
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
My "Karma" has been modified by 2 or 3 douchebags that didn't like that I criticized the plugin that they worship. I'm not actually a bad person.

Offline Majimus

  • Newbie
  • *
  • Posts: 9
  • Karma: +1/-0
Re: Instructions and Steps to Implement LIFX API
« Reply #65 on: August 13, 2017, 01:13:43 am »
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.

Offline Quixote

  • Full Member
  • ***
  • Posts: 230
  • Karma: +8/-32
Re: Instructions and Steps to Implement LIFX API
« Reply #66 on: August 13, 2017, 01:23:04 am »
Yes, I am using the old script (old being the one that was current until you arrived on the scene  ;) ).
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!
My "Karma" has been modified by 2 or 3 douchebags that didn't like that I criticized the plugin that they worship. I'm not actually a bad person.