Autolog LIFX Controller Discussion

Posted on
Mon Jun 30, 2014 3:29 am
manwithavan offline
User avatar
Posts: 73
Joined: Jan 14, 2014
Location: Melbourne Australia

Re: Autolog LIFX Controller Discussion

Loving the plugin! I've noticed I have to keep in an instance of the terminal running lifx-http, which I guess makes sense. Like Indy-Larry at first I had only "all bulbs" listed but discovered via the log that it was due to having identically named bulbs, renaming sorted it. I've been making action groups for each bulb then virtual devices to run each action group, is this right? If so, how can I pass device state to the virtual device please? Thanks a million Autolog, this is a dream come true. :)


Sent from my iPhone using Tapatalk

Posted on
Mon Jun 30, 2014 5:22 am
autolog offline
Posts: 2456
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT+0]

Re: Autolog LIFX Controller Discussion

manwithavan wrote:
Loving the plugin!

That's good to know :D

manwithavan wrote:
I've noticed I have to keep in an instance of the terminal running lifx-http, which I guess makes sense.
It shouldn't be necessary to keep the terminal session running now. Have you upgraded to the latest version of the plugin (V0.1.1) ?
The problem you describe with having to have the terminal session active was a feature (mistake :oops: ) in V.0.1.0.
I am hoping this has been resolved.

manwithavan wrote:
Like Indy-Larry at first I had only "all bulbs" listed but discovered via the log that it was due to having identically named bulbs, renaming sorted it.
I would be interested in seeing the log entries so that I can add in logic to handle this. Not sure why duplicate named bulbs should cause a problem as they all have individual IDs (aka MAC type addresses). If your terminal session wasn't running when you first started the plugin (V0.1.0) you would have got this behaviour.

manwithavan wrote:
I've been making action groups for each bulb then virtual devices to run each action group, is this right? If so, how can I pass device state to the virtual device please?
Not sure why you need virtual devices to run each action group - what exactly are you doing or trying to do? I just have the bulbs set-up to run via control pages and use other action groups to turn the bulbs on and off as required e.g. at sunset etc. I haven't tried out virtual devices to any significant extend yet but will have a look at it (in relation to the plugin) if I can get an understanding of what the requirement is.

manwithavan wrote:
Thanks a million Autolog, this is a dream come true. :)

It is nice to know it's appreciated - thanks :D

Posted on
Mon Jun 30, 2014 5:15 pm
Indy_Larry offline
Posts: 134
Joined: Dec 03, 2013
Location: Indianapolis

Re: Autolog LIFX Controller Discussion

Hey Autolog,

I am still having issues,

This is my event log
un 30, 2014 7:08:34 PM
Disabling plugin "Autolog LIFX 0.1.1"
Stopping plugin "Autolog LIFX 0.1.1" (pid 62228)
Stopped plugin "Autolog LIFX 0.1.1"
Enabling plugin "Autolog LIFX 0.1.1"
Starting plugin "Autolog LIFX 0.1.1" (pid 62255)
Started plugin "Autolog LIFX 0.1.1"
Autolog LIFX Autolog 'LIFX Controller' initializing
Autolog LIFX Error Error in plugin execution startup:

Traceback (most recent call last):
File "plugin.py", line 896, in startup
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/subprocess.py", line 594, in __init__
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/subprocess.py", line 1097, in _execute_child
<type 'exceptions.OSError'>: [Errno 2] No such file or directory

My terminal log
[2014-06-30 19:12:11] INFO WEBrick 1.3.1
[2014-06-30 19:12:11] INFO ruby 2.0.0 (2014-05-08) [x86_64-darwin11.4.2]
[2014-06-30 19:12:11] INFO WEBrick::HTTPServer#start: pid=62468 port=56780

and

[{"id":"d073d500186c","label":"Table Lamp","site_id":"4c4946585632","tags":[],"on":true,"color":{"hue":0.0,"saturation":0.0,"brightness":1.0,"kelvin":5000},"last_seen":"2014-06-30T19:12:41.816-04:00","seconds_since_seen":7.300519}]server:~

I have python v2.7.6
I will reboot the server, let you know if that helps.

Larry

Insteon, Z Wave, Hue, Sonos

Posted on
Tue Jul 01, 2014 3:13 am
autolog offline
Posts: 2456
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT+0]

Re: Autolog LIFX Controller Discussion

It looks like it is failing to execute the 'lifx-http' command as it can't find it :?

Unfortunately I can't see the problem on my system as the command is found. I have done a test and temporarily changed the command in the plugin to execute a non-existent command and I can reproduce the exact same error - so I am pretty sure the plugin can't find the 'lifx-http' command.

Presumably you have successfully executed the 'lifx-http' command in a window (according to your log you can) so I am not sure why it can't be done from the plugin. I am at a bit of a loss as to why this is - maybe it is a path / permissions problem - I am not an expert in this area but I will try and have a think about how to resolve it.

I will look at providing the ability to configure the plugin so that you have the choice to run 'lifx-http' either outside or inside the plugin. Then you should be able to test by running 'lifx-http' in a terminal window and the plugin will start without trying to start 'lifx-http' itself. I will do that later today (UK time). :)

Posted on
Tue Jul 01, 2014 5:02 am
Indy_Larry offline
Posts: 134
Joined: Dec 03, 2013
Location: Indianapolis

Re: Autolog LIFX Controller Discussion

Okay, don't spend to much time on my issue this week or next because I'm leaving out on vacation. Again thanks for your work on this plugin.

Larry

Larry

Insteon, Z Wave, Hue, Sonos

Posted on
Fri Jul 11, 2014 7:40 pm
Indy_Larry offline
Posts: 134
Joined: Dec 03, 2013
Location: Indianapolis

Re: Autolog LIFX Controller Discussion

Hey Autolog,

I've done a reinstall of the Lifx http api (and I can control both lights using that method) but, I'm still getting the same errors when I try to load your plugin. I had to install Ruby 2.0.0 from Homebrew due to the server I have Indigo running on is on OS X 10.7.5 and it came with an older version of Ruby, could this be my issue?

thanks,

Larry

Larry

Insteon, Z Wave, Hue, Sonos

Posted on
Sat Jul 12, 2014 7:58 am
autolog offline
Posts: 2456
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT+0]

Re: Autolog LIFX Controller Discussion

Indy_Larry wrote:
... I'm still getting the same errors when I try to load your plugin. I had to install Ruby 2.0.0 from Homebrew due to the server I have Indigo running on is on OS X 10.7.5 and it came with an older version of Ruby, could this be my issue? ...


Possibly as I have only tested it on Mavericks?

I have uploaded a new version that allows the Plugin to interact with an existing LIFX-HTTP server running in a terminal window. If you are able to operate the lights that way, maybe this will allow the plugin to work?

Failing that you could turn on the debugging option and reload the plugin and see if that throws up anything in the log.

Let me know how you get on :)

Posted on
Sat Jul 12, 2014 9:03 am
Indy_Larry offline
Posts: 134
Joined: Dec 03, 2013
Location: Indianapolis

Re: Autolog LIFX Controller Discussion

Hi Autolog,

Still no luck. Still getting the same error in the events log.
I installed the latest update v1.2
I logged into the server and ran "lifx-http"

server:~ admin$ lifx-http
lifx-http can be reached at http://lifx-http.local:56780/
[2014-07-12 10:46:32] INFO WEBrick 1.3.1
[2014-07-12 10:46:32] INFO ruby 2.0.0 (2014-05-08) [x86_64-darwin11.4.2]
[2014-07-12 10:46:32] INFO WEBrick::HTTPServer#start: pid=74801 port=56780

after running "lifx-thhp" on server I enabled the plugin in Indigo leaving the "Lifx-http server control" unchecked
In the events log I showed these errors

Jul 12, 2014, 10:46:42 AM
Enabling plugin "Autolog LIFX 0.1.2"
Starting plugin "Autolog LIFX 0.1.2" (pid 74825)
Started plugin "Autolog LIFX 0.1.2"
Autolog LIFX Autolog 'LIFX Controller' initializing
Autolog LIFX Error Error in plugin execution startup:

Traceback (most recent call last):
File "plugin.py", line 904, in startup
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/subprocess.py", line 594, in __init__
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/subprocess.py", line 1097, in _execute_child
<type 'exceptions.OSError'>: [Errno 2] No such file or directory

Larry

Insteon, Z Wave, Hue, Sonos

Posted on
Sat Jul 12, 2014 11:11 am
autolog offline
Posts: 2456
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT+0]

Re: Autolog LIFX Controller Discussion

Indy_Larry wrote:
... Still no luck. Still getting the same error in the events log. ...

Did you reload the plugin after you did the config change i.e. unticked the 'LIFX-HTTP' Server Control option?

The code it is executing says you didn't :wink:

I have just done a test and temporarily changed the code to invoke a a command that doesn't exist and I am getting exactly the same problem you have. So I am fairly certain that when my plugin attempts to invoke LIFX-HTTP it cant' find it. Given that you had to install Ruby yourself I wonder whether it is related to the path statement or similar? I will enhance the program to check for an error when it invokes LIFX-HTTP and automatically flip into LIFX-HTP running in a Terminal Window mode.

[EDIT: New version v0.1.3 now available]

Posted on
Sun Jul 13, 2014 5:53 pm
Indy_Larry offline
Posts: 134
Joined: Dec 03, 2013
Location: Indianapolis

Re: Autolog LIFX Controller Discussion

Hi Autolog
Quick follow up, this version does work if I do have the "lifx-http" running in terminal. But I can't seem to save any color settings. I'll read the how-to's and make sure I'm doing it as described. Thanks for your work on this plugin, i'll report back in a few days.


Sent from my iPad using Tapatalk

Larry

Insteon, Z Wave, Hue, Sonos

Posted on
Sun Aug 03, 2014 2:34 am
MrJeffreyGee offline
User avatar
Posts: 74
Joined: Apr 26, 2011
Location: United States

Re: Autolog LIFX Controller Discussion

Can someone please tell me how to set the hue of a LIFX bulb using Applescript. Thank you!

Posted on
Mon Aug 04, 2014 3:29 am
autolog offline
Posts: 2456
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT+0]

Re: Autolog LIFX Controller Discussion

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

Posted on
Wed Aug 20, 2014 4:58 am
MrJeffreyGee offline
User avatar
Posts: 74
Joined: Apr 26, 2011
Location: United States

Re: Autolog LIFX Controller Discussion

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


Ok, cool. Thanks... That worked well for changing colors. I don't know much about python, but I got it to work. What about turning the light bulbs on and off in python?

Posted on
Wed Aug 20, 2014 6:50 am
autolog offline
Posts: 2456
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT+0]

Re: Autolog LIFX Controller Discussion

MrJeffreyGee wrote:
... What about turning the light bulbs on and off in python?

Try this to turn On:
Code: Select all
plugin = indigo.server.getPlugin("com.perceptiveautomation.indigoplugin.autologsLIFXcontroller")
if plugin.isEnabled():
    plugin.executeAction("processTurnOn", indigo.devices["<YOUR LAMP NAME>"].id)

and this to turn Off:
Code: Select all
plugin = indigo.server.getPlugin("com.perceptiveautomation.indigoplugin.autologsLIFXcontroller")
if plugin.isEnabled():
    plugin.executeAction("processTurnOff", indigo.devices["<YOUR LAMP NAME>"].id)


and this to Toggle:
Code: Select all
plugin = indigo.server.getPlugin("com.perceptiveautomation.indigoplugin.autologsLIFXcontroller")
if plugin.isEnabled():
    plugin.executeAction("processTurnOnOffToggle", indigo.devices["<YOUR LAMP NAME>"].id)

I will update the documentation at some point :wink:

Posted on
Wed Aug 20, 2014 9:57 am
jay (support) offline
Site Admin
User avatar
Posts: 14860
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Autolog LIFX Controller Discussion

If those devices are just standard relay or dimmer devices, can't you just use the built-in turnOn, turnOff, toggle methods?

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Who is online

Users browsing this forum: No registered users and 1 guest