Hi All,
I’m trying to write a smartapp that continually monitors a smartsense multi for the state of a single axis. When the axis is in a certain range, it activates a switch. I can’t find any code related to this. Any help would be greatly appreciated.
Thanks!
Shane
imbrian
(Im Brian)
January 10, 2014, 12:36pm
2
@shanemhoffmangmail-com This uses the 3-axis sensor, but it does not check a range:
/**
* Safe Watch
*
* Author: brian@bevey.org
* Date: 2013-11-17
*
* Watch a series of sensors for any anomalies for securing a safe or room.
*/
preferences {
section("Things to secure?") {
input "contact", "capability.contactSensor", title: "Contact Sensor", required: false
input "motion", "capability.motionSensor", title: "Motion Sensor", required: false
input "knock", "capability.accelerationSensor", title: "Knock Sensor", required: false
input "axis", "capability.threeAxis", title: "Three-Axis Sensor", required: false
}
section("Temperature monitor?") {
input "temp", "capability.temperatureMeasurement", title: "Temp Sensor", required: false
input "maxTemp", "number", title: "Max Temp?", required: false
This file has been truncated. show original
Once the 3axis event fires, you’d just need to:
def orientation = sensor.latestStaet(‘threeAxis’)
You can find a specific axis value with:
orientation.xyzValue.x
Edit:
Here’s a pretty good example:
https://smartthings.zendesk.com/entries/21603744-Garage-Door-Monitor