We have moved at community.getvera.com

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

Offline Quixote

  • Sr. Member
  • ****
  • Posts: 350
  • Karma: +18/-35
Re: Instructions and Steps to Implement LIFX API
« Reply #150 on: April 13, 2018, 12:07:17 am »
Wow, that was fast!  You're a wizard!
Thanks for hooking us up. I'll try it now.
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. (I guess I'm "Chaotic Neutral").

Offline lfairbank

  • Newbie
  • *
  • Posts: 12
  • Karma: +1/-0
Re: Instructions and Steps to Implement LIFX API
« Reply #151 on: April 13, 2018, 12:15:13 am »
Here we go, a few lil changes here and there....as before, you need to put your token in the file BEFORE uploading it to your wonderful vera.

....have a fun time!!

My Man!!! works like a charm

Offline Majimus

  • Full Member
  • ***
  • Posts: 119
  • Karma: +26/-0
Re: Instructions and Steps to Implement LIFX API
« Reply #152 on: April 13, 2018, 12:18:36 am »
Good times gentlemen......good times

Offline Quixote

  • Sr. Member
  • ****
  • Posts: 350
  • Karma: +18/-35
Re: Instructions and Steps to Implement LIFX API
« Reply #153 on: April 13, 2018, 12:21:43 am »
Excellent. My notifications are back up and running and scripted color changes work perfectly. I can't find which scenes have scripted scene changes because I have too many to go through, but I'm confident that it's going to work without a hitch.

Thanks again --  we owe you!!

Edit:
Scene activation functionality verified. Just to reiterate for those that don't want to read 10 pages of posts, the syntax is:
lifx_ctrl("scene_id:XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", "scene")
You can find your list of scenes here after pasting your API key in at the bottom, under "try it out":
https://api.developer.lifx.com/docs/list-scenes
« Last Edit: April 13, 2018, 12:35:39 am by Quixote »
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. (I guess I'm "Chaotic Neutral").

Offline Quixote

  • Sr. Member
  • ****
  • Posts: 350
  • Karma: +18/-35
Re: Instructions and Steps to Implement LIFX API
« Reply #154 on: April 13, 2018, 01:05:26 am »
May have found an error.
When using "Pulse", the scripts don't seem to be able to flash the lights quickly (ie.- 0.1), whereas when I try it on the LIFX developer site I can have them basically strobe.
Is this an accidental limitation?
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. (I guess I'm "Chaotic Neutral").

Offline Majimus

  • Full Member
  • ***
  • Posts: 119
  • Karma: +26/-0
Re: Instructions and Steps to Implement LIFX API
« Reply #155 on: April 13, 2018, 01:12:29 am »
there is no modification of your values, what happens when you put 0.1?

Offline Quixote

  • Sr. Member
  • ****
  • Posts: 350
  • Karma: +18/-35
Re: Instructions and Steps to Implement LIFX API
« Reply #156 on: April 13, 2018, 01:13:49 am »
It just pulses at around once per second.
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. (I guess I'm "Chaotic Neutral").

Offline Majimus

  • Full Member
  • ***
  • Posts: 119
  • Karma: +26/-0
Re: Instructions and Steps to Implement LIFX API
« Reply #157 on: April 13, 2018, 01:14:53 am »
does it pulse slower than 1 second i.e 2 seconds? already deleted the script from my vera.

Offline Quixote

  • Sr. Member
  • ****
  • Posts: 350
  • Karma: +18/-35
Re: Instructions and Steps to Implement LIFX API
« Reply #158 on: April 13, 2018, 01:18:17 am »
No. It seems that regardless of the first parameter it will pulse at approximately once per second.
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. (I guess I'm "Chaotic Neutral").

Offline Majimus

  • Full Member
  • ***
  • Posts: 119
  • Karma: +26/-0
Re: Instructions and Steps to Implement LIFX API
« Reply #159 on: April 13, 2018, 01:19:27 am »
can you paste the the call to the script? The last parameter defines your period....

« Last Edit: April 13, 2018, 01:26:33 am by Majimus »

Offline Quixote

  • Sr. Member
  • ****
  • Posts: 350
  • Karma: +18/-35
Re: Instructions and Steps to Implement LIFX API
« Reply #160 on: April 13, 2018, 01:22:31 am »
Certainly.  Originally the code was:

lifx_ctrl("group:Bedroom", "pulse", "green",0.2,5,1)

but this doesn't work with a longer pulse cycle either:

lifx_ctrl("group:Bedroom", "pulse", "green",3,5,1)

Both are identical in their performance.
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. (I guess I'm "Chaotic Neutral").

Offline Majimus

  • Full Member
  • ***
  • Posts: 119
  • Karma: +26/-0
Re: Instructions and Steps to Implement LIFX API
« Reply #161 on: April 13, 2018, 01:25:57 am »
Certainly.  Originally the code was:

lifx_ctrl("group:Bedroom", "pulse", "green",0.2,5,1)

but this doesn't work with a longer pulse cycle either:

lifx_ctrl("group:Bedroom", "pulse", "green",3,5,1)

Both are identical in their performance.

 Usage is as follows lifx_ctrl(selector, mode, color, bright, cycles, period)  FYI bright is not a parameter of the pulse and breathe (AFAIK) so this value will be ignored for those features, but you MUST put something there.
« Last Edit: April 13, 2018, 01:29:07 am by Majimus »

Offline Quixote

  • Sr. Member
  • ****
  • Posts: 350
  • Karma: +18/-35
Re: Instructions and Steps to Implement LIFX API
« Reply #162 on: April 13, 2018, 01:27:31 am »
AAArrrgh!
Thanks for clearing that up.   :-[
What about persistence?
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. (I guess I'm "Chaotic Neutral").

Offline Quixote

  • Sr. Member
  • ****
  • Posts: 350
  • Karma: +18/-35
Re: Instructions and Steps to Implement LIFX API
« Reply #163 on: April 13, 2018, 01:29:41 am »
"persist:
booleanfalse

If false set the light back to its previous value when effect ends, if true leave the last effect color.
"
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. (I guess I'm "Chaotic Neutral").

Offline Majimus

  • Full Member
  • ***
  • Posts: 119
  • Karma: +26/-0
Re: Instructions and Steps to Implement LIFX API
« Reply #164 on: April 13, 2018, 01:30:33 am »
AAArrrgh!
Thanks for clearing that up.   :-[
What about persistence?

Persistence is hard-coded in the script...