Particle Photon/Spark Core RGB WS2812B


(Tim Slagle) #52

Our official Alexa integration does not provide any more functionality other than on/off/dim for lights. We use the Smart Home API for Echo and this is a more limited API, but it allows us to skip the “ask SmartThings” part of the action when interacting with Alexa.

(Justin Wurth) #53

Ok well there you have it Bert, but all hope is not lost. What you can do is create a virtual switch that Alexa can control and make it blue lights. Then you can say “Alexa turn on the blue lights”. In the background you will have a rule that when the bike lights virtual switch is turned on the blue command is sent to particle.


How hard would it be to port this ws2812 smartthings project to the ESP8266 instead of the Photon? I have some experience with the ws2812 leds with the ESP8266 board, but I dont have any experience with writing device handlers.

(Justin Wurth) #55

Sorry for the late response, I missed this.

I actually think the device handler could be kept except for the put command. It could remain a put command, but it would probably need to be a local call. Since the ESP8266 can run arduino as well the code there can be the same too.

This should be a pretty easy cutover.


Thank you for your reply! Unfortunately, I’m unfamiliar with put commands… I’m pretty good at patching multiple codes together from various sources, but not yet familiar with coding specifics. How much would be involved in reworking your code to function on an esp8266 in smartthings? I feel like many people could benefit from this code, as these boards are available for as cheap as $4-6!

If you’re interested in adapting your code, I could send you one of these boards? Or it would be awesome if its a simple adaptation to update your code to feature both boards?

(Justin Wurth) #57

Hey @nrudolph7 I think this was recently accomplished.

(Beckwith) #58

I am working on an edge lighting project and would like to use these LED strips:

Will they work with your solution? What is the maximum number of addressable pixels it can control?

(Justin Wurth) #59

It may I don’t know what the 2811 statement is with that strip. I would just look for a regular ws2812b strip. Also that doesn’t look like that great of a price. To answer the question of power. The max load of vin on the particle is 1amp. A separate power supply can be used, and then I would say you would probably be limited by a memory capacity on the photon, but I would think you would be looking T several hundred lights. I have 30 lights/meter strip that I am powering 88 lights on without a problem. That is over the 1 amp rating, but I haven’t seen a problem. The general rule of thumb is 20 mA per pixel, but like I have said I have seen better results. Btw the 30led/m are what are in my video. They put out a good amount of light.

(Beckwith) #60

From what I’ve read on other web sites, they are WS2811 compatible and others have had success.

30 LEDs per meter may be fine for brightness, but has a bigger edge lighting “V” affect compared to 144 per meter. So eighteen cents per LED seems reasonable when you consider the etched glass I’m lighting runs in the thousands of dollars.

Can you show a SmartThings screen shot of your device type. I can see the code, thank you, but a picture is easier for me to comprehend.

(Justin Wurth) #61

Ok well if that is the case with the 144/meter I would say that you would only want to power 1 meter or less with the VIN on the particle. If you want a longer run you will need a separate power supply. Always be cautious when adding power and always connect ground first.

I’m not too sure what you want a screenshot of. I don’t like taking screen shot of certain settings as it has token ids and the like.

(Beckwith) #62

I’m injecting power to the strips every meter instead of using VIN and only connect the data line. I’m not sure if the Photon data line can handle nearly 500 pixels but this controller can handle up to 2048:

The following is the screen I get for your device type:

So, if I understand this correctly, “ON” starts with the color wash and the second button toggles a set of colors. The firmware needs to be tweaked if we want other options.

(Justin Wurth) #63

Yes functionality is limited at this time. I have a work in progress that will have a color selector. I just haven’t had much time to work on it.

(Beckwith) #64

Thanks for sharing your efforts.

(Justin Wurth) #65

Ok I worked on this over the weekend. I think I have a color picker working. I also put in refresh logic to see if the device is on/off. I will post some of this to github, but I haven’t had time to verify that the picker is working properly.

Update: All done. I copied the code over. Like I said the rgbselector is currently a work in progress. I can get the rgb values and verify them in my logs, but I am still testing out the parsing on the Photon firmware. I know at worst I am very close.

All of the code on github is now titled with Photon*.


Hello Justin,

I am Truly a NEWB here working with Github, SmartThings, Particle etc. Not easy for me, but I intend to get familiar to these forums, websites & files. I have been reading your posts and responses that you have provided and it looks like I am a year late as your last post on this topic was Sept 2015.

I have followed all your instruction working with Github I have managed to get your “Photon-RGB-Master” folder from Github and connected the RGB strip (WS2812B) to one of my Photons. But that’s as far as I have been able to get. I get lost with all this talk and back and forth between Particle, Github and SmartThings.

at first I was trying to use Builder but I couldnt get any of your “Photon-RGB-Master” folder files to come into the Particle IDE. Then something told me to try using the Atom test editor. This application allows me to get your file folder “Photon-RGB-Master” into the left side of the Atom I was then clicking on the three files you mentioned was needed and they pop up in new tabs within the Atom screen, but how does one compile, I need some help. For one I am not a coder, two all these websites are new to me and Im not really sure how to navigate with in them. I am navigating via trial and error.

Could you please provide some detail for the beginner (and I do mean Beginner). Have you published anything that has a resemblance to a step by step procedural document on how to get these files to work with my Photons. Im so lost at this point Im not sure where to re-start, or that I even have too.

I realize that these posts I am reading are for the beginner, but that the community already knows where and how to navigate within these new applications and getting by with your typed responses.

I am in dire need of some one-on-one, step -by-step coaching until I understand how all this comes together. Seems the RGB strips should have been easy enough to duplicate and run on my Photon. I love these lil Photons but I can’t seem to make any progress.

Would you mind providing a little more detail to help me get started here.?

Thank You in advance

(Justin Wurth) #67

Sure I can try to help.

I only know particle IDE so I can’t comment on ATOM, but I know it is an interactive IDE that the Particle team has been working on and I have to say I am interested in using.

The following are the steps that should get you to functioning:

  1. Copy the Photon RGB Template firmware from github and go to the Particle IDE.

  2. On the code page on particle ide create a new app. Paste the copied code from github.

  3. Go back to github and grab Photon neopixel.cpp and Photon neopixel.h. You will need to create these files as well on Particle ide you do so by pressing the + sign in the upper right corner. As a side note when you press the + sign it will create both a .cpp and .h file and you will just need to paste the code into these and rename them to neopixel.cpp and neopixel.h as they are named in the .ino file (the main file).

  4. You need to make one change to the main firmware code and that is to define the number of pixels you have. On line 15 you will see:
    define PIXEL_COUNT 88
    Change this to however many pixels you have in your strip… as a side note there is some electrical equation you need to understand in terms of the number of pixels you have if you are running off of vin. I would not recommend much more than 120 pixels as you will be well over the electrical capacity of the photon for output. This shouldn’t hurt the Photon if you go over as there is a regulator on vin, but you may get a voltage drop.

  5. The next step will be to create a smartthings DHT (device handler). To do this you will need to go into Smartthings IDE. Copy the Photon RGB Smartthings Device Type from github and after you are done with that save and publish for me on the Smartthings IDE.

  6. This is where most people get a little lost. The next step requires you to create a new device on the Smartthigns IDE. So if you go to the devices tab click on the new device tab on the upper right.

  7. After you have created the new device you will need to log into the mobile app. You should have a device that needs to be configured. You are getting close if you have this so you should feel good.

  8. In the device in the mobile app you will need to go into the settings menu for the device (the gear). Here you will need to enter two things. The first is the Access Token. The Access Token is unique to you but not to the device. What I mean by this is that if you 12 Photon devices (like me) this Access Token will be the same for all of them. You will find this access token on the settings page on the Particle IDE. Settings is the gear on the left side of the Particle IDE.

  9. The final piece of this fairly intricate puzzle is the device id. You will need to put the device id on the mobile app device settings page. To find you will go to the Particle ID again, but this time you go to the devices page (looks like a target on the left side). Next to each device there is a right arrow. If you hit that right arrow the device id will show up. Copy this and place it in the mobile app for the device.

  10. Enjoy

Looking back on these instructions I am quite impressed that I managed to get all of this running let alone the json returns and everything else involved, and funny enough I didn’t think this was overly complex.

I am usually fairly responsive to threads so let me know if you have any questions. I don’t know if the RGB selector is working perfect, but everything else should work(on/off/tv dim/movie dim/red(I use this code in a home theater). I need to spend some time on the RGB selector, but I have been pretty busy and well life.


Mr. Justin W.,

Thank You for your quick response to my initial letter via email within this forum. The individual steps that you provided were very useful and help me significantly. I was able to read between the lines and figure out a few additional details on my own, as you had wrote enough information/description to guide me through the different websites and applications that I was able to get something to get the code into Builder and learned quite a bit, in one sitting. The one sitting took several hours, but I was able to get a sense of achievement nonetheless. THANK YOU…!

I actually got all the way from step one (1) to about half-way through step eight (8) following your expressive direction/explanation. in step (4) I changed the PIXEL_COUNT 120 as I have the 16.4 ft W2812B RGB strip and it is still rolled up on the shipping reel (I haven’t cut it down to size yet).

In step eight (8) I got about halfway through the last portion of this step after downloading the mobile app (I didn’t know I needed or existed, until you made mention). Here is where I ran into a lil problem: I located the Access Token you mention and I was aware of where to locate my Photon Device ID as you mention in step nine (9). The problem I am having is that the settings (small mechanical gear icon) where you inform me to place the previously located Access Token from the Particle IDE, the mobile app only provides for “Security”, “Smoke”, “Leaks” & “Custom”, Under the “Settings”/Configure TAB in the mobile app. Similar scenario for the Photon Device ID. I can’t locate this section under “Settings” within the mobile app, where these two components (“Access Token” & “Photon Device ID”) are to be placed.

Nevertheless, at this point it was 0300 in the morning and I started to get tired. So I compiled the code you led me too with No Errors and decided WTH let’s flash the lil’ Photon and see what happens. WA-LA, I did get some action going but not what I was expecting. This is of course probably due to Not having the Access Token or the Device ID set within the SmartThings mobile application. I saw the compiled code from the Builder, load into the Photon when flashed. The little blue RGB on the Photo went blank, but I wasn’t concerned, as I read from one of your earlier forum responses that the RGB on the Photo was coded to be blanked out.

When I flashed the Photon the Photon booted up and the W2812B RGB strip complete chain flickered, which leads me to believe that more than likely the RGB strip works fine, but I only get two (2) RGB’s to light up after the initial ficker. The radio buttons and sliders on the mobile app do nothing to change colors or light intensity. The "Log " within the mobile app did log and change the recorded HEX value/numbers and it appeared as though the hex values did change value(s) within the mobile SmartThings application when the sliders and radio buttons were manipulated. However, only the first two (2) RGB’s on the front end of the WS2812B RGB strip illuminated, and they stayed white no change in color, intensity or mode (on/off).

Like I stated earlier I believe this is due in part to not being able to locate and place the Access Token and the Device ID within the “SmartThings” mobile app as you suggest/instruct in steps eight (8) & nine (9).

The winner here is Myself (Thanks to Your Quick Support): I was able to utilize the Build IDE, Learned how to make and create my own .io file within the Particle IDE, run community code, add .cpp & .h files to the file, navigate and create a Device Handler within the SmartThings web IDE and place all this into a file/app, compile and load with No Errors.

However, I now have many more questions to ask <>, and I still haven’t achieved a working RGB strip show via the WS2812B and the Photon.

The version I downloaded from the “Play Store” for the “SmartThings” application is version 2.2.0/Build number 207522. Is it possible that we are running different versions of the SmartThings mobile app.? For the HUB identification I have a Samsung TV with ConnectOne and I see no existing SmartThings application within my menus option. I have called Samsung and opened a ticket to have Samsung SmartThings technical support contact me regarding that issue.

I do run a VeraPlus within my Home for my existing home automation and am looking into that scenario for a HUB ID. Again, these issues aren’t really relevant to what you assisted me with in your direction/tutorial and Ill look more into those subjects after we get this RGB strip functioning as you describe in your earlier community forum posts.

Justin again, I can’t express enough gratitude for your help in getting me this far. But I could use a little more community support to get to the settings within the SmartThings (Android version) app that will allow me to input the Access Token and the Device ID, as I believe this is my only hang-up at the moment. Do you have any ideas.? Are we running different versions of the SmartThings mobile app.? Or am I overlooking something within the Android version of the SmartThings mobile app…?



(Justin Wurth) #69

You are almost there. I was under the assumption you had other smartthings devices, but not a problem. If you are on the main screen of the mobile app at the botttom go to my home. On the ribbon close to the top there should be rooms things and family. You will want to be on the things tab. From there, there should be a + sign at the top. Press the plus sign and if you had correctly added the device there should be a device that needs to be configured. Go into that device and you should be able to add the device id and the access token to the device. If you cannot add them on that screen there should be a gear on that screen and this is where you will add them. From what it sounds like you are very close… good luck and let me know if there are any other questions.



Do I require a SmartThings Hub to work this project you have been providing me tutorials on? I do not get a settings view with the options you mention. I still can’t locate where to place the Access Key from or locate a place to input the Device ID. These KEY items you mention in steps 8 & 9 of the guidelines you have provided were simple enough for me to find. I just can’t find a menu option within the setting that allows me to place this information. I have called samsung twice (current;y on the phone with them now) with the run-around. Everyone I speak with is unfamiliar with the subject matter. Both the Samsung Smart TV should have the application installed already to allow me to utilize my Smart TV as a SmartThings Hum, and the SmartThings Extend. I’m currently attempting to get a SmartThings Extend as a Beta Tester for development trial and feedback. This item has not been publically released as of yet and difficult trying to explain to the so called technical support people at Sumsung and Samsung SmartThings technical support departments. So far its an endless loop back and forth with myself having to re-explain myself… Grrrrr

Justin are you using a SmartThings Hub… Will the SmartThings Hub conflict with my current VeraPlus Hub home automation system?

Can I integrate the VeraPlus Hub and utilize with the principle base of using it as a SmartThings Hub… I don’t want to have to purchase an additional $100.00 plus shipping cost unit/hub if I don’t have to.

Please advise at your earliest opportunity. The technical support both at Samsung and SmartThings TIER 1 are not trained or knowledgeable enough to really understand what it is that I am talking about. For some reason they will NOT transfer me to TIER 2 customer support. They both continue to relay information back and forth while missing vital details within the message transfers. Ill stick to the community forum here from now on

Thank You in advance for your continued support.

(Justin Wurth) #71

Yes you need something that serves as a hub. Unfortunately I have only
created a device type for SmartThings. I know Vera plus can send http
commands but I have not yet tried that platform out. So you will either
need a SmartThings hub or an extend if it functions in a similar manner to
the hub.