Autolog LIFX Controller Discussion

[email protected]
Posts: 3
Joined: Fri Apr 15, 2016 1:23 pm

Re: Autolog LIFX Controller Discussion

Post by [email protected] »

I have a LIFX in a room where the manual switch is normally used to turn the light on/off. Indigo is able, via the Autolog LIFX Controller plugin, to control the bulb. However, what I am trying to do is change the color of the bulb after it has been on for 5 minutes, then after another 2-3 minutes to dim it 50%. This works if the bulb is turned on/off via Indigo or even the LIFX app. But when the LIFX is turned off by the manual switch Indigo only sees the last status of 'ON'.

Is it possible to automatically mark the bulb as off, or maybe even offline, after X polls with no response? Is this already there and I a missing something?

Charles
autolog
Posts: 4077
Joined: Tue Sep 10, 2013 3:07 am
Location: West Sussex, UK
Contact:

Re: Autolog LIFX Controller Discussion

Post by autolog »

Hi Charles,
[email protected] wrote:... Is it possible to automatically mark the bulb as off, or maybe even offline, after X polls with no response? Is this already there and I a missing something?
You aren't missing anything, the plugin doesn't handle that situation and I agree that it should.

I will see what I can do to introduce that, probably set the LIFX lamp to off and mark as offline would be good, I think. :)

I am sorting out another of my plugins at the moment, when I have finished doing that I will take a look at this - will probably be another week or so.
[email protected]
Posts: 3
Joined: Fri Apr 15, 2016 1:23 pm

Re: Autolog LIFX Controller Discussion

Post by [email protected] »

Jon,

I don't want to bug you, but I did want to follow up to see if you have had a chance to look at adding that feature?

Charles
autolog
Posts: 4077
Joined: Tue Sep 10, 2013 3:07 am
Location: West Sussex, UK
Contact:

Re: Autolog LIFX Controller Discussion

Post by autolog »

Hi Charles,
[email protected] wrote:... I don't want to bug you, but I did want to follow up to see if you have had a chance to look at adding that feature? ...
I had forgotten I had said I was going to look at this :oops:

So, I took a quick look at it and it was easier than I anticipated and so I have done the coding and some testing and have just uploaded a new version (v3.5.0) that you can try out to see if that gives you what you are looking for?

Let me know how you get on. :)
autolog
Posts: 4077
Joined: Tue Sep 10, 2013 3:07 am
Location: West Sussex, UK
Contact:

Re: Autolog LIFX Controller Discussion

Post by autolog »

I started to use the revised version and decided that it could do with a new device state to aid triggering and conditions - see the updated post for the new version: LIFX Controller (V3.5.1) Information :)
User avatar
manwithavan
Posts: 76
Joined: Tue Jan 14, 2014 5:22 am
Location: Melbourne Australia

Re: Autolog LIFX Controller Discussion

Post by manwithavan »

Download link seems to be broken.
autolog
Posts: 4077
Joined: Tue Sep 10, 2013 3:07 am
Location: West Sussex, UK
Contact:

Re: Autolog LIFX Controller Discussion

Post by autolog »

manwithavan wrote:Download link seems to be broken.
Just tried it and it is working OK for me :?

In what way is it broken? I have earlier (around 09:00 UK time), experienced a MYSQL error when accessing the forum - this has happened before and I suspect maybe something to do with overnight backups? Just happens to be after 08:00 in the morning in the UK. Not sure if this is what you experienced?

Also, just to double check, are you accessing the latest version from this post - LIFX Controller (V3.5.1) Information ? :)
User avatar
manwithavan
Posts: 76
Joined: Tue Jan 14, 2014 5:22 am
Location: Melbourne Australia

Re: Autolog LIFX Controller Discussion

Post by manwithavan »

Yep, working for me now. Thanks autolog! :D
[email protected]
Posts: 3
Joined: Fri Apr 15, 2016 1:23 pm

Re: Autolog LIFX Controller Discussion

Post by [email protected] »

The offline/online status is working great! Thanks for adding it!

Charles
Brady
Posts: 57
Joined: Wed May 25, 2016 5:00 pm

Re: Autolog LIFX Controller Discussion

Post by Brady »

autolog wrote:I don't know what the formatting required in Applescript (as I don't know much about Applescript :wink: ) but here is an example in a python script:

Code: Select all

plugin = indigo.server.getPlugin("com.perceptiveautomation.indigoplugin.autologsLIFXcontroller")
if plugin.isEnabled():
    plugin.executeAction("processHueSet", indigo.devices["<YOUR LAMP NAME>"].id, props={"HueValue":<YOUR HUE VALUE>, "HueSetDuration":<YOUR DURATION VALUE>})
e.g. :

Code: Select all

plugin = indigo.server.getPlugin("com.perceptiveautomation.indigoplugin.autologsLIFXcontroller")
if plugin.isEnabled():
    plugin.executeAction("processHueSet", indigo.devices["LIFX LAMP ONE"].id, props={"HueValue":180, "HueSetDuration":5})
Hope this helps :)
Is this still valid for the latest 3.x version?
autolog
Posts: 4077
Joined: Tue Sep 10, 2013 3:07 am
Location: West Sussex, UK
Contact:

Re: Autolog LIFX Controller Discussion

Post by autolog »

Brady wrote:
autolog wrote:I don't know what the formatting required in Applescript (as I don't know much about Applescript :wink: ) but here is an example in a python script:

Code: Select all

plugin = indigo.server.getPlugin("com.perceptiveautomation.indigoplugin.autologsLIFXcontroller")
if plugin.isEnabled():
    plugin.executeAction("processHueSet", indigo.devices["<YOUR LAMP NAME>"].id, props={"HueValue":<YOUR HUE VALUE>, "HueSetDuration":<YOUR DURATION VALUE>})
e.g. :

Code: Select all

plugin = indigo.server.getPlugin("com.perceptiveautomation.indigoplugin.autologsLIFXcontroller")
if plugin.isEnabled():
    plugin.executeAction("processHueSet", indigo.devices["LIFX LAMP ONE"].id, props={"HueValue":180, "HueSetDuration":5})
Hope this helps :)
Is this still valid for the latest 3.x version?
Yes in principle but no in detail :)

The command formats have changed and the plugin now has a different CFBundleIdentifier.

Try something like this (just tested as working OK):

Code: Select all

plugin = indigo.server.getPlugin("com.indigodomo.indigoplugin.autologLIFX3controller")
if plugin.isEnabled():
    plugin.executeAction("setColorWhite", indigo.devices["Study Lamp"].id, props={"mode":"color", "messageType":"standard",  "hue":80, "brightness":50, "duration":1})
Change "Study Lamp" to be your lamp name.

I need to document how to do this in more detail - I will move the task up my to do list.

In the interim, if you need any more info, please ask (however I am turning in for the night now it is 23:00 in the UK) :)
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Autolog LIFX Controller Discussion

Post by jay (support) »

I don't know if we've discussed this with you before, but in terms of the plugin id's, the domain "com.perceptiveautomation.*" is reserved for our use (to avoid any potential namespace conflicts - that's why it's customary to use a domain name). Also, "com.indigodomo.*" also is.
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
autolog
Posts: 4077
Joined: Tue Sep 10, 2013 3:07 am
Location: West Sussex, UK
Contact:

Re: Autolog LIFX Controller Discussion

Post by autolog »

Hi Jay,
jay (support) wrote:I don't know if we've discussed this with you before, but in terms of the plugin id's, the domain "com.perceptiveautomation.*" is reserved for our use (to avoid any potential namespace conflicts - that's why it's customary to use a domain name). Also, "com.indigodomo.*" also is.
You haven't specifically but I did see your feedback regarding this on another thread and so it was my intention to change it when the next iteration (major versions) of my plugins are released. I have already started the process and for example, my Smappee plugin was called "Autolog Smappee" in the UI and is now just "Smappee" in the UI with the latest major version change and it has a CFBundleIdentifier of com.autologplugin.indigoplugin.smappeecontroller to hopefully meet this requirement. :)

Apologies for using your names but didn't appreciate the significance when I started on the journey of writing my Indigo plugins. :oops:
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Autolog LIFX Controller Discussion

Post by jay (support) »

No worries.
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
wibbly
Posts: 6
Joined: Wed Aug 24, 2016 9:32 am

Re: Autolog LIFX Controller Discussion

Post by wibbly »

I'm trying to understand the relationship between turning the LIFX bulbs on and off using the builtins and changing the brightness using 'Adjust'.

I know the LIFX iOS confuses this stuff also, but I'm finding it very hard to do some things I want to do.

I've started looking through the code, but there's a lot of it.

So, here's my main questions:

1. Are you turning the bulb on and off based on brightness settings? It seems that sometimes this is leaving my bulbs in weird states ...

2. Can we separate this functionality, or does that make no sense?

3. How do you recommend I accomplish a long slow fade? Problem I'm facing is that sometimes when I do this, the bulbs seem to go into a weird state, where I can try and fade them up only to find they haven't turned on ... because they've turned themselves off when I faded out, but as I fade them up again the brightness rises but they're staying turned off?

Any light you can shed on this would help.

It looks to me when I read the API docs that the on/off and brightness are separate ... but looking at your code you combine them (like the iOS app does).

I really need to spend a lot more time with the logs I guess ...

Thanks for all the work you've done. A lot going on in this one!

W
Post Reply

Return to “LIFX Controller”