SmartThing Contact Sensor and Particle Photon

Hello all, this is my first topic in this community.
I am recently working with Particle Photon and SmartThings. I was able to replicate 2 projects that I found online:

Both are working perfectly and I didn’t have any issue to implement them.

Now I am looking to update the contact sensor device in the SmartThings based on Photon status. I just want to send “open” if one of the Photon digital port is 1 and send “closed” if the Photon digital port is 0. The open/closed device templates have only information for zigbee and zwave devices.

I do appreciate your help.
Thanks,

I don’t have an answer for this, but I too am interested in understanding how to receive information back from the Photon and into SmartThings so I can trigger other actions.
My use case: I am using the Photon to control the opening and closing of my blinds. It works great and I’ve integrated it with SmartThings. The Photon shows up as a “Thing” in SmartThings with a device handler that I modified from other examples. I can open and close my blinds successfully using my SmartThings app and even trigger those actions based upon other actions in the home - like motion, temperature or switches being turned on or off.
My hope is that I can figure out how to now capture info that the Photon is collecting and send it back to SmartThings. For example, I have a photoresistor in my setup that closes the blinds if the sun is too bright. I’d like to be able to use the light measurement from that photoresistor in SmartThings to trigger other actions - like possibly turning off lights or changing the airflow in my HVAC. Heck, it would be fun just to double check when the weathman says it is sunny out and to simply look on my phone in my SmartThings app to double check if he’s right!
I have tried to use the few, older examples I’ve found on this site, but they aren’t working. Has anyone been successful in doing this? Thanks in advance for you help!

1 Like

I just picked up a smartthings hub. Does anyone have recommendations on getting sensor data from the photon to smartthings?

Use the “poll” capability. You can create a poll button in your device handler that will do an httpPost, and return the value of a variable.

Do you have some examples code for Smartthings and Photon? Or a reference I can follow?

Well that would be cheating! I don’t want you to miss the great fun that is trying to learn groovy (hint: not much fun to have).

I got it working here: https://github.com/Here-Be-Dragons/Pool-Controller. In my app I click a “refresh” button, and it does poll.poll. This uses a curl to get the value of the Particle.variable("pumpSpeed", sSpeed) declared in setup().

There are some other examples floating around specific to turning LEDs on and off with the Photon also, but they were of limited help to me.

1 Like

Funny your link is “Here be Dragons”. We have referred to my son as baby dragon since before he was born and he has had dragon themed nursury/bedroom. On his door hangs a “Here be Dragons” sign.

2 Likes