FLEXi Lighting - a flexible system for lighting scenes (Hues, dimmers, and switches)

Any reason why this wouldn’t work on a v2 hub? I just finished nuking my config on my v1 and made this the first thing I tried setting up on the v2 instead of using the regular SmartThings Hue Connect. Created the smartapps and device types and copied the code. Installed the FlexiHue Connect Service Manager. It found my bridge and my bulbs. They got added to my things list, but none are the bulbs are controllable (won’t turn on/off etc). Did I miss something? Do I need to manually change the device type to using the FlexiHue one?

Yes. You need to (a) remove the existing hue lights and service manager (the standard Hue connect app) and then (b) install and use the flexiHue Connect app - it will install all of your hue lights as FlexiHue devices. You can then uses the scenes and trigger apps.

1 Like

That’s what I did. I was starting from a brand new hub with no smartapps or devices installed. I installed the FlexiHue connect app, it found and connected to my bridge and installed my bulbs as things. But when I try to control those things (on/off/dim) nothing happens.

1 Like

Are you using the flexiHue trigger and scene apps?

If so, try cycling the power of both the ST hub and the Hue hub.

I tried cycling the power, but I could try again. I didn’t even get around to installing the scene or trigger app yet as I stopped when I saw I couldn’t even turn my bulbs on/off from the list of things within the smartthings app.

Still not working. I checked the live log when trying to turn off one of the Hue bulbs and got this:

9:18:19 AM EDT: warn NOT PROCESSED: [{“error”:{“type”:5,“address”:"/lights/9/state",“description”:“invalid/missing parameters in body”}}]

9:18:19 AM EDT: trace FLEXiHue BRIDGE, OTHER

9:18:17 AM EDT: debug FLEXiHue(Fireplace 1): Executing ‘Off(transitionTime)’

Another interesting troubleshooting tidbit:

The SmartThings app appears to be showing the correct state of the lights. When I tried turning a couple bulbs off (that were on and also shown as on in SmartThings) and another 2 bulbs on (that were off and shown as off in SmartThings) that states changed accordingly in the SmartThings app, but the bulbs did not actually turn on/off. I let it sit like that for a while (the states in the SmartThings app being opposite the actual on/off state of the bulbs) and after awhile some stuff showed up in the live log (like the bulbs were polled or something) and the states in the SmartThngs app updated to reflect the actual states of the bulbs. It still won’t actually let me turn them on or off though.

I got it working. I was using the app and device type code from one of the later links you posted. When I went back to your original link in your first post and used the code from there for the apps and device types it is now working. I’m a little confused about exactly how the scene and trigger apps work though. I think I have the scenes figured out. You create a mode for every scene you want and when you switch to that mode (through whatever means) that scene is “activated”. After that you can switch to any other mode and that scene’s settings are saved by each bulb device. Right?

So then I get to the trigger app and I don’t understand how that relates to the scenes. I don’t see anyway to specify/trigger a mode change that would trigger a scene. I see an option for “push mode change” with yes/no choices, but no place to specify what to change the mode to and it doesn’t seem to do anything whether yes or no is selected. Other than the abort options (which are useful) how is the trigger app any different than creating and running one of the smarttthings routines (which at least lets you change the mode)?


Thanks for the update. I’m glad that you got it working. But I’m a little confused as to which code you’re using - can you explain?

The scenes app handles changing of the light scenes when the mode changes. The trigger app handles turning the lights on within any particular scene (from either motion or contact open) or lights off (from either no motion or contact closed).

The trigger app can control Flexihue lights, Flexidimmer lights, and standard on/off lights.

I handle the mode changes using basic ST routines or using SmartTiles.

Hope this helps.


That clears it up a bit. Originally I followed the github link you posted on October 10th, assuming it was the latest code with changes/fixes (if any). That’s what wasn’t working. When I followed the github link from your original post from May 2nd it took me to a different page with different app/device type versions. When I copied the code from those it worked for me.


Thanks a lot Chris. I’ll check out what the problem is with the new version.

One more question: What does the option “push mode change” in the FlexiTriggers app do?

Thanks for this awesome work! It’s going to be integral to my migration to v2. :slight_smile:

FYI, it looks like this revision of the FLEXi_Scenes app sort of blew that app away and replaced it with a similar-but-not-identical copy of the FLEXi_Triggers app.


Currently, the option “push mode change” is used to push a notification to your mobile device when the mode (now called the routine) changed.

I included this option because I have multiple FLEXi_Trigger apps running - one for each room / area in my house - and I didn’t like having multiple notifications appear on my phone every time the mode/routine changed.

So I select “yes” for the “push mode change” option only on one of the FLEXi_Trigger apps (because I have one that applies to all possible modes/routines - if you had a mode/routine that only applied to a specific room/area, then I would select “yes” for that one too).

Please let me know if this doesn’t makes sense.



I’ve fixed the code for the FLEXi_Scenes app that was posted in the link you included. Sorry about any confusion.

Just to be clear: The FLEXi_Scenes smartapp and the FLEXi_Triggers smartapp are meant to be used in conjunction with each other. The FLEXi_Scenes smartapp sets the lights to the desired colors/levels based on the mode (now called the routine), while the FLEXi_Trigger smartapp handles turning the lights on (from a motion or an open contact event) and off (from a no motion or a closed contact event).

Also - thank you for your kind words. You (and anyone else using my code) should feel free to let me know if you have any questions/issues with the current versions or have any requests for new features.



@infofiend I have installed everything but keep getting this error after selecting bulbs in discovery mode:

error physicalgraph.app.exception.UnknownDeviceTypeException: Device type ‘FLEXiHue Lux Bulb’ in namespace ‘info_fiend’ not found. @ line 285


Are you getting the error from the device type or from one of the a smartapps?

Do you actually have a Lux Bulb? Or is that a mistake as well?

Also - I’m very close to releasing a new version of the app that will work with any light and will not require the use of a custom device type. So it will likely solve this issue.



I’m getting an error when I hit “Done” after the lights are discovered. Here is the “Live Log”: Any thoughts?
6:47:05 AM: error physicalgraph.app.exception.UnknownDeviceTypeException: Device type ‘FLEXiHue Lux Bulb’ in namespace ‘info_fiend’ not found. @ line 285
04b4139a-8519-46d5-b8fb-45c744d252d9 6:47:05 AM: trace FLEXiHue SM: FLEXiHUE BULBS:
04b4139a-8519-46d5-b8fb-45c744d252d9 6:47:05 AM: trace [3:[id:3, name:Hallway 2, hub:d1308137-ebce-4f26-a25c-5ff25cacbfec, type:Dimmable light], 2:[id:2, name:Hallway 1, hub:d1308137-ebce-4f26-a25c-5ff25cacbfec, type:Dimmable light], 1:[id:1, name:TV Light, hub:d1308137-ebce-4f26-a25c-5ff25cacbfec, type:Color light], 7:[id:7, name:Front Right Speaker, hub:d1308137-ebce-4f26-a25c-5ff25cacbfec, type:Color light], 6:[id:6, name:Dining Room, hub:d1308137-ebce-4f26-a25c-5ff25cacbfec, type:Extended color light], 5:[id:5, name:Hallway 3, hub:d1308137-ebce-4f26-a25c-5ff25cacbfec, type:Extended color light], 4:[id:4, name:Front Left Speaker, hub:d1308137-ebce-4f26-a25c-5ff25cacbfec, type:Color light], 9:[id:9, name:Rear Right Speaker, hub:d1308137-ebce-4f26-a25c-5ff25cacbfec, type:Color light], 8:[id:8, name:Rear Left Speaker, hub:d1308137-ebce-4f26-a25c-5ff25cacbfec, type:Color light]]
04b4139a-8519-46d5-b8fb-45c744d252d9 6:47:05 AM: trace FLEXiHue SM: created FLEXiHue Bridge with id C0A802C5:0050
04b4139a-8519-46d5-b8fb-45c744d252d9 6:47:04 AM: debug FLEXiHue SM: INITIALIZE
04b4139a-8519-46d5-b8fb-45c744d252d9 6:47:04 AM: trace FLEXiHue SM: Updated with settings: [selectedHue:C0A802C5:0050, selectedBulbs:[04b4139a-8519-46d5-b8fb-45c744d252d9/3, 04b4139a-8519-46d5-b8fb-45c744d252d9/2, 04b4139a-8519-46d5-b8fb-45c744d252d9/1, 04b4139a-8519-46d5-b8fb-45c744d252d9/7, 04b4139a-8519-46d5-b8fb-45c744d252d9/6, 04b4139a-8519-46d5-b8fb-45c744d252d9/5, 04b4139a-8519-46d5-b8fb-45c744d252d9/4, 04b4139a-8519-46d5-b8fb-45c744d252d9/9, 04b4139a-8519-46d5-b8fb-45c744d252d9/8]]
04b4139a-8519-46d5-b8fb-45c744d252d9 6:47:05 AM: trace FLEXiHue SM: NON-HUE EVENT FLEXiHue Bridge updated
04b4139a-8519-46d5-b8fb-45c744d252d9 6:47:05 AM: trace FLEXiHue SM: LOCATION HANDLER: FLEXiHue Bridge updated
a8bdaa27-6bb9-4911-a168-3de685e407b0 6:47:05 AM: debug FLEXiHue Bridge was updated
6:46:47 AM: info Waiting on events…

FYI - [UPDATED as of March 24, 2016] Hue Lights & Groups & Scenes (OH MY!) is essentially the new version of this.

Hi there, this app looks great and exactly what I have been looking for! I have removed my existing hue bridge from the ST app and all of the devices. Installed LEXiHue (Hue Connect)smartapp and ran the set up, it found my Hue bridge, but when I get to the next screen where it says “Press the button on your Hue Bridge to setup a link” it just hangs and doesnt do anything?

I have tried rebooting the the Hue bridge but this hasnt helped. Am I being a bit dim or have I missed something? Any help would be greatly appreciated!