LIFX Local Control

Want to buy them, so many reviews recomended them. What would I have to do to make them work? So many things I read yesterday got me confused.

You connect them first of all using the LIFX app (either Apple or Android), then install my device drivers and the app in Hubitat following the instructions in the readme file.

1 Like

Where is your device drivers and the app?
Thank you so much Rob!

As in the original message in this thread:

1 Like

HI Rob,
I would like to thank you personally with regards to this piece of work. Local control is great!

I have LIFX Tile and LIFX Beam in my setup and have noticed that there is limited buttons available for fire/morph for tiles and move etc for beam.
Would it be hard to add this to the driver?
I know that it is available in OpenHab as a button.

Thanks again
Gary

I've barely even started work on the LIFX Tile driver beyond treating it like a bulb, if anyone else wants to tackle that they're more than welcome :slight_smile:

Move for the beam/z strip should be possible though, but I wouldn't hold your breath to be honest. There's a few other things that a much higher up the list e.g. trying to reduce/eliminate popcorning with normal bulbs.

@rob How's that going by the way (pop-corning) ? let me know if you have any beta stuff to test on that! - It's my no1. desired feature!

Slowly, very slowly. My current strategy is to try to implement groups that send a blast of commands to a set of devices in one go rather than one command at a time, but I haven't got very far with it yet.

Hi Rob,

Would it be hard to add to the code the ability to set level, Turn on and increase level by etc.
At this point in time, the Tile and Beam device seem to be missing a set level option in the device.

I tried adding the capability "Switch Level" to your driver and the tiles did not take to the command.

Happy to help out where I can with this and other beta testing like pop-corning.

Thanks
Gary

I've not found a great way to do this yet, it's simple if you're using a single colour, but much harder if you've set a pattern (on Beam - that's not available yet for Tile). The problem is when you adjust the level so that some of the LEDs end up at either maximum or minimum brightness; when you adjust the level the other way the colours end up being skewed. I suspect that just remembering the pattern when it's set and then setting the individual brightness for each LED based on that would probably work okay. I'm also not sure how it would affect @dkilgore90's modifications.

@rob Sounds like you're proposing that the original per-zone brightness settings should be cached when doing a level change, until explicitly set again? I don't think this would impact the multi-zone changes I submitted, but setting any individual zone would (likely) reset the cached brightness list/map.

I'll add this to my list of things to ponder...

I added the MOVE effect locally, and tested on my z strip - it seems to work, with the exception of duration (I default it to 0 /infinite). Based on that, I coded up the Tile effects, but I don't have any Tile devices to test against. Branch here: GitHub - dkilgore90/lifxcode at effects if you want to test it out. You'll need to update the MZ and Tile drivers, and the Master app. (LMK how it goes, then I'll PR to @rob's repo).

From a UX perspective, I'm not sure how best to handle setting each pixel of a tile - could go to child devices, like I did with multi-zone - but at 64 "pixels" per tile, it feels a bit much?

I'm inclined to think that each tile should be a child device, would be quite nice to be able to put letters/numbers on each tile, although scrolling text would be a bit tricky.

One of the reasons I've avoided tackling the tile is the whole geometry issue, it looks difficult.

Error on Tile Driver: expecting '}', found ']' @ line 27, column 216.

Changed to " command "setEffect", [[name: "Effect type*", type: "ENUM", constraints: ["FLAME", "MORPH", "OFF"]], [name: "Colors", type: "STRING"], [name: "Palette Count", type: "NUMBER"], [name: "Speed", type: "NUMBER"]]
"

On Tile
Tried to set color: Not working
Tried to set effect: Not working
Tried to set : Not working
Tried to set color temp: Not working

Logs:
dev:13352020-05-13 16:06:31.410 errorgroovy.json.JsonException: Unable to determine the current character, it is not a string, number, array, or object The current character read is 'A' with an int value of 65 Unable to determine the current character, it is not a string, number, array, or object line number 1 index number 0 Absolute Zero ^ on line 83 (setEffect)

dev:13352020-05-13 16:06:31.385 debugEffect inputs -- type: MORPH, speed: 1, palette_count: 1, colors: Absolute Zero

Ah - I should have provided an example input :smiley: - For the Colors entry, it expects a Json array of maps defining color or hsbk - ex. [{"color":"Absolute Zero"}] for your case.

Fixed the setEffect definition as you mentioned, and also plugged in the "default" setColor, setColorTemperature, setHue, setSaturation commands as they are implemented for the basic lights

Still no luck with latest driver. only on and off working.

On and Off Commands in the logs below (these work)
dev:13352020-05-13 22:01:35.947 debug[42, 0, 0, 52, 68, 76, 69, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 117, 0, 0, 0, 255, 255, 0, 0, 0, 0]

dev:13352020-05-13 22:01:32.440 debug[42, 0, 0, 52, 68, 76, 69, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 117, 0, 0, 0, 0, 0, 0, 0, 0, 0]

Flame Error
2020-05-13 22:02:34.820 errorgroovy.lang.MissingMethodException: No signature of method: user_driver_robheyes_LIFX_Tile_292.setEffect() is applicable for argument types: (java.lang.String) values: [FLAME] Possible solutions: setEffect(java.lang.String, java.lang.String), setEffect(java.lang.String, java.lang.String, java.lang.Object), setEffect(java.lang.String, java.lang.String, java.lang.Object, java.lang.Object) (setEffect)

Morph Error
dev:13352020-05-13 22:03:18.735 errorgroovy.lang.MissingMethodException: No signature of method: user_driver_robheyes_LIFX_Tile_292.setEffect() is applicable for argument types: (java.lang.String) values: [MORPH] Possible solutions: setEffect(java.lang.String, java.lang.String), setEffect(java.lang.String, java.lang.String, java.lang.Object), setEffect(java.lang.String, java.lang.String, java.lang.Object, java.lang.Object) (setEffect)

Set ColorTemp error
dev:13352020-05-13 22:03:47.444 errorjava.lang.NullPointerException: Cannot get property 'commands' on null object on line 127 (setColorTemperature)

Set Color Error
dev:13352020-05-13 22:04:17.549 errorjava.lang.NullPointerException: Cannot get property 'commands' on null object on line 127 (setColor)

Set Hue Error
dev:13352020-05-13 22:04:54.753 errorjava.lang.NullPointerException: Cannot get property 'commands' on null object on line 127 (setHue)

Hmmm... Adding the description text to the command must have mucked with that param being submitted. I've rolled that back, and also defaulted the colors param to an empty list [] so that it shouldn't fail out.

As to the other commands - figured it was too simple just to plug in the existing functions. I've added some extra debug logs in the driver and Master App - so if you try them again, it can help isolate where/why we're ending up with a null command (expect these will still fail for now). Thanks for being the guinea pig to test out the tile stuff!

With Updated driver and app, ran through each switch 1by1.
Read logs from bottom up Init, off, on, poll, set color, set color temp, set effect - flame, morph, off, set hue, set saturation.
ONLY ON or OFF working. Poll does collect existing data.

dev:13352020-05-14 12:15:32.603 errorjava.lang.NullPointerException: Cannot get property 'commands' on null object on line 131 (setSaturation)

dev:13352020-05-14 12:15:32.514 debugsetSat: 24

dev:13352020-05-14 12:15:20.345 errorjava.lang.NullPointerException: Cannot get property 'commands' on null object on line 131 (setHue)

dev:13352020-05-14 12:15:20.257 debugsetHue: 20

dev:13352020-05-14 12:15:14.926 errorgroovy.lang.MissingMethodException: No signature of method: java.util.ArrayList.length() is applicable for argument types: () values: [] Possible solutions: init(), last(), last(), init(), get(int), get(int) on line 84 (setEffect)

dev:13352020-05-14 12:15:14.880 debugEffect inputs -- type: OFF, speed: 30, palette_count: 16, colors: []

dev:13352020-05-14 12:15:10.260 errorgroovy.lang.MissingMethodException: No signature of method: java.util.ArrayList.length() is applicable for argument types: () values: [] Possible solutions: init(), last(), last(), init(), get(int), get(int) on line 84 (setEffect)

dev:13352020-05-14 12:15:10.173 debugEffect inputs -- type: MORPH, speed: 30, palette_count: 16, colors: []

dev:13352020-05-14 12:14:58.555 errorgroovy.lang.MissingMethodException: No signature of method: java.util.ArrayList.length() is applicable for argument types: () values: [] Possible solutions: init(), last(), last(), init(), get(int), get(int) on line 84 (setEffect)

dev:13352020-05-14 12:14:58.509 debugEffect inputs -- type: FLAME, speed: 30, palette_count: 16, colors: []

dev:13352020-05-14 12:14:58.298 debug[36, 0, 0, 52, 68, 76, 69, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 206, 2, 0, 0]

dev:13352020-05-14 12:14:58.220 debug[36, 0, 0, 52, 68, 76, 69, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 101, 0, 0, 0]

dev:13352020-05-14 12:14:58.142 debug[36, 0, 0, 52, 68, 76, 69, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0]

dev:13352020-05-14 12:14:54.494 errorjava.lang.NullPointerException: Cannot get property 'commands' on null object on line 131 (setColorTemperature)

dev:13352020-05-14 12:14:54.366 debugsetTemp: 6000

dev:13352020-05-14 12:14:45.326 errorjava.lang.NullPointerException: Cannot get property 'commands' on null object on line 131 (setColor)

dev:13352020-05-14 12:14:45.228 debugsetColor: [saturation:100, hue:65, level:100]

dev:13352020-05-14 12:14:34.961 debug[36, 0, 0, 52, 68, 76, 69, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 206, 2, 0, 0]

dev:13352020-05-14 12:14:34.870 debug[36, 0, 0, 52, 68, 76, 69, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 101, 0, 0, 0]

dev:13352020-05-14 12:14:34.797 debug[36, 0, 0, 52, 68, 76, 69, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0]

dev:13352020-05-14 12:14:27.123 debug[42, 0, 0, 52, 68, 76, 69, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 117, 0, 0, 0, 255, 255, 0, 0, 0, 0]

dev:13352020-05-14 12:14:20.025 debug[42, 0, 0, 52, 68, 76, 69, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 117, 0, 0, 0, 0, 0, 0, 0, 0, 0]

dev:13352020-05-14 12:14:10.810 debug[36, 0, 0, 52, 68, 76, 69, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 101, 0, 0, 0]

Are there any corresponding logs in this time frame from the Master App? (Likewise for other commands where we see the NPE)

app:372020-05-14 15:43:12.592 errorjava.lang.NullPointerException: Cannot invoke method getAt() on null object on line 898 (parseForDevice)

app:372020-05-14 15:43:03.822 errorjava.lang.NullPointerException: Cannot invoke method multiply() on null object on line 1368 (deviceSetSaturation)

app:372020-05-14 15:42:59.213 errorjava.lang.NullPointerException: Cannot invoke method getAt() on null object on line 898 (parseForDevice)

app:372020-05-14 15:42:50.414 errorjava.lang.NullPointerException: Cannot invoke method multiply() on null object on line 1368 (deviceSetColor)

app:372020-05-14 15:42:42.541 errorjava.lang.NullPointerException: Cannot invoke method multiply() on null object on line 1368 (deviceSetColorTemperature)

app:372020-05-14 15:42:35.650 errorjava.lang.NullPointerException: Cannot invoke method multiply() on null object on line 1368 (deviceSetHue)

app:372020-05-14 15:42:33.500 errororg.h2.jdbc.JdbcSQLException: Column "device_id" not found [42122-197] on line 255 (lifxQuery)