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

Offline Quixote

  • Sr. Member
  • ****
  • Posts: 328
  • Karma: +15/-34
Re: Instructions and Steps to Implement LIFX API
« Reply #165 on: April 13, 2018, 01:31:52 am »
Okay,  cool.  Works for me.
 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

  • Full Member
  • ***
  • Posts: 104
  • Karma: +24/-0
Re: Instructions and Steps to Implement LIFX API
« Reply #166 on: April 13, 2018, 01:34:22 am »
Okay,  cool.  Works for me.
 Thanks!

Alrighty, this has used up all my "vera time"  for about a good month  ;D .....have fun.....go easy with the strobes...Later.

Offline Quixote

  • Sr. Member
  • ****
  • Posts: 328
  • Karma: +15/-34
Re: Instructions and Steps to Implement LIFX API
« Reply #167 on: April 21, 2018, 04:05:43 pm »
Alrighty, this has used up all my "vera time"  for about a good month  ;D .....have fun.....go easy with the strobes...Later.

Hey Majimus,
I know you explicitly stated that you've expended more than your share of time on this for a good while (agreed), but I've been investing a lot of time myself recently (albeit not charitably) on setting up a number of elements that are dependent on this plugin and I just wanted to come beg for another feature. It shouldn't be too complicated for someone of your coding caliber (ok, that was admittedly ass-kissing). If you're ever in Montreal, Qc I'll buy you a beer or two.  ;)
I've noticed in the past that there is a variable hidden in the script that dictates the time period over which a scene takes effect, but I have no idea how to use it. I've been hoping to set up my sunrise emulator to make use of this feature that's present in the API but so far I'm at a loss.
What are the chances that you could take a few minutes to look at this and see if it's feasible?
Thanks in advance!

-D
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 mhickey

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
Re: Instructions and Steps to Implement LIFX API
« Reply #168 on: April 22, 2018, 02:15:46 am »
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,

Offline Majimus

  • Full Member
  • ***
  • Posts: 104
  • Karma: +24/-0
Re: Instructions and Steps to Implement LIFX API
« Reply #169 on: April 22, 2018, 02:16:13 pm »
Alrighty, this has used up all my "vera time"  for about a good month  ;D .....have fun.....go easy with the strobes...Later.

Hey Majimus,
I know you explicitly stated that you've expended more than your share of time on this for a good while (agreed), but I've been investing a lot of time myself recently (albeit not charitably) on setting up a number of elements that are dependent on this plugin and I just wanted to come beg for another feature. It shouldn't be too complicated for someone of your coding caliber (ok, that was admittedly ass-kissing). If you're ever in Montreal, Qc I'll buy you a beer or two.  ;)
I've noticed in the past that there is a variable hidden in the script that dictates the time period over which a scene takes effect, but I have no idea how to use it. I've been hoping to set up my sunrise emulator to make use of this feature that's present in the API but so far I'm at a loss.
What are the chances that you could take a few minutes to look at this and see if it's feasible?
Thanks in advance!

-D

Scene devices (should) have a parameter called "SceneDelay" changing this (advanced settings) should get you sorted....sadly I don't envision myself in Montreal anytime soon.

Offline Quixote

  • Sr. Member
  • ****
  • Posts: 328
  • Karma: +15/-34
Re: Instructions and Steps to Implement LIFX API
« Reply #170 on: April 22, 2018, 02:18:58 pm »
Shame. Well, there's no expiry date on that offer.
Thanks for the pointer. Is that "scriptable"? If so, what would be the syntax?
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

  • Full Member
  • ***
  • Posts: 104
  • Karma: +24/-0
Re: Instructions and Steps to Implement LIFX API
« Reply #171 on: April 22, 2018, 03:03:11 pm »
Shame. Well, there's no expiry date on that offer.

I accept gifts... 8)

Now for the business at hand....you should be able to do something like:

Code: [Select]
luup.variable_set("urn:majimus-com:serviceId:Lifx", "SceneDelay", DEVICEID_FROM_VERA, DELAY)
Check in the advanced settings to verify that the value was changed, I have no scenes to test and I'm working on another spare time project atm.

Offline Quixote

  • Sr. Member
  • ****
  • Posts: 328
  • Karma: +15/-34
Re: Instructions and Steps to Implement LIFX API
« Reply #172 on: April 22, 2018, 03:08:39 pm »
I'll check it out this evening and post back with my findings. Thanks again and good luck with your project.
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 Quixote

  • Sr. Member
  • ****
  • Posts: 328
  • Karma: +15/-34
Re: Instructions and Steps to Implement LIFX API
« Reply #173 on: April 22, 2018, 10:17:35 pm »
No luck. The scene delay setting remains at 0.  :(
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

  • Full Member
  • ***
  • Posts: 104
  • Karma: +24/-0
Re: Instructions and Steps to Implement LIFX API
« Reply #174 on: April 23, 2018, 03:35:10 am »
No luck. The scene delay setting remains at 0.  :(

I can confirm that it does not work....the ecosystem is fairly esoteric, the following will work AFTER the next upgrade will leave it here anyways

Code: [Select]
luup.call_action("urn:majimus-com:serviceId:Lifx", "SetSceneDelay", {["newSceneDelayValue"] = "Delay"}, DEVICEID_FROM_VERA)
Will try and upload the new code during the upcoming week (will test for a few days just in case).

Offline Quixote

  • Sr. Member
  • ****
  • Posts: 328
  • Karma: +15/-34
Re: Instructions and Steps to Implement LIFX API
« Reply #175 on: April 23, 2018, 08:18:27 am »
I can confirm that it does not work....the ecosystem is fairly esoteric, the following will work AFTER the next upgrade will leave it here anyways

Code: [Select]
luup.call_action("urn:majimus-com:serviceId:Lifx", "SetSceneDelay", {["newSceneDelayValue"] = "Delay"}, DEVICEID_FROM_VERA)

Very cool, but does this mean that we'll need to have the same setting for every scene? That could be less than ideal for certain situations, for example a scripts that emulate the sunrise by phasing through a few scenes over an hour vs. activating a scene that comes on when "movie mode" is set. It would be strange to wait 20 minutes for the lights to change while the movie plays. I guess I'm just being picky and we could change the setting before activating each scene, but that seems a little rough around the edges.

In any case, I'm very happy for anything you can offer in the way of a solution when time permits! 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

  • Full Member
  • ***
  • Posts: 104
  • Karma: +24/-0
Re: Instructions and Steps to Implement LIFX API
« Reply #176 on: April 23, 2018, 12:48:22 pm »
Very cool, but does this mean that we'll need to have the same setting for every scene? That could be less than ideal for certain situations, for example a scripts that emulate the sunrise by phasing through a few scenes over an hour vs. activating a scene that comes on when "movie mode" is set. It would be strange to wait 20 minutes for the lights to change while the movie plays. I guess I'm just being picky and we could change the setting before activating each scene, but that seems a little rough around the edges.

This setting is per scene (already is this way in current version) and not global for all scenes in fact this has no meaning in the context of the controller (Lifx plugin), the idea here is that the user added the scenes as devices, and as such will make this change to the devices that corresponds to the scene.

If the transition delay for each scene is fixed you can simply go to each scene's advanced settings and make the change. 

If you are running the same lifx scenes with different transition periods within vera scenes what do you suggest would be a more refined approach to doing this? I'm trying to understand the alternative to setting new delay for a lifx scene run.

Will need to open a new thread for this plugin soon so that I put a readme etc etc....it is beyond time for that.

Offline Quixote

  • Sr. Member
  • ****
  • Posts: 328
  • Karma: +15/-34
Re: Instructions and Steps to Implement LIFX API
« Reply #177 on: April 23, 2018, 01:11:20 pm »
If you are running the same lifx scenes with different transition periods within vera scenes what do you suggest would be a more refined approach to doing this? I'm trying to understand the alternative to setting new delay for a lifx scene run.

Ah yes, of course. I failed to notice the "DEVICEID_FROM_VERA" tacked onto the end of that line somehow. Never try to do anything that requires any amount of concentration on 5 hours of sleep.  :o

I think it would be nice if any line of script includes a duration variable that will override the advanced settings of the device (temporarily). So maybe something like:
Code: [Select]
lifx_ctrl("scene_id:XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", "scene", 360)where the 360 at the end indicates the number of seconds over which the transition is performed (with the same option for turning lights on or off, not just scene transitions).

What do you think? Do-able?
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

  • Full Member
  • ***
  • Posts: 104
  • Karma: +24/-0
Re: Instructions and Steps to Implement LIFX API
« Reply #178 on: April 29, 2018, 03:02:55 pm »
If you are running the same lifx scenes with different transition periods within vera scenes what do you suggest would be a more refined approach to doing this? I'm trying to understand the alternative to setting new delay for a lifx scene run.

Ah yes, of course. I failed to notice the "DEVICEID_FROM_VERA" tacked onto the end of that line somehow. Never try to do anything that requires any amount of concentration on 5 hours of sleep.  :o

I think it would be nice if any line of script includes a duration variable that will override the advanced settings of the device (temporarily). So maybe something like:
Code: [Select]
lifx_ctrl("scene_id:XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", "scene", 360)where the 360 at the end indicates the number of seconds over which the transition is performed (with the same option for turning lights on or off, not just scene transitions).

What do you think? Do-able?

Yes, you will need to amend your script and add the duration parameter in the payload section for the scene change.  My recommendation would be to keep the interface standard (use one of the existing params for the duration) and just put placeholder values for parameters that will be ignored when you make the function call.

The plugin update that would allow you to do what I mentioned previously is still under review.

Offline Quixote

  • Sr. Member
  • ****
  • Posts: 328
  • Karma: +15/-34
Re: Instructions and Steps to Implement LIFX API
« Reply #179 on: April 29, 2018, 03:11:43 pm »
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
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.