Lifx Group of Groups Driver (ST port)

Update 11/27/18:
** v2.0.20181029**
See updated driver in the post linked directly below. I am leaving the original sync driver in the original post for those that prefer it. I only have one Lifx bulb remaining that will soon be converted to hue so this will be my last update of this driver. I will do my best to fix any bugs but will not be adding any new features.

Update 4/18/18:

  • Updated with setColor functionality
  • commented out webCore custom commands to clean up device page. Can easily be readded by removing comments.

Update 3/28/18:

  • Updated to work the same as built in Hue drivers (and be compatible with ABC app)**_

With the permission of @whoismoses on the ST forum, I have ported his great Lifx DTH.

I have not tested everything but I tested the basics and I believe all functionality is there.
Confirmed working:

  • On/off
  • Set level with duration(in seconds)
  • Set color temperature (2500-9000)
  • Set saturation(0-100)
  • Set hue (0-100)
  • setColor(map) [hue:<value>,saturation:<value>,level:<value>]
    all values 0-100
  • ApiFlash
  • ApiBreath

To install create a Hubitat virtual device and use Lifx GOG as the driver. You can create an API token at LIFX Cloud or if you used this driver in ST, just copy that token over. Next type in the group name you want to control EXACTLY as it is displayed in the Lifx app.

Know Issue (potential deal breaker for some):
Device updates are not immediate.
I partially corrected the device status updates by forcing a refresh once every minute. This was the ST handler default and is used to reduce load on Lifx API server.


Oh, that’s good news, I should be receiving my Hubitat tomorrow with a bit of luck (and also a couple more LIFX bulbs). I’ll have the whole long weekend to have a play :smiley:

Made changes to the driver:
Updated to work the same as built in Hue drivers (and be compatible with ABC app)

Unfortunately my Hubitat didn’t arrive - it only cleared customs early this morning :frowning:

Hubitat arrived yesterday - got Lifx GOG working - the only issue is that Alexa claims it’s not responding, just after the lights have changed state. Presumably there’s a timeout issue there. It works very well though.

@rob are you able to set the brightness level. I’m not sure what has changed or when (I rarely change the brightness level of these bulbs) but I can’t seem to change their level anymore. On/off works but nothing else seems to work right now. Really strange.

Actually, no, it seems I can’t :frowning:

hmmm…I guess I’ll have to dig in. Either something had changed on the Lifx side or the Hubitat side.

Did you ever test changing levels when you first installed it?

I’m not entirely sure if I did, or whether I just set the levels in the Lifx app. It seems likely that I would have though, since I normally do that when I’m reading in bed.

One thing I should point out - when I turn a group on or off I get the message from Alexa that it’s not responding after the group turns on or off. When trying to set the brightness the first time I got the ‘not responding’ response immediately, However, now Alexa just says ‘Okay’ without actually doing anything.

I 've saved the log just in case you need it.

It may be worth checking to see if the same thing happens with the Smartthings version of the GoG code.

I readded it to ST and tested. Works fine. I think something might have changed with one of the firmware updates.

I just tried changing the level from the device in Hubitat and got the following

dev:352018-04-16 00:20:12.175:debugLIFX-GoG – null – Response received from LFIX in the getReponseHandler.

dev:352018-04-16 00:20:12.173:info200

dev:352018-04-16 00:20:11.018:debugLIFX-GoG – null – Polling…

dev:352018-04-16 00:19:59.785:errorsomething went wrong: Unprocessable Entity

dev:352018-04-16 00:19:54.075:debug[brightness:1, power:on, duration:10]

dev:352018-04-16 00:19:54.048:debugLIFX-GoG – null – Begin setting groups level to null over 10 seconds.

dev:352018-04-16 00:19:17.158:debugLIFX-GoG – null – Response [[id:d073d531ecfb, uuid:024e354f-b52d-4d83-96ad-b27cf82e0945,

That HttpResponseException looks worrying - pity it doesn’t show up as clearly in a pasted log.

It’s the same that I’m getting. Looking into it now

Might be worth trying to revert to earlier firmware for comparison.

I can only revert to hub- (currently using hub-

Not needed.
I’m not sure how familiar with groovy you are…but for some strange reason the map that has all the settings to send to Lifx didn’t work initially. I had to break it apart and recreate it for it to work. It looks like one of the firmware updates fixed that anomaly and I have to try to remember all the settings I changed to make it work and revert them. Fun stuff :disappointed_relieved:

Did they revert the double [] bracket requirements? Can you just code-compare to the original driver to narrow down the changes? I had a groovy compiler that did that but it was too complicated for me to use. >.<

I’m still learning with Groovy, but I’m familiar with lots of other languages. I’m considering trying to write a basic Lifx DTH to use until the official one appears, so I’m sure I’ll get far more familiar with it soon enough :slight_smile:

Wish it was that simple. I had to change varying parts of multiple methods to force them into compliance. I hope it won’t be too hard but there were many small changes over time and I don’t have the benefit of Github integration to show me the changes over tiime.

I’d definitely recommend using some sort of source code control - are you just modifying the code in the Hubitat editor at the moment?

It would be great if we could use a decent Groovy IDE and push changes to Hubitat from a git repo.

Yessir and tell me about it. It’s the hardest thing about coding for Hubitat atm

1 Like

Yep. I think it’s already on the wish list. I just don’t know if it’s on the to-do list. @mike.maxwell is github repository subscriptions a planned addition?

1 Like

Download the Hubitat app