Connecting Arduino Shield to Philips Hue

I have searched high and low to try to control a Philips Hue with the Arduino shield. I can find examples about sending messages to and from the Arduino, and I can turn the Hue on/off from the siumlator using the device type, but I cannot connect the two!
I assume i need to add a switch capability to the Arduino to send ON or OFF to the cloud, then somehow link that the the Hue. How and where do I make this link?

Thanks
James

1 Like

I’d like to know more about your Project.

SmartThings “Labs” can directly connect to your Hue Bridge and import the list of lights and control them.

But you could issue equivalent http: REST-API commands from the Arduino, I suppose, if the Arduino is performing some extra functionality for you…?

Using the REST-API is a good idea but not what I am trying to achieve. I would like a simple Arduino light switch. Press a button on the Arduino and the Hue goes on or off. The Arduino is a Smart Things switch.
How do I make the Arduino appear as a switch and then pass the ON or OFF message to the bulb?

Or much more simply, how do I make a SWITCH module (on/off, open/closed) control a LIGHTBULB module (on/off). Where do I make this link?

1 Like

Hi @jmuraca,

Thanks for the clarification! – Indeed, the solution to your requirement is pretty simple and should be obvious, but that’s one of the common observations here about SmartThings and the mobile Apps – the system is not intuitive to a LOT of people! :wink:


If you have created a Device Type and Device Instance (handler for your Arduino) with capability.switch and/or capability.contactSensor (ref: https://graph.api.smartthings.com/ide/doc/capabilities), then you are half-way done.

Now any existing or new SmartApp that allows you to select Device(s) of these capability(s) will be able to utilize your Thing. There may be some good references in the SmartThings online documentation, but let me try to describe a couple scenarios here. (Please feel welcome to write me (@tgauchat) a Private Message and we can even arrange a little time to walk through these over the phone or screen share…).

To control a light or switch, you could use the “Lights & Switches Shortcuts” page off of the main Dashboard.

Select the gear icon and you will be presented with a list of existing shortcuts, and at the bottom of the list there is an option to Add new, or Auto import additional Things (this need not include your Arduino Thing, though, because the Arduino is a trigger, not a target):

The same page can be used to select from among the lights and switches shortcuts (or a group shortcut) and attach a SmartApp to them, from a selection of simple SmartApps that activate based on various conditions (such as open/close of a .contactSensor, or attach a non-default .switch to the light or group.


The alternative way is to add and configure a SmartApp directly from the Dashboard “+” Page:

But you actually have to explore quite a few pages of “Alerts”, “Actions”, and “Mores” before you might even settle on the exact same basic switch to light connection you reached via the Dashboard - Lights & Switches Shortcuts I described above.

A random example SmartApp that gives you a little extra functionality is “Smart Light Timer”…

Note that this specific SmartApp is hardcoded to only accept motion detectors (capability.motion) and contact sensors (capability.contactSensor) as triggers:


I hope this very brief overview helps, though it is difficult to demonstrate the design and functionality of SmartThings via a few words and screenshots… You can dig around the online documentation and help pages where there are more examples, details, and videos even.

But as I said … I’m more than happy to walk through this with you. There are various bits that might not work as expected depending on your overall setup.

Cheers!
…CP (Terry).

Thanks for this and sorry for the slow reply!
I managed to get it all working and had my switch controlling the light, thanks for the help.
I didn’t (i don’t think) use this method. I ended up creating an app on the developers section of the site and configuring it in there. This seems to work. I will hunt down the code and post in case it helps others in the future!

1 Like

Could you share the code and approach you did? I’m learning to build services with the Arduino shield, too. Thanks.