Jump to content

Polyglot LIFX NodeSever


einstein.42

Recommended Posts

Introducing the LIFX NodeServer for LIFX colors and white bulbs. 

 

Read the instructions and install into your existing Polyglot infrastructure.

 

Documentation:

http://lifx-nodeserver.readthedocs.io/

 

We will call this BETA 0.1.1 initial release. so please provide feedback and let me know what you think.

 

THIS WILL WORK WITH ECHO. Just make sure you add it in the portal. 

 

Cheers,

 

-E

post-7295-0-14483300-1464290832_thumb.png

Link to comment
Share on other sites

This is working fantastically for me so far!!  One question I have - I see in the LAN docs there is a concept of retrieving a device's location and group memberships, but I'm unclear if there is any way to actually use those for control.  Is that possible?  Ex - I have three bulbs in one fixture, that are grouped together.  It'd be great to be able to control them as a group, I'm just not clear if that's possible.

 

Thanks for all our work on this!!

Link to comment
Share on other sites

Since I forked the python LIFXLAN implementation to do this, I can look into adding it into the LAN module, I don't see anything like that in there now. Can you point me to the documentation you are seeing?

 

Another question though, why not just create a program in the ISY that says turn light a b and c on or off?? Then run the program from your other programs? 

 

Something like the attached screenshots?

 

post-7295-0-50543100-1464352484_thumb.png

post-7295-0-17531900-1464352489_thumb.png

Link to comment
Share on other sites

So I was noticing the two device calls noted below.  That said, I don't see (although I might be missing it) any obvious ways to use that information once it's obtained...I'm not sure if it's actually possible to address groups via the LAN protocol.  

 

I have a bunch of programs that do things like alter color temperature throughout the day, when the TV is turn on or off, etc.  So it's certainly currently doable, but I have to list 13 lights each time I want to make an adjustment to my two main living spaces, that's why I ask. :)

 

GetLocation - 48

Ask the bulb to return its location information.

 

GetGroup - 51

Ask the bulb to return its group membership information.

Link to comment
Share on other sites

Ok! So I had to completely build in those 'version 2' functions in the underlying code, however I believe I got the basics to work. Let me know what all else you want and I'll add it. 

 

LIFX Node Server release version 0.1.2:

 

Added group functionality. 

 

Watch out for any funky characters in your group names... The ISY doesn't like them. I currently filter out the ' character, but you may find more.

 

If you already have it installed, just go into your lifx-nodeserver folder and:

git pull 

Then restart the node server in Polyglot.

 

Otherwise: http://lifx-nodeserver.readthedocs.io/ and follow the normal directions.

Link to comment
Share on other sites

So this isn't really feasible using the node view (aka what you see on the device in ISY), However I have implemented it using the command view in a program. See the screenshot. This allows you to set specific HSBKD for all devices in a group. That being said I just noticed that while the commands are there, I totally forgot to actually code that part in the node server. Give me till this evening and I'll post an updated to 0.1.3

 

-E

post-7295-0-02615600-1464554710_thumb.png

Link to comment
Share on other sites

Ok. Release '0.1.3', adds the ability to change all the values of HSBK(and optionally D) in a program without doing it individually for both a bulb AND a group as a whole.

 

Docs and screenshots here:

 

http://lifx-nodeserver.readthedocs.io/en/latest/usage.html#group-node-view

 

To update change to your lifx-nodeserver directory and issue the command:

git pull

Then login to polyglot and restart the lifx node server.

Link to comment
Share on other sites

One question, is there a way to make any of the light statuses available to the condition side of a program?  Right now the only thing that shows up is the groups, and the option with those is "number of members."  Wondering if there's a way to have the individual lights show up, with on/off, or even better, the attributes like color temp, etc.  No idea if any of that is possible, but I figured it can't hurt to ask! :) 

 

Thanks!!

Link to comment
Share on other sites

  • 4 weeks later...

Everything continues to work great! Just wondering if there's any possibility on the above question? Getting the other bulb attributes available in use as conditionals in programs?  Ex - If bulb online = false then xxx.  Or if color temp > xxxx set it to yyyy.  If power on = true then xxx.  Etc.

 

Thanks!

Link to comment
Share on other sites

Sorry Chris, there isn't really a way to list any string variables at this time in ISY. I believe UDI is putting the string variable type in an upcoming version of 5. Hopefully 5.0.5 will have it. Bulb online I can do I think as it is boolean. HSBK you can get in a program for the individual bulbs in conditional programming already, have you tried? 

Link to comment
Share on other sites

Hi,

 

So I can take direct HSBK action on the bulbs via a program - that works perfect.  What I was hoping for, is to be able to check their current state (power on, and HSBK) on the "if" side, and potentially get them to show up as device where I can assign the value of one of those to a variable.  Does that make sense?  I wasn't thinking like the colors or anything, but a if bulb is online check would be super useful, as every once in a while a bulb will drop off and need to be power cycled. The numerical values, like HSBK, would be awesome too - one use I've thought of is when I want to take a notification actions (such as doorbell, for example) store the current HSBK, then take some action (flash blue maybe), then put them back the way they were.  

 

Currently the LIFX groups do show up with "Number of devices in group" as the only option both in the "If" section if I choose status, and same for the "then" if I select device attributes to assign to a variable.

 

Two examples to illustrate what I'm describing, in case it's not clear:

  • If LIFX Dining Room brightness < 32767 and Dining Room Switch is Fade Up Then Set LIFX Dining Room brightness = 65535
  • If doorbell sensor = on then variable current_dr_hue = LIFX Dining Room Hue 

I italicized the parts that are the functionality that doesn't exist today (as far as I can find anyway!)

 

Thanks as always for your work!!

Chris

Link to comment
Share on other sites

Chris sorry, I'm not ignoring you. I will look into this, I actually included this in my code, I'm not sure why the heck it isn't showing up. Give me a few days to look. It should have HSBK/Online/Bulb On and Uptime in there for the If section, but I don't see it in there for some reason. 

Link to comment
Share on other sites

My goodness. I had a SIIIIIIIMPLE error in my editor for my profile that only caused this. Sheesh. Sorry. 

 

1. `git pull` in the lifx-nodeserver directory

2. login to the polyglot web interface, restart the lifx nodeserver

3. download the profile.zip from the polyglot web interface

4. login to the isy

5. Node Servers>Configure>LIFX>Upload Profile and select the zip you downloaded in step 3

6. restart ISY

7. After the ISY is back up then `sudo systemctl restart polyglot`

 

Everything should be good to go. 

Link to comment
Share on other sites

Updated to 1.0.5 to address an issue where the ISY is rebooted and the node server must be restarted. The node server will now automatically reconnect once the ISY comes back up and queries the device.

 

`git pull` to update from your LIFX node server directory

 

ChangeLog:

http://lifx-nodeserver.readthedocs.io/en/latest/changelog.html

 

I also removed the need for pyyaml. That was actually a dev test that shouldn't have made it into that bug fix.

 

Thanks,

 

E

Link to comment
Share on other sites

  • 6 months later...

Archived

This topic is now archived and is closed to further replies.


  • Recently Browsing

    • No registered users viewing this page.
  • Forum Statistics

    • Total Topics
      36.5k
    • Total Posts
      367.6k
×
×
  • Create New...