This project is one that has been live for quite some time. If my name looks familiar, I am the developer that created the Particle Photon window blinds that Keith showcased sometime back. This project as well as the blinds started with the integration between SmartThings and Particle Photon that I have to credit Juan Carlos for helping with.
Our ProjectThe project consists of a .ino
sketch as well as accompanying neopixel.h
and neopixel.cpp
code that I believe Adafruit had created. The integration with SmartThings is handled through a device handler type that I developed as well. All of these items can be found out on my Github page. The applicable code items all start with Photon.
The following are the steps that should get you to functioning:
- Copy the Photon RGB Template firmware from Github and go to the Particle IDE.
- On the code page on Particle IDE create a new app. Paste the copied code from Github.
- Go back to Github and grab Photon
neopixel.cpp
and Photonneopixel.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 toneopixel.cpp
andneopixel.h
as they are named in the.ino
file (the main file).
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
Enjoy!
Demo:Let me know your thoughts, and if you have any advice (code cleanup/documentation) feel free to leave feedback.
Comments