Utilize old android devices sensors, for smart thing


(Matthew Flinchbaugh) #1

So I have an idea and can’t believe I can’t find anyone who has done or tried this. Our android devices, specifically old ones, could be the perfect smart sensor for smartthings. Such as a motion detector for the washing machine, or a light meter for dimming lights.

I realize all of this can be done with the smart sensors, but why not make use of old devices.

Does anyone know how to make this work?


(Jody) #2

I have toyed with this idea as well. I found that the temperature sensors on an android device are not really accurate for anything other than the internal temperature of the device. The lux sensor on my phone is good for determining if I am outside or inside, but not much else. If you would like to put something together, it would not be much work the phone sensors are documented very well and you would also need a simple oAuth SmartApp.


(Matthew Flinchbaugh) #3

I just started with my smartthings setup this past weekend, not very sure on where to begin. I’d like to start simple, such as posting to smartthings via tasker, to update the sensor readings. But I have no idea where to begin. I know the temp is more of an internal temp than anything else. But the accelerometer, tilt, all that stuff, would make for as I said a nice vibration sensor, for say the washing machine or dryer. Just like the smartmulti, only difference is I have a plethora of old android devices just laying in a drawer, and no multi’s on hand.


(Jody) #4

Easy way to do this might be via SharpTools by @joshua_lyon


(Matthew Flinchbaugh) #5

I have tried sharp tools and am currently using that for some Tasker profiles to control lighting. However I do not see a way to use sharp tools To update the value of a sensor. Maybe I’m overlooking something.


(Jody) #6

You could create a virtual tile in SmartThings and then use Tasker/SharpTools to turn that tile on or off based on the phone detecting acceleration. I will play around with tasker a bit this afternoon and try to work up an example for you.


(Matthew Flinchbaugh) #7

Can I create a virtual temperature sensor. I have a raspberry pi that has temp sensors throughout my house, which then sends these to my android device and tasker handles notifications, and thermostat operation from there. It would be nice to have a virtual temperature sensor that displays when I look at smartthings app.


(Matthew Flinchbaugh) #8

OK I got the virtual switch setup. Now if only I could figure out how to do a virtual sensor ( temp, and light sensor), I can use the info my raspberry pi sends to Tasker to update smartthings sensor.


(Joshua Lyon (SharpTools.io Dashboard)) #9

You might poke around in the IDE in the My Devices > New Device section to see if any of the existing device types meet your needs. Other SharpTools users are using the Simulated Presence Sensor with Tasker to put together a custom presence solution and you might find similar device types that meet your needs.

For example, it looks like the Simulated Temperature Sensor (code) has a setLevel and setTemperature command that you might be able to use.

Alternatively, you could write your own ‘shell’ device type that allows you to set the temperature/illuminance/etc as you desire… you could even start with the base code from one of the existing Simulated XX Sensor device types.


#10

One other point: most cellphones simply aren’t case hardened for long term operation as vibration or tilt sensors. Let alone the heat and humidity in a typical laundry room. Add to that the (relatively) appalling battery cost, and you’re not doing yourself any long term favors.

Instead, I’d just buy a sensor intended for the purpose.

The old phone can then be better purposed for a controller app, like SharpTools or SmartTiles. (See forum discussions.)

If you don’t want the old android device as some type of app host for your home automation, considering donating it to “cellphones for soldiers.” AT&T and other carriers recycle the phones and in exchange give the charity free minutes used to connect service persons with their families back home. Your local USO probably has a drop off, or you can use the military.com charity list to connect online.

If you’re not in the US, I’m sure other countries have similar programs.

Or I’m sure there are similar charities for other causes.


(Matthew Flinchbaugh) #11

I cannot believe that I missed this. I swear I looked at simulated temperature before but did not see that I could set temperature. thank you for your help guys I’m just learning smart things. This just taught me a lot.

as I said I am new. Started looking into the IDE too much yet.


#12

Have fun!

For clarity, SmartTiles is a dashboard app from @625alex

And SmartTools from @joshua_lyon can be used for a lot of things, including voice control.

Both are great ways to repurpose an old phone/tablet for use with ST. :blush:


(sidjohn1) #13

This is how I use my old iOS hardware, should be easier with android.