Mood light based on phone orientation


#1

I’m new to the webCoRE community. i know you have cubes that change lights depending on their orientation (like the example code). i was wondering is there a way to do that using your phone orientation

i spent an hour trying to modify this code to work with a phone but had no luck at all. does anyone have any tips or solutions to my problem.


#2

If you want to do this, the first thing you need is a device type handler (DTH) for your phone that actually supports orientation. I assume you have your phone connected to SmartThings as a presence sensor. You will need to do a test piston to see if that is a supported attribute (just try logging to console that physical device:orientation). If you can get orientation information from your phone, then it should be easy but I don’t know of a DTH that supports this capability.


#3

If your phone is Android, there is an awesome app called Tasker that can keep track of your phones orientation, and trigger a piston when certain conditions exist.