mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-29 06:13:07 +01:00
Compare commits
1 Commits
MSA-1848-1
...
MSA-1845-1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a001fa409b |
@@ -1,2 +0,0 @@
|
|||||||
.st-ignore
|
|
||||||
README.md
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
# Aeon Siren
|
|
||||||
|
|
||||||
Cloud Execution
|
|
||||||
|
|
||||||
Works with:
|
|
||||||
|
|
||||||
* [Aeon Labs Siren (Gen 5)](https://www.smartthings.com/works-with-smartthings/aeon-labs/aeon-labs-siren-gen-5)
|
|
||||||
|
|
||||||
## Table of contents
|
|
||||||
|
|
||||||
* [Capabilities](#capabilities)
|
|
||||||
* [Health](#device-health)
|
|
||||||
|
|
||||||
## Capabilities
|
|
||||||
|
|
||||||
* **Actuator** - represents that a Device has commands
|
|
||||||
* **Alarm** - allows for interacting with devices that serve as alarms
|
|
||||||
* **Switch** - can detect state (possible values: on/off)
|
|
||||||
* **Health Check** - indicates ability to get device health notifications
|
|
||||||
|
|
||||||
## Device Health
|
|
||||||
|
|
||||||
Aeon Labs Siren (Gen 5) is polled by the hub.
|
|
||||||
As of hubCore version 0.14.38 the hub sends up reports every 15 minutes regardless of whether the state changed.
|
|
||||||
Device-Watch allows 2 check-in misses from device plus some lag time. So Check-in interval = (2*15 + 2)mins = 32 mins.
|
|
||||||
Not to mention after going OFFLINE when the device is plugged back in, it might take a considerable amount of time for
|
|
||||||
the device to appear as ONLINE again. This is because if this listening device does not respond to two poll requests in a row,
|
|
||||||
it is not polled for 5 minutes by the hub. This can delay up the process of being marked ONLINE by quite some time.
|
|
||||||
|
|
||||||
* __32min__ checkInterval
|
|
||||||
|
|
||||||
## Troubleshooting
|
|
||||||
|
|
||||||
If the device doesn't pair when trying from the SmartThings mobile app, it is possible that the device is out of range.
|
|
||||||
Pairing needs to be tried again by placing the device closer to the hub.
|
|
||||||
Instructions related to pairing, resetting and removing the device from SmartThings can be found in the following link:
|
|
||||||
* [Aeon Labs Siren (Gen 5) Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/204555240-Aeon-Labs-Siren-Gen-5-)
|
|
||||||
@@ -20,11 +20,10 @@ metadata {
|
|||||||
capability "Actuator"
|
capability "Actuator"
|
||||||
capability "Alarm"
|
capability "Alarm"
|
||||||
capability "Switch"
|
capability "Switch"
|
||||||
capability "Health Check"
|
|
||||||
|
|
||||||
command "test"
|
command "test"
|
||||||
|
|
||||||
fingerprint deviceId: "0x1005", inClusters: "0x5E,0x98", deviceJoinName: "Aeon Labs Siren (Gen 5)"
|
fingerprint deviceId: "0x1005", inClusters: "0x5E,0x98"
|
||||||
}
|
}
|
||||||
|
|
||||||
simulator {
|
simulator {
|
||||||
@@ -59,9 +58,6 @@ metadata {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def updated() {
|
def updated() {
|
||||||
// Device-Watch simply pings if no device events received for 32min(checkInterval)
|
|
||||||
sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
|
||||||
|
|
||||||
if(!state.sound) state.sound = 1
|
if(!state.sound) state.sound = 1
|
||||||
if(!state.volume) state.volume = 3
|
if(!state.volume) state.volume = 3
|
||||||
|
|
||||||
@@ -152,10 +148,3 @@ def test() {
|
|||||||
private secure(physicalgraph.zwave.Command cmd) {
|
private secure(physicalgraph.zwave.Command cmd) {
|
||||||
zwave.securityV1.securityMessageEncapsulation().encapsulate(cmd).format()
|
zwave.securityV1.securityMessageEncapsulation().encapsulate(cmd).format()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* PING is used by Device-Watch in attempt to reach the Device
|
|
||||||
* */
|
|
||||||
def ping() {
|
|
||||||
secure(zwave.basicV1.basicGet())
|
|
||||||
}
|
|
||||||
@@ -106,12 +106,6 @@ def parse(String description) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (map.name == "temperature") {
|
|
||||||
if (tempOffset) {
|
|
||||||
map.value = (int) map.value + (int) tempOffset
|
|
||||||
}
|
|
||||||
map.descriptionText = temperatureScale == 'C' ? '{{ device.displayName }} was {{ value }}°C' : '{{ device.displayName }} was {{ value }}°F'
|
|
||||||
map.translatable = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
log.debug "Parse returned $map"
|
log.debug "Parse returned $map"
|
||||||
|
|||||||
@@ -112,12 +112,6 @@ def parse(String description) {
|
|||||||
map = getMotionResult(value)
|
map = getMotionResult(value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (map.name == "temperature") {
|
|
||||||
if (tempOffset) {
|
|
||||||
map.value = (int) map.value + (int) tempOffset
|
|
||||||
}
|
|
||||||
map.descriptionText = temperatureScale == 'C' ? '{{ device.displayName }} was {{ value }}°C' : '{{ device.displayName }} was {{ value }}°F'
|
|
||||||
map.translatable = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
log.debug "Parse returned $map"
|
log.debug "Parse returned $map"
|
||||||
|
|||||||
@@ -95,12 +95,6 @@ def parse(String description) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (map.name == "temperature") {
|
|
||||||
if (tempOffset) {
|
|
||||||
map.value = (int) map.value + (int) tempOffset
|
|
||||||
}
|
|
||||||
map.descriptionText = temperatureScale == 'C' ? '{{ device.displayName }} was {{ value }}°C' : '{{ device.displayName }} was {{ value }}°F'
|
|
||||||
map.translatable = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
log.debug "Parse returned $map"
|
log.debug "Parse returned $map"
|
||||||
|
|||||||
@@ -88,12 +88,6 @@ def parse(String description) {
|
|||||||
log.warn "TEMP REPORTING CONFIG FAILED- error code: ${descMap.data[0]}"
|
log.warn "TEMP REPORTING CONFIG FAILED- error code: ${descMap.data[0]}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (map.name == "temperature") {
|
|
||||||
if (tempOffset) {
|
|
||||||
map.value = (int) map.value + (int) tempOffset
|
|
||||||
}
|
|
||||||
map.descriptionText = temperatureScale == 'C' ? '{{ device.displayName }} was {{ value }}°C' : '{{ device.displayName }} was {{ value }}°F'
|
|
||||||
map.translatable = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
log.debug "Parse returned $map"
|
log.debug "Parse returned $map"
|
||||||
|
|||||||
@@ -0,0 +1,111 @@
|
|||||||
|
/**
|
||||||
|
* smartelligynt smartthings event collector
|
||||||
|
*
|
||||||
|
* Copyright 2017 Rahul
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
definition(
|
||||||
|
name: "smartelligynt smartthings event collector",
|
||||||
|
namespace: "smartelligynt",
|
||||||
|
author: "Rahul",
|
||||||
|
description: "samsung smartthings event collector",
|
||||||
|
category: "SmartThings Labs",
|
||||||
|
iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png",
|
||||||
|
iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png",
|
||||||
|
iconX3Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png",
|
||||||
|
oauth: [displayName: "smartelligynt", displayLink: "http://www.smartelligynt.com"])
|
||||||
|
|
||||||
|
import groovy.json.JsonSlurper
|
||||||
|
|
||||||
|
preferences {
|
||||||
|
section("Select your devices to monitor with smartelligynt") {
|
||||||
|
input "switches", "capability.switch", title: "Switches", multiple: true, required: false
|
||||||
|
input "contacts", "capability.contactSensor", title: "Contact Sensors", multiple: true, required: false
|
||||||
|
input "accelerometers", "capability.accelerationSensor", title: "Accelerometers", multiple: true, required: false
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def installed() {
|
||||||
|
log.debug "Installed with settings: ${settings}"
|
||||||
|
|
||||||
|
initialize()
|
||||||
|
}
|
||||||
|
|
||||||
|
def updated() {
|
||||||
|
log.debug "Updated with settings: ${settings}"
|
||||||
|
|
||||||
|
unsubscribe()
|
||||||
|
initialize()
|
||||||
|
}
|
||||||
|
|
||||||
|
def initialize() {
|
||||||
|
// TODO: subscribe to attributes, devices, locations, etc.
|
||||||
|
log.debug "Updated with settings: ${settings}"
|
||||||
|
|
||||||
|
subscribeToDeviceEvents()
|
||||||
|
}
|
||||||
|
|
||||||
|
def subscribeToDeviceEvents() {
|
||||||
|
log.debug "Updated with settings: ${switches}"
|
||||||
|
if (null != accelerometers) {
|
||||||
|
subscribe(accelerometers, "acceleration", handleEvents)
|
||||||
|
}
|
||||||
|
if (null != switches) {
|
||||||
|
subscribe(switches, "switches", handleEvents)
|
||||||
|
}
|
||||||
|
if (null != contacts) {
|
||||||
|
subscribe(contacts, "contacts", handleEvents)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def handleEvents(evt) {
|
||||||
|
log.debug "$evt.displayName($evt.name:$evt.unit) $evt.value"
|
||||||
|
|
||||||
|
if (evt.unit != null) {
|
||||||
|
eventName = "$evt.displayName(${evt.name}_$evt.unit)"
|
||||||
|
}
|
||||||
|
def eventValue = "$evt.value"
|
||||||
|
|
||||||
|
postEvents(eventName, eventValue)
|
||||||
|
}
|
||||||
|
|
||||||
|
def postEvents(eventName, eventValue)
|
||||||
|
{
|
||||||
|
def epoch = now() / 1000
|
||||||
|
|
||||||
|
def jsonSlurper = new JsonSlurper()
|
||||||
|
def txt = "{ \"en\": \"$eventName\", \"ev\" : \"$eventValue\", \"et\" : $epoch }"
|
||||||
|
def object = jsonSlurper.parseText(txt)
|
||||||
|
|
||||||
|
def params = [
|
||||||
|
uri: "http://collect.smartelligynt.com/api/events/",
|
||||||
|
body:
|
||||||
|
object
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
try {
|
||||||
|
httpPostJson(params) { resp ->
|
||||||
|
resp.headers.each {
|
||||||
|
log.debug "${it.name} : ${it.value}"
|
||||||
|
}
|
||||||
|
log.debug "response status code: ${resp.status}"
|
||||||
|
log.debug "response data: ${resp.data}"
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
log.debug "something went wrong: $e"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO : Implement mappings
|
||||||
|
// TODO: implement event handlers
|
||||||
@@ -179,4 +179,4 @@ private flashLights() {
|
|||||||
delay += offFor
|
delay += offFor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user