Compare commits

..

18 Commits

Author SHA1 Message Date
Vinay Rao
f752a01906 Merge pull request #2108 from SmartThingsCommunity/staging
Rolling up staging to production for deploy
2017-06-20 11:29:13 -07:00
Vinay Rao
505ec4ff0f Merge pull request #2107 from larsfinander/DVCSMP-2703_OpenT2T_Update_6_20_submission_2_staging
DVCSMP-2703 OpenT2T: Update to 6/20 submission
2017-06-20 09:19:50 -07:00
Lars Finander
fe0f555f10 DVCSMP-2703 OpenT2T: Update to 6/20 submission 2017-06-20 10:17:49 -06:00
Vinay Rao
42353044e6 Merge pull request #2104 from SmartThingsCommunity/production
Rolling down production to staging
2017-06-19 18:31:41 -07:00
Vinay Rao
78f06a0b9d Merge pull request #2103 from workingmonk/bug/appengine_version
Fix circle ci issues with new artifactory server
2017-06-19 16:25:32 -07:00
Vinay Rao
7f13dd356d Fix circle ci issues with new artifactory server 2017-06-19 16:24:58 -07:00
Vinay Rao
4042bbbf98 Merge pull request #2102 from SmartThingsCommunity/bug/deploy_script2
DVCSMP-2701 Update Deployment Jobs to new Artifactory.
2017-06-19 14:24:34 -07:00
Vinay Rao
20407441d9 DVCSMP-2701 Update Deployment Jobs to new Artifactory. set build gradle to new artifactory server 2017-06-19 14:23:44 -07:00
Vinay Rao
52925d6d99 Merge pull request #2093 from dkirker/DVCSMP-2698
DVCSMP-2698 Temporary bandage to properly show valve states in the device tile of local running devices
2017-06-19 12:15:01 -07:00
Vinay Rao
e6c17131af Merge pull request #2101 from SmartThingsCommunity/bug/deploy_script
DVCSMP-2701 Update Deployment Jobs to new Artifactory
2017-06-19 11:27:21 -07:00
Vinay Rao
cc70865fbf DVCSMP-2701 Update Deployment Jobs to new Artifactory 2017-06-19 11:21:05 -07:00
Donald Kirker
e53d9c910c DVCSMP-2698 Temporary bandage to properly show valve states in the device tile of local running devices 2017-06-14 17:35:11 -07:00
Vinay Rao
c13014936b Merge pull request #2090 from SmartThingsCommunity/master
Rolling up master to staging
2017-06-13 15:25:30 -07:00
Vinay Rao
d6b0f6a8ed Merge pull request #2089 from SmartThingsCommunity/staging
Rolling down staging to master
2017-06-13 15:24:44 -07:00
Vinay Rao
62c810ba90 Merge pull request #2078 from dkirker/ICP-1110
ICP-1110 Read valve state during pairing
2017-06-13 15:23:07 -07:00
Vinay Rao
ea3abb26c0 Merge pull request #2088 from SmartThingsCommunity/staging
Rolling up staging to production
2017-06-13 14:10:07 -07:00
Donald Kirker
fb8e4a2416 ICP-1110 Read valve state during pairing 2017-06-07 23:47:13 -07:00
Vinay Rao
c4c2a3ffd7 Merge pull request #2072 from SmartThingsCommunity/staging
Rolling up staging to production
2017-06-06 11:35:06 -07:00
5 changed files with 32 additions and 338 deletions

View File

@@ -9,7 +9,7 @@ apply plugin: 'smartthings-slack'
buildscript {
dependencies {
classpath "com.smartthings.deployment:executable-deployment-scripts:1.0.11"
classpath "com.smartthings.deployment:executable-deployment-scripts:1.0.12"
}
repositories {
mavenLocal()
@@ -19,7 +19,7 @@ buildscript {
username smartThingsArtifactoryUserName
password smartThingsArtifactoryPassword
}
url "https://artifactory.smartthings.com/libs-release-local"
url "https://smartthings.jfrog.io/smartthings/libs-release-local"
}
}
}
@@ -32,7 +32,7 @@ repositories {
username smartThingsArtifactoryUserName
password smartThingsArtifactoryPassword
}
url "https://artifactory.smartthings.com/libs-release-local"
url "https://smartthings.jfrog.io/smartthings/libs-release-local"
}
}
@@ -51,10 +51,10 @@ sourceSets {
dependencies {
devicetypesCompile 'org.codehaus.groovy:groovy-all:2.4.7'
devicetypesCompile 'smartthings:appengine-z-wave:0.1.2'
devicetypesCompile 'smartthings:appengine-zigbee:0.1.11'
devicetypesCompile 'smartthings:appengine-z-wave:0.1.3'
devicetypesCompile 'smartthings:appengine-zigbee:0.1.12'
smartappsCompile 'org.codehaus.groovy:groovy-all:2.4.7'
smartappsCompile 'smartthings:appengine-common:0.1.8'
smartappsCompile 'smartthings:appengine-common:0.1.9'
smartappsCompile 'org.codehaus.groovy.modules.http-builder:http-builder:0.7.1'
smartappsCompile 'org.grails:grails-web:2.3.11'
smartappsCompile 'org.json:json:20140107'
@@ -74,19 +74,19 @@ slackSendMessage {
String username
switch (branch) {
case 'master':
username = 'Hickory'
username = 'DEV'
iconUrl = wolverine
color = '#35D0F2'
messageText = 'Began deployment of _SmartThingsPublic[master]_ branch to the _Dev_ environments.'
break
case 'staging':
username = 'Dickory'
username = 'STG'
iconUrl = beach
color = '#FFDE20'
messageText = 'Began deployment of _SmartThingsPublic[staging]_ branch to the _Staging_ environments.'
break
case 'production':
username = 'Dock'
username = 'PRD'
iconUrl = drinks
color = '#FF1D23'
messageText = 'Began deployment of _SmartThingsPublic[production]_ branch to the _Prod_ environments.'

View File

@@ -35,8 +35,8 @@ metadata {
// tile definitions
tiles(scale: 2) {
multiAttributeTile(name:"valve", type: "generic", width: 6, height: 4, canChangeIcon: true){
tileAttribute ("device.valve", key: "PRIMARY_CONTROL") {
multiAttributeTile(name:"contact", type: "generic", width: 6, height: 4, canChangeIcon: true){
tileAttribute ("device.contact", key: "PRIMARY_CONTROL") {
attributeState "open", label: '${name}', action: "valve.close", icon: "st.valves.water.open", backgroundColor: "#00A0DC", nextState:"closing"
attributeState "closed", label: '${name}', action: "valve.open", icon: "st.valves.water.closed", backgroundColor: "#ffffff", nextState:"opening"
attributeState "opening", label: '${name}', action: "valve.close", icon: "st.valves.water.open", backgroundColor: "#00A0DC"
@@ -48,14 +48,16 @@ metadata {
state "default", label:'', action:"refresh.refresh", icon:"st.secondary.refresh"
}
main "valve"
details(["valve","refresh"])
main "contact"
details(["contact","refresh"])
}
}
def installed(){
// 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])
response(refresh())
}
def updated(){
@@ -85,11 +87,17 @@ def zwaveEvent(physicalgraph.zwave.Command cmd) {
}
def open() {
zwave.switchBinaryV1.switchBinarySet(switchValue: 0x00).format()
delayBetween([
zwave.switchBinaryV1.switchBinarySet(switchValue: 0x00).format(),
zwave.switchBinaryV1.switchBinaryGet().format()
], 500)
}
def close() {
zwave.switchBinaryV1.switchBinarySet(switchValue: 0xFF).format()
delayBetween([
zwave.switchBinaryV1.switchBinarySet(switchValue: 0xFF).format(),
zwave.switchBinaryV1.switchBinaryGet().format()
], 500)
}
/**
@@ -105,6 +113,6 @@ def refresh() {
def createEventWithDebug(eventMap) {
def event = createEvent(eventMap)
log.debug "Event created with ${event?.descriptionText}"
log.debug "Event created with ${event?.name}:${event?.value} - ${event?.descriptionText}"
return event
}

View File

@@ -38,8 +38,8 @@ metadata {
}
tiles(scale: 2) {
multiAttributeTile(name:"valve", type: "generic", width: 6, height: 4, canChangeIcon: true){
tileAttribute ("device.valve", key: "PRIMARY_CONTROL") {
multiAttributeTile(name:"contact", type: "generic", width: 6, height: 4, canChangeIcon: true){
tileAttribute ("device.contact", key: "PRIMARY_CONTROL") {
attributeState "open", label: '${name}', action: "valve.close", icon: "st.valves.water.open", backgroundColor: "#00A0DC", nextState:"closing"
attributeState "closed", label: '${name}', action: "valve.open", icon: "st.valves.water.closed", backgroundColor: "#ffffff", nextState:"opening"
attributeState "opening", label: '${name}', action: "valve.close", icon: "st.valves.water.open", backgroundColor: "#00A0DC", nextState:"closing"
@@ -58,8 +58,8 @@ metadata {
state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh"
}
main(["valve"])
details(["valve", "battery", "refresh"])
main(["contact"])
details(["contact", "battery", "refresh"])
}
}

View File

@@ -1,317 +0,0 @@
/**
* RealApplication_CA
*
* Copyright 2017 Venkata Kishore Chilakala
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
* for the specific language governing permissions and limitations under the License.
*
*/
definition(
name: "RealApplication_CA",
namespace: "CA",
author: "Venkata Kishore Chilakala",
description: "myApp",
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")
preferences {
section("Allow External Service to Control These Things...")
{
input "motions", "capability.motionSensor", title: "Which Motion Sensors?", multiple: true, required: false
input "contacts", "capability.contactSensor",title: "Which Contact Sensor?", multiple: true, required: false
input "presences", "capability.presenceSensor",title: "Which Presence Sensor?", multiple: true, required: false
input "switches", "capability.switchLevel", title: "Which Switches?", multiple: true, required: false
input "levelSwitches","capability.switchLevel",title: "Which Level Switch?",multiple: true, required:false
input "relativeHumidity","capability.relativeHumidityMeasurement",title: "Humidity",multiple:true,required:false
input "temperature","capability.temperatureMeasurement",title: "Temperature Measurement",multiple:true,required:false
input "lock","capability.lock",title: "Door Lock", multiple:true,required:false
input "hubs",title: "Hubs",multiple:false,required:false
}
}
def installed() {
initialize()
}
def updated() {
initialize()
}
mappings {
path("/devices")
{
action:[
GET:"listDevices"
]
}
path("/hubs") {
log.debug "list action"
action: [
GET: "listAll"
]
}
path("/switches") {
action: [
GET:"listSwitches",
PUT:"updateSwitches"
]
}
path("/switches/:id") {
action: [
GET:"showSwitch",
PUT:"updateSwitch"
]
}
path("/levelSwitches") {
action: [
GET:"listLevelSwitches",
PUT:"updateLevelSwitches"
]
}
path("/levelSwitches/:id") {
action: [
GET:"showLevelSwitch",
PUT:"updateLevelSwitch"
]
}
path("/motions") {
action: [
GET:"listMotions",
PUT:"updateMotions"
]
}
path("/motions/:id"){
action:[
GET:"showMotion",
PUT:"updateMotion"
]
}
path("/presences")
{
action:[
GET:"listPresenceSensor",
PUT:"updatePresenceSensor"
]
}
path("/presences/:id")
{
action:[
GET:"showPresence",
PUT:"updatePresence"
]
}
path("/locks") {
action: [
GET:"listLocks",
PUT:"updateLocks"
]
}
path("/locks/:id") {
action: [
GET:"showLock",
PUT:"updateLock"
]
}
path("/contacts")
{
action: [
GET: "listContacts",
PUP: "updateContacts"
]
}
path ("/contacts/:id")
{
action:[
GET:"showContact",
PUT:"updateContact"
]
}
}
def listAll()
{
[location_id :location.id,hub_id:location.hubs*.id,hub_type:location.hubs*.type,hub_name:location.hubs*.name,hub_firm_ver:location.hubs*.firmwareVersionString,hub_ip:location.hubs*.localIP,hub_port:location.hubs*.localSrvPortTCP]
}
def listSwitches() {
switches.collect { device(it,"switch") }
}
void updateSwitches() {
updateAll(switches)
}
def showSwitch() {
show(switches, "switch")
}
void updateSwitch() {
update(switches)
}
def listLevelSwitches() {
levelSwitches.collect { device(it,"level") }
// motions.collect { device(it,"motion") }
}
void updateLevelSwitches() {
updateAll(levelSwitches)
}
def showLevelSwitch() {
show(levelSwitches, "level")
}
void updateLevelSwitch() {
update(levelSwitches)
}
def listLocks() {
lock.collect { device(it,"lock") }
}
void updateLocks() {
updateAll(lock)
}
def showLock() {
show(lock, "lock")
}
void updateLock() {
update(lock)
}
def listMotions() {
motions.collect { device(it,"motion") }
}
void updateMotions()
{
updateAll(motions)
}
def showMotion()
{
show(motions, "motion")
}
void updateMotion()
{
update(motions)
}
def listPresenceSensor()
{
presences.collect{device(it,"presence")}
}
void updatePresenceSensor()
{
updateAll(presences)
}
def showPresence()
{
show(presences,"presence")
}
void updatePresence()
{
update(presences)
}
def listContacts(){
contacts.collect{device(it,"contact")}
}
void updateContacts()
{
updateAll(contacts)
}
def showContact()
{
show(contacts,"contact")
}
void updateContact()
{
update(contacts)
}
private device(it, name) {
if (it) {
def s = it.currentState(name)
[
id: it.id,
name: it.displayName,
label: it.displayName,
hub_name: it.hub.name,
hub_id: it.hub.id,
hub_ip: it.hub.localIP,
hub_port: it.hub.localSrvPortTCP,
state: s
]
}
}
private void updateAll(devices) {
def command = request.JSON?.command
if (command) {
devices."$command"()
}
}
private show(devices, name) {
def device = devices.find { it.id == params.id }
if (!device) {
httpError(404, "Device not found")
}
else {
log.debug " state s :: ${s}"
log.debug "devices :: ${devices}"
log.debug "name :: ${name}"
def s = device.currentState(name)
[id: device.id, label: device.displayName, name: device.displayName,state:s]
}
}
private void update(devices) {
log.debug "update, request: ${request.JSON}, params: ${params}, devices: $devices.id"
def command = request.JSON?.command
def value = request.JSON?.value
log.debug "$value"
log.debug "$command"
if (command) {
def device = devices.find { it.id == params.id }
if (!device) {
httpError(404, "Device not found")
} else {
if("$command"=="on")
{
device."$command"()
}else if("$command"=="off")
{
device."$command"()
}else if("$command"=="lock")
{
device."$command"()
}else if("$command"=="unlock")
{
device."$command"()
}else
{
device.setLevel("$command")
}
}
}
}
def initialize() {
}

View File

@@ -195,7 +195,10 @@ def registerDeviceChange() {
state.deviceSubscriptionMap.put(deviceId, [subscriptionEndpt])
log.info "Added subscription URL: ${subscriptionEndpt} for ${myDevice.displayName}"
} else if (!state.deviceSubscriptionMap[deviceId].contains(subscriptionEndpt)) {
state.deviceSubscriptionMap[deviceId] << subscriptionEndpt
// state.deviceSubscriptionMap[deviceId] << subscriptionEndpt
// For now, we will only have one subscription endpoint per device
state.deviceSubscriptionMap.remove(deviceId)
state.deviceSubscriptionMap.put(deviceId, [subscriptionEndpt])
log.info "Added subscription URL: ${subscriptionEndpt} for ${myDevice.displayName}"
}