├── devicetypes ├── smartthings │ ├── cree-bulb.src │ │ ├── .st-ignore │ │ └── README.md │ ├── zigbee-dimmer.src │ │ ├── .st-ignore │ │ └── README.md │ ├── smartpower-outlet.src │ │ ├── .st-ignore │ │ ├── i18n │ │ │ └── messages.properties │ │ └── README.md │ ├── zigbee-rgbw-bulb.src │ │ ├── .st-ignore │ │ └── README.md │ ├── smartsense-motion-sensor.src │ │ ├── .st-ignore │ │ ├── i18n │ │ │ └── messages.properties │ │ └── README.md │ ├── smartsense-multi-sensor.src │ │ ├── .st-ignore │ │ ├── i18n │ │ │ └── messages.properties │ │ └── README.md │ ├── tyco-door-window-sensor.src │ │ ├── .st-ignore │ │ └── README.md │ ├── smartsense-moisture-sensor.src │ │ ├── .st-ignore │ │ ├── i18n │ │ │ └── messages.properties │ │ └── README.md │ ├── smartsense-open-closed-sensor.src │ │ ├── .st-ignore │ │ └── README.md │ ├── smartsense-temp-humidity-sensor.src │ │ ├── .st-ignore │ │ └── README.md │ ├── zigbee-white-color-temperature-bulb.src │ │ ├── .st-ignore │ │ └── README.md │ ├── mobile-presence.src │ │ └── i18n │ │ │ └── messages.properties │ ├── arrival-sensor-ha.src │ │ └── i18n │ │ │ └── messages.properties │ ├── unknown.src │ │ └── unknown.groovy │ ├── particulate-detector.src │ │ └── particulate-detector.groovy │ ├── thing.src │ │ └── thing.groovy │ ├── testing │ │ ├── simulated-color-control.src │ │ │ └── simulated-color-control.groovy │ │ ├── simulated-water-valve.src │ │ │ └── simulated-water-valve.groovy │ │ ├── simulated-contact-sensor.src │ │ │ └── simulated-contact-sensor.groovy │ │ ├── simulated-motion-sensor.src │ │ │ └── simulated-motion-sensor.groovy │ │ ├── simulated-presence-sensor.src │ │ │ └── simulated-presence-sensor.groovy │ │ ├── simulated-button.src │ │ │ └── simulated-button.groovy │ │ ├── simulated-lock.src │ │ │ └── simulated-lock.groovy │ │ ├── simulated-water-sensor.src │ │ │ └── simulated-water-sensor.groovy │ │ ├── simulated-switch.src │ │ │ └── simulated-switch.groovy │ │ └── simulated-smoke-alarm.src │ │ │ └── simulated-smoke-alarm.groovy │ ├── zwave-remote.src │ │ └── zwave-remote.groovy │ ├── on-off-button-tile.src │ │ └── on-off-button-tile.groovy │ ├── spark.src │ │ └── spark.groovy │ ├── arduino-thingshield.src │ │ └── arduino-thingshield.groovy │ ├── momentary-button-tile.src │ │ └── momentary-button-tile.groovy │ ├── door-shield.src │ │ └── door-shield.groovy │ ├── tile-ux │ │ ├── tile-basic-colorwheel.src │ │ │ └── tile-basic-colorwheel.groovy │ │ ├── README.md │ │ ├── tile-basic-presence.src │ │ │ └── tile-basic-presence.groovy │ │ └── tile-basic-slider.src │ │ │ └── tile-basic-slider.groovy │ ├── open-closed-sensor.src │ │ └── open-closed-sensor.groovy │ ├── light-sensor.src │ │ └── light-sensor.groovy │ ├── pet-feeder-shield.src │ │ └── pet-feeder-shield.groovy │ ├── motion-detector.src │ │ └── motion-detector.groovy │ ├── smartpower-outlet-v1.src │ │ └── smartpower-outlet-v1.groovy │ ├── logitech-harmony-hub-c2c.src │ │ └── logitech-harmony-hub-c2c.groovy │ ├── on-off-shield.src │ │ └── on-off-shield.groovy │ ├── zwave-controller.src │ │ └── zwave-controller.groovy │ └── ecobee-sensor.src │ │ └── ecobee-sensor.groovy ├── capabilities │ ├── water-sensor-capability.src │ │ └── water-sensor-capability.groovy │ ├── contact-sensor-capability.src │ │ └── contact-sensor-capability.groovy │ ├── motion-sensor-capability.src │ │ └── motion-sensor-capability.groovy │ ├── illuminance-measurement-capability.src │ │ └── illuminance-measurement-capability.groovy │ ├── presence-sensor-capability.src │ │ └── presence-sensor-capability.groovy │ ├── relative-humidity-measurement-capability.src │ │ └── relative-humidity-measurement-capability.groovy │ ├── acceleration-sensor-capability.src │ │ └── acceleration-sensor-capability.groovy │ ├── three-axis-capability.src │ │ └── three-axis-capability.groovy │ ├── momentary-capability.src │ │ └── momentary-capability.groovy │ ├── switch-capability.src │ │ └── switch-capability.groovy │ ├── temperature-measurement-capability.src │ │ └── temperature-measurement-capability.groovy │ ├── button-capability.src │ │ └── button-capability.groovy │ └── lock-capability.src │ │ └── lock-capability.groovy ├── dianoga │ ├── netatmo-rain.src │ │ └── netatmo-rain.groovy │ ├── netatmo-additional-module.src │ │ └── netatmo-additional-module.groovy │ └── netatmo-outdoor-module.src │ │ └── netatmo-outdoor-module.groovy └── wackford │ ├── quirky-wink-nimbus.src │ └── quirky-wink-nimbus.groovy │ └── quirky-wink-powerstrip.src │ └── quirky-wink-powerstrip.groovy ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── smartapps ├── smartthings │ ├── bose-soundtouch-control.src │ │ └── images │ │ │ ├── BoseST_icon.png │ │ │ ├── BoseST_icon@2x.png │ │ │ └── BoseST_icon@2x-1.png │ ├── brighten-my-path.src │ │ └── brighten-my-path.groovy │ ├── darken-behind-me.src │ │ └── darken-behind-me.groovy │ ├── lights-off-when-closed.src │ │ └── lights-off-when-closed.groovy │ ├── big-turn-off.src │ │ └── big-turn-off.groovy │ ├── big-turn-on.src │ │ └── big-turn-on.groovy │ ├── feed-my-pet.src │ │ └── feed-my-pet.groovy │ ├── garage-door-opener.src │ │ └── garage-door-opener.groovy │ ├── notify-me-when-it-opens.src │ │ └── notify-me-when-it-opens.groovy │ ├── turn-it-on-when-it-opens.src │ │ └── turn-it-on-when-it-opens.groovy │ ├── notify-me-when.src │ │ └── i18n │ │ │ └── messages.properties │ ├── dry-the-wetspot.src │ │ └── dry-the-wetspot.groovy │ ├── undead-early-warning.src │ │ └── undead-early-warning.groovy │ ├── let-there-be-light.src │ │ └── let-there-be-light.groovy │ ├── turn-on-only-if-i-arrive-after-sunset.src │ │ └── turn-on-only-if-i-arrive-after-sunset.groovy │ ├── unlock-it-when-i-arrive.src │ │ └── unlock-it-when-i-arrive.groovy │ ├── light-up-the-night.src │ │ └── light-up-the-night.groovy │ ├── presence-change-push.src │ │ └── presence-change-push.groovy │ ├── turn-it-on-for-5-minutes.src │ │ └── turn-it-on-for-5-minutes.groovy │ ├── brighten-dark-places.src │ │ └── brighten-dark-places.groovy │ ├── turn-it-on-when-im-here.src │ │ └── turn-it-on-when-im-here.groovy │ ├── text-me-when-it-opens.src │ │ └── text-me-when-it-opens.groovy │ ├── power-allowance.src │ │ └── power-allowance.groovy │ ├── once-a-day.src │ │ └── once-a-day.groovy │ ├── habit-helper.src │ │ └── habit-helper.groovy │ ├── energy-saver.src │ │ └── energy-saver.groovy │ ├── smartweather-station-controller.src │ │ └── smartweather-station-controller.groovy │ ├── flood-alert.src │ │ └── flood-alert.groovy │ ├── the-gun-case-moved.src │ │ └── the-gun-case-moved.groovy │ └── camera-power-scheduler.src │ │ └── camera-power-scheduler.groovy ├── com-vinli-smartthings │ └── vinli-home-connect.src │ │ └── images │ │ ├── vinli_oauth_60.png │ │ └── vinli_oauth_120.png ├── dooglave │ └── let-there-be-dark.src │ │ └── let-there-be-dark.groovy ├── resteele │ └── monitor-on-sense.src │ │ └── monitor-on-sense.groovy ├── skp19 │ └── door-lock-code-distress-message.src │ │ └── door-lock-code-distress-message.groovy ├── hwustrack │ └── coffee-after-shower.src │ │ └── coffee-after-shower.groovy ├── imbrianj │ ├── hall-light-welcome-home.src │ │ └── hall-light-welcome-home.groovy │ └── door-knocker.src │ │ └── door-knocker.groovy ├── sidjohn1 │ └── smart-turn-it-on.src │ │ └── smart-turn-it-on.groovy ├── dianoga │ └── thermostat-auto-off.src │ │ └── thermostat-auto-off.groovy ├── kristopherkubicki │ └── turn-off-with-motion.src │ │ └── turn-off-with-motion.groovy └── johnrucker │ └── door-jammed-notification.src │ └── door-jammed-notification.groovy ├── .gitignore ├── README.md ├── settings.gradle ├── circle.yml └── gradlew.bat /devicetypes/smartthings/cree-bulb.src/.st-ignore: -------------------------------------------------------------------------------- 1 | .st-ignore 2 | README.md 3 | -------------------------------------------------------------------------------- /devicetypes/smartthings/zigbee-dimmer.src/.st-ignore: -------------------------------------------------------------------------------- 1 | .st-ignore 2 | README.md 3 | -------------------------------------------------------------------------------- /devicetypes/smartthings/smartpower-outlet.src/.st-ignore: -------------------------------------------------------------------------------- 1 | .st-ignore 2 | README.md 3 | -------------------------------------------------------------------------------- /devicetypes/smartthings/zigbee-rgbw-bulb.src/.st-ignore: -------------------------------------------------------------------------------- 1 | .st-ignore 2 | README.md 3 | -------------------------------------------------------------------------------- /devicetypes/smartthings/smartsense-motion-sensor.src/.st-ignore: -------------------------------------------------------------------------------- 1 | .st-ignore 2 | README.md 3 | -------------------------------------------------------------------------------- /devicetypes/smartthings/smartsense-multi-sensor.src/.st-ignore: -------------------------------------------------------------------------------- 1 | .st-ignore 2 | README.md 3 | -------------------------------------------------------------------------------- /devicetypes/smartthings/tyco-door-window-sensor.src/.st-ignore: -------------------------------------------------------------------------------- 1 | .st-ignore 2 | README.md 3 | -------------------------------------------------------------------------------- /devicetypes/smartthings/smartsense-moisture-sensor.src/.st-ignore: -------------------------------------------------------------------------------- 1 | .st-ignore 2 | README.md 3 | -------------------------------------------------------------------------------- /devicetypes/smartthings/smartsense-open-closed-sensor.src/.st-ignore: -------------------------------------------------------------------------------- 1 | .st-ignore 2 | README.md 3 | -------------------------------------------------------------------------------- /devicetypes/smartthings/smartsense-temp-humidity-sensor.src/.st-ignore: -------------------------------------------------------------------------------- 1 | .st-ignore 2 | README.md 3 | -------------------------------------------------------------------------------- /devicetypes/smartthings/zigbee-white-color-temperature-bulb.src/.st-ignore: -------------------------------------------------------------------------------- 1 | .st-ignore 2 | README.md 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bs/SmartThingsPublic/master/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /smartapps/smartthings/bose-soundtouch-control.src/images/BoseST_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bs/SmartThingsPublic/master/smartapps/smartthings/bose-soundtouch-control.src/images/BoseST_icon.png -------------------------------------------------------------------------------- /smartapps/smartthings/bose-soundtouch-control.src/images/BoseST_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bs/SmartThingsPublic/master/smartapps/smartthings/bose-soundtouch-control.src/images/BoseST_icon@2x.png -------------------------------------------------------------------------------- /smartapps/smartthings/bose-soundtouch-control.src/images/BoseST_icon@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bs/SmartThingsPublic/master/smartapps/smartthings/bose-soundtouch-control.src/images/BoseST_icon@2x-1.png -------------------------------------------------------------------------------- /smartapps/com-vinli-smartthings/vinli-home-connect.src/images/vinli_oauth_60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bs/SmartThingsPublic/master/smartapps/com-vinli-smartthings/vinli-home-connect.src/images/vinli_oauth_60.png -------------------------------------------------------------------------------- /smartapps/com-vinli-smartthings/vinli-home-connect.src/images/vinli_oauth_120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bs/SmartThingsPublic/master/smartapps/com-vinli-smartthings/vinli-home-connect.src/images/vinli_oauth_120.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Feb 25 08:56:06 CST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-bin.zip 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Eclipse files 2 | /.settings 3 | /.classpath 4 | /.project 5 | /eclipse/ 6 | /target-eclipse 7 | 8 | # IntelliJ files 9 | *.iws 10 | *.iml 11 | .idea 12 | /out 13 | *.ipr 14 | 15 | # Gradle files 16 | .gradletasknamecache 17 | .gradle/ 18 | 19 | # Mac OS files 20 | .DS_Store 21 | 22 | # Build files 23 | /build 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SmartThings Public Github Repo 2 | 3 | An official list of SmartApps and Device Types from SmartThings. 4 | 5 | Here are some links to help you get started coding right away: 6 | 7 | * [Github-specific Documentation](http://docs.smartthings.com/en/latest/tools-and-ide/github-integration.html) 8 | * [Full Documentation](http://docs.smartthings.com) 9 | * [IDE & Simulator](http://ide.smartthings.com) 10 | * [Community Forums](http://community.smartthings.com) 11 | 12 | Follow us on the web: 13 | 14 | * Twitter: http://twitter.com/smartthingsdev 15 | * Facebook: http://facebook.com/smartthingsdevelopers 16 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This settings file was auto generated by the Gradle buildInit task 3 | * by 'jblaisdell' at '2/25/16 8:56 AM' with Gradle 2.10 4 | * 5 | * The settings file is used to specify which projects to include in your build. 6 | * In a single project build this file can be empty or even removed. 7 | * 8 | * Detailed information about configuring a multi-project build in Gradle can be found 9 | * in the user guide at https://docs.gradle.org/2.10/userguide/multi_project_builds.html 10 | */ 11 | 12 | /* 13 | // To declare projects as part of a multi-project build use the 'include' method 14 | include 'shared' 15 | include 'api' 16 | include 'services:webservice' 17 | */ 18 | 19 | rootProject.name = 'SmartThingsPublic' 20 | -------------------------------------------------------------------------------- /devicetypes/smartthings/mobile-presence.src/i18n/messages.properties: -------------------------------------------------------------------------------- 1 | # Copyright 2016 SmartThings 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 4 | # use this file except in compliance with the License. You may obtain a copy 5 | # of the License at: 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | # Korean (ko) 15 | # Device Preferences 16 | '''Give your device a name'''.ko=기기 이름 설정 17 | '''Set Device Image'''.ko=기기 이미지 설정 18 | # Events / Notifications 19 | '''{{ linkText }} has left'''.ko={{ linkText }} 외출 20 | '''{{ linkText }} has arrived'''.ko={{ linkText }} 귀가 21 | '''present'''.ko=집안 22 | '''not present'''.ko=외출 23 | -------------------------------------------------------------------------------- /devicetypes/smartthings/smartpower-outlet.src/i18n/messages.properties: -------------------------------------------------------------------------------- 1 | # Copyright 2016 SmartThings 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 4 | # use this file except in compliance with the License. You may obtain a copy 5 | # of the License at: 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | # Korean (ko) 15 | # Device Preferences 16 | '''Give your device a name'''.ko=기기 이름 설정 17 | '''Outlet'''.ko= 스마트 플러그 18 | # Events descriptionText 19 | '''{{ device.displayName }} is On'''.ko={{ device.displayName }} 켜짐 20 | '''{{ device.displayName }} is Off'''.ko={{ device.displayName }} 꺼짐 21 | '''{{ device.displayName }} power is {{ value }} Watts'''.ko={{ device.displayName }} 전력은 {{ value }}와트입니다. 22 | '''On'''.ko= 켜짐 23 | '''Off'''.ko=꺼짐 24 | '''Turning On'''.ko=켜는 중 25 | '''Turning Off'''.ko=끄는 중 26 | #============================================================================== 27 | -------------------------------------------------------------------------------- /devicetypes/smartthings/arrival-sensor-ha.src/i18n/messages.properties: -------------------------------------------------------------------------------- 1 | # Copyright 2016 SmartThings 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 4 | # use this file except in compliance with the License. You may obtain a copy 5 | # of the License at: 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | # Korean (ko) 15 | # Device Preferences 16 | '''Give your device a name'''.ko=기기 이름 설정 17 | '''Set Device Image'''.ko=기기 이미지 설정 18 | '''Presence timeout (minutes)'''.ko=알람 유예 시간 설정 (분) 19 | '''Tap to set'''.ko=눌러서 설정 20 | '''Arrival Sensor'''.ko=도착알림 센서 21 | '''${currentValue}% battery'''.ko=${currentValue}% 배터리 22 | # Events / Notifications 23 | '''{{ linkText }} battery was {{ value }}'''.ko={{ linkText }}의 남은 배터리 {{ value }} 24 | '''{{ linkText }} has arrived'''.ko={{ linkText }} 귀가 25 | '''{{ linkText }} has left'''.ko={{ linkText }} 외출 26 | #============================================================================== 27 | -------------------------------------------------------------------------------- /devicetypes/smartthings/unknown.src/unknown.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | definition (name: "Unknown", namespace: "smartthings", author: "SmartThings") { 16 | } 17 | 18 | // simulator metadata 19 | simulator { 20 | // Not Applicable to Unknown Device 21 | } 22 | 23 | // UI tile definitions 24 | tiles { 25 | standardTile("unknown", "device.unknown", width: 2, height: 2) { 26 | state(name:"default", icon:"st.unknown.unknown.unknown", backgroundColor:"#767676", label: "Unknown") 27 | } 28 | 29 | main "unknown" 30 | details "unknown" 31 | } 32 | } 33 | 34 | // Parse incoming device messages to generate events 35 | def parse(String description) { 36 | // None 37 | } 38 | -------------------------------------------------------------------------------- /devicetypes/smartthings/particulate-detector.src/particulate-detector.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | definition (name: "Particulate Detector", namespace: "smartthings", author: "SmartThings") { 16 | } 17 | 18 | // simulator metadata 19 | simulator { 20 | // TBD 21 | } 22 | 23 | // tile definitions 24 | tiles { 25 | standardTile("particulate", "device.particulate", width: 2, height: 2) { 26 | state "default", icon: "st.particulate.particulate.particulate", backgroundColor: "#ffffff" 27 | } 28 | 29 | main "particulate" 30 | details "particulate" 31 | } 32 | } 33 | 34 | // Parse incoming device messages to generate events 35 | def parse(String description) { 36 | // TBD 37 | } 38 | -------------------------------------------------------------------------------- /devicetypes/smartthings/thing.src/thing.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | //Thing is used while a device is in the process of being joined 15 | 16 | metadata { 17 | definition (name: "Thing", namespace: "smartthings", author: "SmartThings") { 18 | } 19 | 20 | // simulator metadata 21 | simulator { 22 | // Not Applicable to Thing Device 23 | } 24 | 25 | // UI tile definitions 26 | tiles { 27 | standardTile("thing", "device.thing", width: 2, height: 2) { 28 | state(name:"default", icon: "st.unknown.thing.thing-circle", label: "Please Wait") 29 | } 30 | 31 | main "thing" 32 | details "thing" 33 | } 34 | } 35 | 36 | // Parse incoming device messages to generate events 37 | def parse(String description) { 38 | // None 39 | } 40 | -------------------------------------------------------------------------------- /devicetypes/smartthings/testing/simulated-color-control.src/simulated-color-control.groovy: -------------------------------------------------------------------------------- 1 | metadata { 2 | definition (name: "Simulated Color Control", namespace: "smartthings/testing", author: "SmartThings") { 3 | capability "Color Control" 4 | capability "Sensor" 5 | capability "Actuator" 6 | } 7 | 8 | simulator { 9 | // TODO: define status and reply messages here 10 | } 11 | 12 | tiles { 13 | controlTile("rgbSelector", "device.color", "color", height: 3, width: 3, inactiveLabel: false) { 14 | state "color" 15 | } 16 | valueTile("saturation", "device.saturation", inactiveLabel: false, decoration: "flat") { 17 | state "saturation", label: 'Sat ${currentValue} ' 18 | } 19 | valueTile("hue", "device.hue", inactiveLabel: false, decoration: "flat") { 20 | state "hue", label: 'Hue ${currentValue} ' 21 | } 22 | main "rgbSelector" 23 | details(["rgbSelector", "saturation", "hue"]) 24 | } 25 | } 26 | 27 | // parse events into attributes 28 | def parse(String description) { 29 | log.debug "Parsing '${description}'" 30 | 31 | } 32 | 33 | def setSaturation(percent) { 34 | log.debug "Executing 'setSaturation'" 35 | sendEvent(name: "saturation", value: percent) 36 | } 37 | 38 | def setHue(percent) { 39 | log.debug "Executing 'setHue'" 40 | sendEvent(name: "hue", value: percent) 41 | } 42 | -------------------------------------------------------------------------------- /devicetypes/capabilities/water-sensor-capability.src/water-sensor-capability.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | definition (name: "Water Sensor Capability", namespace: "capabilities", author: "SmartThings") { 16 | capability "Water Sensor" 17 | } 18 | 19 | simulator { 20 | status "wet": "water:wet" 21 | status "dry": "water:dry" 22 | } 23 | 24 | tiles { 25 | standardTile("water", "device.water", width: 2, height: 2) { 26 | state "dry", icon:"st.alarm.water.dry", backgroundColor:"#ffffff" 27 | state "wet", icon:"st.alarm.water.wet", backgroundColor:"#53a7c0" 28 | } 29 | 30 | main "water" 31 | details "water" 32 | } 33 | } 34 | 35 | def parse(String description) { 36 | def pair = description.split(":") 37 | createEvent(name: pair[0].trim(), value: pair[1].trim()) 38 | } 39 | -------------------------------------------------------------------------------- /smartapps/dooglave/let-there-be-dark.src/let-there-be-dark.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Let There Be Dark! 3 | * Turn your lights off when a Contact Sensor is opened and turn them back on when it is closed, ONLY if the Lights were previouly on. 4 | * 5 | * Author: SmartThings modified by Douglas Rich 6 | */ 7 | definition( 8 | name: "Let There Be Dark!", 9 | namespace: "Dooglave", 10 | author: "Dooglave", 11 | description: "Turn your lights off when a Contact Sensor is opened and turn them back on when it is closed, ONLY if the Lights were previouly on", 12 | category: "Convenience", 13 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/light_contact-outlet.png", 14 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/light_contact-outlet@2x.png" 15 | ) 16 | 17 | preferences { 18 | section("When the door opens") { 19 | input "contact1", "capability.contactSensor", title: "Where?" 20 | } 21 | section("Turn off a light") { 22 | input "switch1", "capability.switch" 23 | } 24 | } 25 | 26 | def installed() { 27 | subscribe(contact1, "contact", contactHandler) 28 | } 29 | 30 | def updated() { 31 | unsubscribe() 32 | subscribe(contact1, "contact", contactHandler) 33 | } 34 | 35 | def contactHandler(evt) { 36 | log.debug "$evt.value" 37 | if (evt.value == "open") { 38 | state.wasOn = switch1.currentValue("switch") == "on" 39 | switch1.off() 40 | } 41 | 42 | if (evt.value == "closed") { 43 | if(state.wasOn)switch1.on() 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /devicetypes/smartthings/zwave-remote.src/zwave-remote.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | definition (name: "Z-Wave Remote", namespace: "smartthings", author: "SmartThings") { 16 | 17 | fingerprint deviceId: "0x01" 18 | } 19 | 20 | simulator { 21 | 22 | } 23 | 24 | tiles { 25 | standardTile("state", "device.state", width: 2, height: 2) { 26 | state "connected", label: "", icon: "st.unknown.zwave.remote-controller", backgroundColor: "#ffffff" 27 | } 28 | 29 | main "state" 30 | details "state" 31 | } 32 | } 33 | 34 | def parse(String description) { 35 | def result = null 36 | def cmd = zwave.parse(description) 37 | if (cmd) { 38 | result = createEvent(zwaveEvent(cmd)) 39 | } 40 | return result 41 | } 42 | 43 | def zwaveEvent(physicalgraph.zwave.Command cmd) { 44 | // Handles all Z-Wave commands we aren't interested in 45 | [:] 46 | } 47 | -------------------------------------------------------------------------------- /devicetypes/capabilities/contact-sensor-capability.src/contact-sensor-capability.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | definition (name: "Contact Sensor Capability", namespace: "capabilities", author: "SmartThings") { 16 | capability "Contact Sensor" 17 | } 18 | 19 | simulator { 20 | status "open": "contact:open" 21 | status "closed": "contact:closed" 22 | } 23 | 24 | tiles { 25 | standardTile("contact", "device.contact", width: 2, height: 2) { 26 | state("closed", label:'${name}', icon:"st.contact.contact.closed", backgroundColor:"#79b821") 27 | state("open", label:'${name}', icon:"st.contact.contact.open", backgroundColor:"#ffa81e") 28 | } 29 | main "contact" 30 | details "contact" 31 | } 32 | } 33 | 34 | def parse(String description) { 35 | def pair = description.split(":") 36 | createEvent(name: pair[0].trim(), value: pair[1].trim()) 37 | } 38 | -------------------------------------------------------------------------------- /devicetypes/capabilities/motion-sensor-capability.src/motion-sensor-capability.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | definition (name: "Motion Sensor Capability", namespace: "capabilities", author: "SmartThings") { 16 | capability "Motion Sensor" 17 | } 18 | 19 | simulator { 20 | status "active": "motion:active" 21 | status "inactive": "motion:inactive" 22 | } 23 | 24 | tiles { 25 | standardTile("motion", "device.motion", width: 2, height: 2) { 26 | state("inactive", label:'no motion', icon:"st.motion.motion.inactive", backgroundColor:"#ffffff") 27 | state("active", label:'motion', icon:"st.motion.motion.active", backgroundColor:"#53a7c0") 28 | } 29 | main "motion" 30 | details "motion" 31 | } 32 | } 33 | 34 | def parse(String description) { 35 | def pair = description.split(":") 36 | createEvent(name: pair[0].trim(), value: pair[1].trim()) 37 | } 38 | -------------------------------------------------------------------------------- /devicetypes/smartthings/cree-bulb.src/README.md: -------------------------------------------------------------------------------- 1 | # Connected Cree LED Bulb 2 | 3 | 4 | 5 | Works with: 6 | 7 | * [Connected Cree LED Bulb](https://support.smartthings.com/hc/en-us/articles/204258280-Cree-Connected-LED-Bulb) 8 | 9 | ## Table of contents 10 | 11 | * [Capabilities](#capabilities) 12 | * [Health](#device-health) 13 | 14 | ## Capabilities 15 | 16 | * **Actuator** - represents that a Device has commands 17 | * **Configuration** - _configure()_ command called when device is installed or device preferences updated 18 | * **Polling** - represents that poll() can be implemented for the device 19 | * **Refresh** - _refresh()_ command for status updates 20 | * **Switch** - can detect state (possible values: on/off) 21 | * **Switch Level** - represents current light level, usually 0-100 in percent 22 | * **Health Check** - indicates ability to get device health notifications 23 | 24 | ## Device Health 25 | 26 | A Category C6 Connected Cree LED Bulb with maxReportTime of 5 mins. 27 | Check-in interval = 12 mins 28 | 29 | ## Troubleshooting 30 | 31 | If the device doesn't pair when trying from the SmartThings mobile app, it is possible that the device is out of range. 32 | Pairing needs to be tried again by placing the device closer to the hub. 33 | Instructions related to pairing, resetting and removing the device from SmartThings can be found in the following link: 34 | * [Cree Connected LED Bulb Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/204258280-Cree-Connected-LED-Bulb) -------------------------------------------------------------------------------- /devicetypes/capabilities/illuminance-measurement-capability.src/illuminance-measurement-capability.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | definition (name: "Illuminance Measurement Capability", namespace: "capabilities", author: "SmartThings") { 16 | capability "Illuminance Measurement" 17 | } 18 | 19 | simulator { 20 | for (i in [0,5,10,15,20,30,40,50,100,200,300,400,600,800,1000]) { 21 | status "${i} lux": "illuminance:${i}" 22 | } 23 | } 24 | 25 | tiles { 26 | valueTile("illuminance", "device.illuminance", width: 2, height: 2) { 27 | state "luminosity", label:'${currentValue} ${unit}', unit:"lux" 28 | } 29 | main(["illuminance"]) 30 | details(["illuminance"]) 31 | } 32 | } 33 | 34 | // Parse incoming device messages to generate events 35 | def parse(String description) 36 | { 37 | def pair = description.split(":") 38 | createEvent(name: pair[0].trim(), value: pair[1].trim()) 39 | } 40 | -------------------------------------------------------------------------------- /devicetypes/capabilities/presence-sensor-capability.src/presence-sensor-capability.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | definition (name: "Presence Sensor Capability", namespace: "capabilities", author: "SmartThings") { 16 | capability "Presence Sensor" 17 | } 18 | 19 | simulator { 20 | status "present": "presence: present" 21 | status "not present": "presence: not present" 22 | } 23 | 24 | tiles { 25 | standardTile("presence", "device.presence", width: 2, height: 2) { 26 | state("not present", label:'not present', icon:"st.presence.tile.not-present", backgroundColor:"#ffffff") 27 | state("present", label:'present', icon:"st.presence.tile.present", backgroundColor:"#53a7c0") 28 | } 29 | main "presence" 30 | details "presence" 31 | } 32 | } 33 | 34 | def parse(String description) { 35 | def pair = description.split(":") 36 | createEvent(name: pair[0].trim(), value: pair[1].trim()) 37 | } 38 | -------------------------------------------------------------------------------- /devicetypes/smartthings/zigbee-dimmer.src/README.md: -------------------------------------------------------------------------------- 1 | # OSRAM Lightify LED On/Off/Dim 2 | 3 | 4 | 5 | Works with: 6 | 7 | * [OSRAM Lightify LED On/Off/Dim](https://shop.smartthings.com/#!/products/osram-led-smart-bulb-on-off-dim) 8 | 9 | ## Table of contents 10 | 11 | * [Capabilities](#capabilities) 12 | * [Health](#device-health) 13 | * [Battery](#battery-specification) 14 | 15 | ## Capabilities 16 | 17 | * **Actuator** - represents that a Device has commands 18 | * **Configuration** - _configure()_ command called when device is installed or device preferences updated 19 | * **Refresh** - _refresh()_ command for status updates 20 | * **Switch** - can detect state (possible values: on/off) 21 | * **Switch Level** - represents current light level, usually 0-100 in percent 22 | * **Health Check** - indicates ability to get device health notifications 23 | 24 | ## Device Health 25 | 26 | A Category C1 Zigbee dimmer with maxReportTime of 5 mins. 27 | Check-in interval is double the value of maxReportTime. 28 | This gives the device twice the amount of time to respond before it is marked as offline. 29 | Check-in interval = 12 mins 30 | 31 | ## Troubleshooting 32 | 33 | If the device doesn't pair when trying from the SmartThings mobile app, it is possible that the device is out of range. 34 | Pairing needs to be tried again by placing the device closer to the hub. 35 | Other troubleshooting tips are listed as follows: 36 | * [Troubleshooting:](https://support.smartthings.com/hc/en-us/articles/207191763-OSRAM-LIGHTIFY-LED-Smart-Connected-Light-A19-On-Off-Dim) 37 | -------------------------------------------------------------------------------- /devicetypes/capabilities/relative-humidity-measurement-capability.src/relative-humidity-measurement-capability.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | definition (name: "Relative Humidity Measurement Capability", namespace: "capabilities", author: "SmartThings") { 16 | capability "Relative Humidity Measurement" 17 | } 18 | 19 | // simulator metadata 20 | simulator { 21 | for (int i = 0; i <= 100; i += 10) { 22 | status "${i}%": "humidity: ${i}" 23 | } 24 | } 25 | 26 | // UI tile definitions 27 | tiles { 28 | valueTile("humidity", "device.humidity", width: 2, height: 2) { 29 | state "humidity", label:'${currentValue}%', unit:"" 30 | } 31 | } 32 | } 33 | 34 | // Parse incoming device messages to generate events 35 | // Parse incoming device messages to generate events 36 | def parse(String description) { 37 | def pair = description.split(":") 38 | createEvent(name: pair[0].trim(), value: pair[1].trim(), unit:"%") 39 | } 40 | -------------------------------------------------------------------------------- /devicetypes/capabilities/acceleration-sensor-capability.src/acceleration-sensor-capability.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | definition (name: "Acceleration Sensor Capability", namespace: "capabilities", author: "SmartThings") { 16 | capability "Acceleration Sensor" 17 | } 18 | 19 | simulator { 20 | status "active": "acceleration:active" 21 | status "inactive": "acceleration:inactive" 22 | } 23 | 24 | tiles { 25 | standardTile("acceleration", "device.acceleration", width: 2, height: 2) { 26 | state("inactive", label:'${name}', icon:"st.motion.acceleration.inactive", backgroundColor:"#ffffff") 27 | state("active", label:'${name}', icon:"st.motion.acceleration.active", backgroundColor:"#53a7c0") 28 | } 29 | 30 | main "acceleration" 31 | details "acceleration" 32 | } 33 | } 34 | 35 | def parse(String description) { 36 | def pair = description.split(":") 37 | createEvent(name: pair[0].trim(), value: pair[1].trim()) 38 | } 39 | -------------------------------------------------------------------------------- /circle.yml: -------------------------------------------------------------------------------- 1 | machine: 2 | java: 3 | version: 4 | oraclejdk8 5 | 6 | dependencies: 7 | override: 8 | - ./gradlew dependencies -PsmartThingsArtifactoryUserName="$ARTIFACTORY_USERNAME" -PsmartThingsArtifactoryPassword="$ARTIFACTORY_PASSWORD" 9 | post: 10 | - ./gradlew compileSmartappsGroovy compileDevicetypesGroovy -PsmartThingsArtifactoryUserName="$ARTIFACTORY_USERNAME" -PsmartThingsArtifactoryPassword="$ARTIFACTORY_PASSWORD" 11 | 12 | test: 13 | override: 14 | - echo "We don't have any tests :-(" 15 | 16 | deployment: 17 | develop: 18 | branch: master 19 | commands: 20 | - ./gradlew deployArchives -PsmartThingsArtifactoryUserName="$ARTIFACTORY_USERNAME" -PsmartThingsArtifactoryPassword="$ARTIFACTORY_PASSWORD" -Ps3Buckets="$S3_BUCKETS_DEV" 21 | - ./gradlew slackSendMessage -PsmartThingsArtifactoryUserName="$ARTIFACTORY_USERNAME" -PsmartThingsArtifactoryPassword="$ARTIFACTORY_PASSWORD" -Pbranch="$CIRCLE_BRANCH" -PslackToken="$SLACK_TOKEN" -PslackWebhookUrl="$SLACK_WEBHOOK_URL" -PslackChannel="$SLACK_CHANNEL" --stacktrace 22 | 23 | stage: 24 | branch: staging 25 | commands: 26 | - ./gradlew deployArchives -PsmartThingsArtifactoryUserName="$ARTIFACTORY_USERNAME" -PsmartThingsArtifactoryPassword="$ARTIFACTORY_PASSWORD" -Ps3Buckets="$S3_BUCKETS_STAGE" 27 | - ./gradlew slackSendMessage -PsmartThingsArtifactoryUserName="$ARTIFACTORY_USERNAME" -PsmartThingsArtifactoryPassword="$ARTIFACTORY_PASSWORD" -Pbranch="$CIRCLE_BRANCH" -PslackToken="$SLACK_TOKEN" -PslackWebhookUrl="$SLACK_WEBHOOK_URL" -PslackChannel="$SLACK_CHANNEL" --stacktrace 28 | -------------------------------------------------------------------------------- /devicetypes/capabilities/three-axis-capability.src/three-axis-capability.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | definition (name: "Three Axis Capability", namespace: "capabilities", author: "SmartThings") { 16 | capability "Three Axis" 17 | } 18 | 19 | simulator { 20 | status "x,y,z: 0,0,0": "threeAxis:0,0,0" 21 | status "x,y,z: 1000,0,0": "threeAxis:1000,0,0" 22 | status "x,y,z: 0,1000,0": "threeAxis:0,1000,0" 23 | status "x,y,z: 0,0,1000": "xthreeAxis:0,0,1000" 24 | status "x,y,z: -1000,0,0": "threeAxis:-1000,0,0" 25 | status "x,y,z: 0,-1000,0": "threeAxis:0,-1000,0" 26 | status "x,y,z: 0,0,-1000": "xthreeAxis:0,0,-1000" 27 | } 28 | 29 | tiles { 30 | valueTile("3axis", "device.threeAxis", decoration: "flat") { 31 | state("threeAxis", label:'${currentValue}', unit:"", backgroundColor:"#ffffff") 32 | } 33 | 34 | main "3axis" 35 | details "3axis" 36 | } 37 | } 38 | 39 | def parse(String description) { 40 | def pair = description.split(":") 41 | createEvent(name: pair[0].trim(), value: pair[1].trim()) 42 | } 43 | -------------------------------------------------------------------------------- /devicetypes/smartthings/on-off-button-tile.src/on-off-button-tile.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | * On/Off Button Tile 14 | * 15 | * Author: SmartThings 16 | * 17 | * Date: 2013-05-01 18 | */ 19 | metadata { 20 | definition (name: "On/Off Button Tile", namespace: "smartthings", author: "SmartThings") { 21 | capability "Actuator" 22 | capability "Switch" 23 | capability "Sensor" 24 | } 25 | 26 | // simulator metadata 27 | simulator { 28 | } 29 | 30 | // UI tile definitions 31 | tiles { 32 | standardTile("button", "device.switch", width: 2, height: 2, canChangeIcon: true) { 33 | state "off", label: 'Off', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff", nextState: "on" 34 | state "on", label: 'On', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#79b821", nextState: "off" 35 | } 36 | main "button" 37 | details "button" 38 | } 39 | } 40 | 41 | def parse(String description) { 42 | } 43 | 44 | def on() { 45 | sendEvent(name: "switch", value: "on") 46 | } 47 | 48 | def off() { 49 | sendEvent(name: "switch", value: "off") 50 | } 51 | 52 | -------------------------------------------------------------------------------- /devicetypes/smartthings/smartpower-outlet.src/README.md: -------------------------------------------------------------------------------- 1 | # SmartPower Outlet 2 | 3 | 4 | 5 | Works with: 6 | 7 | * [Samsung SmartPower Outlet](https://shop.smartthings.com/#!/products/smartpower-outlet) 8 | 9 | ## Table of contents 10 | 11 | * [Capabilities](#capabilities) 12 | * [Health](#device-health) 13 | 14 | ## Capabilities 15 | 16 | * **Configuration** - _configure()_ command called when device is installed or device preferences updated 17 | * **Actuator** - represents that a Device has commands 18 | * **Switch** - can detect state (possible values: on/off) 19 | * **Refresh** - _refresh()_ command for status updates 20 | * **Power Meter** - detects power meter for device in either w or kw. 21 | * **Health Check** - indicates ability to get device health notifications 22 | * **Sensor** - detects sensor events 23 | 24 | ## Device Health 25 | 26 | A Category C1 smart power outlet with maxReportTime of 5 mins. 27 | Check-in interval is double the value of maxReportTime. 28 | This gives the device twice the amount of time to respond before it is marked as offline. 29 | Check-in interval = 12 mins 30 | 31 | ## Troubleshooting 32 | 33 | If the device doesn't pair when trying from the SmartThings mobile app, it is possible that the device is out of range. 34 | Pairing needs to be tried again by placing the device closer to the hub. 35 | Instructions related to pairing, resetting and removing the device from SmartThings can be found in the following links 36 | for the different models: 37 | * [SmartPower Outlet Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/201084854-SmartPower-Outlet) 38 | * [Samsung SmartThings Outlet Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/205957620) -------------------------------------------------------------------------------- /smartapps/smartthings/brighten-my-path.src/brighten-my-path.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | * Brighten My Path 14 | * 15 | * Author: SmartThings 16 | */ 17 | definition( 18 | name: "Brighten My Path", 19 | namespace: "smartthings", 20 | author: "SmartThings", 21 | description: "Turn your lights on when motion is detected.", 22 | category: "Convenience", 23 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/light_motion-outlet.png", 24 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/light_motion-outlet@2x.png" 25 | ) 26 | 27 | preferences { 28 | section("When there's movement...") { 29 | input "motion1", "capability.motionSensor", title: "Where?", multiple: true 30 | } 31 | section("Turn on a light...") { 32 | input "switch1", "capability.switch", multiple: true 33 | } 34 | } 35 | 36 | def installed() 37 | { 38 | subscribe(motion1, "motion.active", motionActiveHandler) 39 | } 40 | 41 | def updated() 42 | { 43 | unsubscribe() 44 | subscribe(motion1, "motion.active", motionActiveHandler) 45 | } 46 | 47 | def motionActiveHandler(evt) { 48 | switch1.on() 49 | } 50 | -------------------------------------------------------------------------------- /devicetypes/smartthings/smartsense-temp-humidity-sensor.src/README.md: -------------------------------------------------------------------------------- 1 | # SmartSense Temp/Humidity Sensor 2 | 3 | 4 | 5 | Works with: 6 | 7 | * [Samsung SmartSense Temp/Humidity Sensor](https://shop.smartthings.com/#!/products/smartsense-temp-humidity-sensor) 8 | 9 | ## Table of contents 10 | 11 | * [Capabilities](#capabilities) 12 | * [Health](#device-health) 13 | * [Battery](#battery-specification) 14 | 15 | ## Capabilities 16 | 17 | * **Configuration** - _configure()_ command called when device is installed or device preferences updated 18 | * **Battery** - defines device uses a battery 19 | * **Relative Humidity Measurement** - defines device measures relative humidity 20 | * **Refresh** - _refresh()_ command for status updates 21 | * **Temperature Measurement** - defines device measures current temperature 22 | * **Health Check** - indicates ability to get device health notifications 23 | * **Sensor** - detects sensor events 24 | 25 | ## Device Health 26 | 27 | A Category C2 SmartSense Temp/Humidity Sensor with maxReportTime of 5 mins. 28 | Check-in interval is double the value of maxReportTime. 29 | This gives the device twice the amount of time to respond before it is marked as offline. 30 | Check-in interval = 12 mins 31 | 32 | ## Battery Specification 33 | 34 | One CR2 battery is required. 35 | 36 | ## Troubleshooting 37 | 38 | If the sensor doesn't pair when trying from the SmartThings mobile app, it is possible that the sensor is out of range. 39 | Pairing needs to be tried by placing the sensor closer to the hub. 40 | Instructions related to pairing, resetting and removing the sensor from SmartThings can be found in the following link: 41 | * [Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/203040294) -------------------------------------------------------------------------------- /smartapps/smartthings/darken-behind-me.src/darken-behind-me.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | * Darken Behind Me 14 | * 15 | * Author: SmartThings 16 | */ 17 | definition( 18 | name: "Darken Behind Me", 19 | namespace: "smartthings", 20 | author: "SmartThings", 21 | description: "Turn your lights off after a period of no motion being observed.", 22 | category: "Convenience", 23 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/light_motion-outlet.png", 24 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/light_motion-outlet@2x.png" 25 | ) 26 | 27 | preferences { 28 | section("When there's no movement...") { 29 | input "motion1", "capability.motionSensor", title: "Where?" 30 | } 31 | section("Turn off a light...") { 32 | input "switch1", "capability.switch", multiple: true 33 | } 34 | } 35 | 36 | def installed() 37 | { 38 | subscribe(motion1, "motion.inactive", motionInactiveHandler) 39 | } 40 | 41 | def updated() 42 | { 43 | unsubscribe() 44 | subscribe(motion1, "motion.inactive", motionInactiveHandler) 45 | } 46 | 47 | def motionInactiveHandler(evt) { 48 | switch1.off() 49 | } 50 | -------------------------------------------------------------------------------- /smartapps/smartthings/lights-off-when-closed.src/lights-off-when-closed.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | * Lights Off, When Closed 14 | * 15 | * Author: SmartThings 16 | */ 17 | definition( 18 | name: "Lights Off, When Closed", 19 | namespace: "smartthings", 20 | author: "SmartThings", 21 | description: "Turn your lights off when an open/close sensor closes.", 22 | category: "Convenience", 23 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/light_contact-outlet.png", 24 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/light_contact-outlet@2x.png" 25 | ) 26 | 27 | preferences { 28 | section ("When the door closes...") { 29 | input "contact1", "capability.contactSensor", title: "Where?" 30 | } 31 | section ("Turn off a light...") { 32 | input "switch1", "capability.switch" 33 | } 34 | } 35 | 36 | def installed() 37 | { 38 | subscribe(contact1, "contact.closed", contactClosedHandler) 39 | } 40 | 41 | def updated() 42 | { 43 | unsubscribe() 44 | subscribe(contact1, "contact.closed", contactClosedHandler) 45 | } 46 | 47 | def contactClosedHandler(evt) { 48 | switch1.off() 49 | } 50 | -------------------------------------------------------------------------------- /devicetypes/capabilities/momentary-capability.src/momentary-capability.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | definition (name: "Momentary Capability", namespace: "capabilities", author: "SmartThings") { 16 | capability "Momentary" 17 | } 18 | 19 | // simulator metadata 20 | simulator { 21 | // status messages 22 | // none 23 | 24 | // reply messages 25 | reply "'on','delay 2000','off'": "switch:off" 26 | } 27 | 28 | // UI tile definitions 29 | tiles { 30 | standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true) { 31 | state "off", label: '${name}', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff", nextState: "on" 32 | state "on", label: '${name}', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#79b821" 33 | } 34 | main "switch" 35 | details "switch" 36 | } 37 | } 38 | 39 | def parse(String description) { 40 | def pair = description.split(":") 41 | createEvent(name: pair[0].trim(), value: pair[1].trim()) 42 | } 43 | 44 | def push() { 45 | ['on','delay 2000','off'] 46 | } 47 | 48 | def off() { 49 | 'off' 50 | } 51 | -------------------------------------------------------------------------------- /devicetypes/capabilities/switch-capability.src/switch-capability.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | definition (name: "Switch Capability", namespace: "capabilities", author: "SmartThings") { 16 | capability "Switch" 17 | } 18 | 19 | // simulator metadata 20 | simulator { 21 | // status messages 22 | status "on": "switch:on" 23 | status "off": "switch:off" 24 | 25 | // reply messages 26 | reply "on": "switch:on" 27 | reply "off": "switch:off" 28 | } 29 | 30 | // UI tile definitions 31 | tiles { 32 | standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true) { 33 | state "off", label: '${name}', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff" 34 | state "on", label: '${name}', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#79b821" 35 | } 36 | main "switch" 37 | details "switch" 38 | } 39 | } 40 | 41 | def parse(String description) { 42 | def pair = description.split(":") 43 | createEvent(name: pair[0].trim(), value: pair[1].trim()) 44 | } 45 | 46 | def on() { 47 | 'on' 48 | } 49 | 50 | def off() { 51 | 'off' 52 | } 53 | -------------------------------------------------------------------------------- /smartapps/smartthings/big-turn-off.src/big-turn-off.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | * Big Turn OFF 14 | * 15 | * Author: SmartThings 16 | */ 17 | definition( 18 | name: "Big Turn OFF", 19 | namespace: "smartthings", 20 | author: "SmartThings", 21 | description: "Turn your lights off when the SmartApp is tapped or activated", 22 | category: "Convenience", 23 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/light_outlet.png", 24 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/light_outlet@2x.png" 25 | ) 26 | 27 | preferences { 28 | section("When I touch the app, turn off...") { 29 | input "switches", "capability.switch", multiple: true 30 | } 31 | } 32 | 33 | def installed() 34 | { 35 | subscribe(location, changedLocationMode) 36 | subscribe(app, appTouch) 37 | } 38 | 39 | def updated() 40 | { 41 | unsubscribe() 42 | subscribe(location, changedLocationMode) 43 | subscribe(app, appTouch) 44 | } 45 | 46 | def changedLocationMode(evt) { 47 | log.debug "changedLocationMode: $evt" 48 | switches?.off() 49 | } 50 | 51 | def appTouch(evt) { 52 | log.debug "appTouch: $evt" 53 | switches?.off() 54 | } 55 | -------------------------------------------------------------------------------- /smartapps/smartthings/big-turn-on.src/big-turn-on.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | * Big Turn ON 14 | * 15 | * Author: SmartThings 16 | */ 17 | 18 | definition( 19 | name: "Big Turn ON", 20 | namespace: "smartthings", 21 | author: "SmartThings", 22 | description: "Turn your lights on when the SmartApp is tapped or activated.", 23 | category: "Convenience", 24 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/light_outlet.png", 25 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/light_outlet@2x.png" 26 | ) 27 | 28 | preferences { 29 | section("When I touch the app, turn on...") { 30 | input "switches", "capability.switch", multiple: true 31 | } 32 | } 33 | 34 | def installed() 35 | { 36 | subscribe(location, changedLocationMode) 37 | subscribe(app, appTouch) 38 | } 39 | 40 | def updated() 41 | { 42 | unsubscribe() 43 | subscribe(location, changedLocationMode) 44 | subscribe(app, appTouch) 45 | } 46 | 47 | def changedLocationMode(evt) { 48 | log.debug "changedLocationMode: $evt" 49 | switches?.on() 50 | } 51 | 52 | def appTouch(evt) { 53 | log.debug "appTouch: $evt" 54 | switches?.on() 55 | } 56 | -------------------------------------------------------------------------------- /devicetypes/smartthings/smartsense-open-closed-sensor.src/README.md: -------------------------------------------------------------------------------- 1 | # Smartsense Open/Closed Sensor 2 | 3 | 4 | 5 | Works with: 6 | 7 | * [Samsung SmartThings Open/Closed Sensor](https://shop.smartthings.com/#!/packs/smartsense-open-closed-sensor/) 8 | 9 | ## Table of contents 10 | 11 | * [Capabilities](#capabilities) 12 | * [Health](#device-health) 13 | * [Battery](#battery-specification) 14 | 15 | ## Capabilities 16 | 17 | * **Configuration** - _configure()_ command called when device is installed or device preferences updated 18 | * **Battery** - defines device uses a battery 19 | * **Contact Sensor** - can detect contact (possible values: open,closed) 20 | * **Refresh** - _refresh()_ command for status updates 21 | * **Temperature Measurement** - defines device measures current temperature 22 | * **Health Check** - indicates ability to get device health notifications 23 | * **Sensor** - detects sensor events 24 | 25 | ## Device Health 26 | 27 | A Category C2 open/closed sensor with maxReportTime of 5 mins. 28 | Check-in interval is double the value of maxReportTime. 29 | This gives the device twice the amount of time to respond before it is marked as offline. 30 | Check-in interval = 12 mins 31 | 32 | ## Battery Specification 33 | 34 | One CR2 3V battery required. 35 | 36 | ## Troubleshooting 37 | 38 | If the sensor doesn't pair when trying from the SmartThings mobile app, it is possible that the sensor is out of range. 39 | Pairing needs to be tried again by placing the sensor closer to the hub. 40 | Instructions related to pairing, resetting and removing the sensor from SmartThings can be found in the following link: 41 | * [SmartSense Open/Closed Sensor Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/202836844-SmartSense-Open-Closed-Sensor) -------------------------------------------------------------------------------- /devicetypes/smartthings/spark.src/spark.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | definition (name: "Spark", namespace: "smartthings", author: "SmartThings") { 16 | capability "Switch" 17 | } 18 | 19 | 20 | // tile definitions 21 | tiles { 22 | standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true) { 23 | state "on", label: '${name}', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#79b821" 24 | state "off", label: '${name}', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff" 25 | } 26 | 27 | main "switch" 28 | details "switch" 29 | } 30 | } 31 | 32 | def parse(String description) { 33 | log.error "This device does not support incoming events" 34 | return null 35 | } 36 | 37 | def on() { 38 | put 'turnOn' 39 | } 40 | 41 | def off() { 42 | put 'turnOff' 43 | } 44 | 45 | private put(action) { 46 | // TODO: will this be configurable by user? 47 | def apiKey = "fb91rfPFS84wmzH3" 48 | 49 | rest( 50 | method: 'PUT', 51 | endpoint: "http://sprk.io", 52 | path: "/device/${device.deviceNetworkId}/${action}", 53 | query: [api_key: apiKey] 54 | ) 55 | } 56 | -------------------------------------------------------------------------------- /devicetypes/smartthings/zigbee-white-color-temperature-bulb.src/README.md: -------------------------------------------------------------------------------- 1 | # OSRAM Lightify Tunable 60 White 2 | 3 | 4 | 5 | Works with: 6 | 7 | * [OSRAM Lightify Tunable 60 White](http://www.osram.com/osram_com/tools-and-services/tools/lightify---smart-connected-light/lightify-for-home---what-is-light-to-you/lightify-products/lightify-classic-a60-tunable-white/index.jsp) 8 | 9 | ## Table of contents 10 | 11 | * [Capabilities](#capabilities) 12 | * [Health](#device-health) 13 | * [Battery](#battery-specification) 14 | 15 | ## Capabilities 16 | 17 | * **Actuator** - represents that a Device has commands 18 | * **Color Temperature** - represents color temperature, measured in degrees Kelvin. 19 | * **Configuration** - _configure()_ command called when device is installed or device preferences updated. 20 | * **Refresh** - _refresh()_ command for status updates 21 | * **Switch** - can detect state (possible values: on/off) 22 | * **Switch Level** - represents current light level, usually 0-100 in percent 23 | * **Health Check** - indicates ability to get device health notifications 24 | 25 | ## Device Health 26 | 27 | A Category C1 OSRAM Lightify Tunable 60 White with maxReportTime of 5 mins. 28 | Check-in interval is double the value of maxReportTime. 29 | This gives the device twice the amount of time to respond before it is marked as offline. 30 | Check-in interval = 12 mins 31 | 32 | ## Troubleshooting 33 | 34 | If the device doesn't pair when trying from the SmartThings mobile app, it is possible that the device is out of range. 35 | Pairing needs to be tried again by placing the device closer to the hub. 36 | Other troubleshooting tips are listed as follows: 37 | * [Troubleshooting:](https://support.smartthings.com/hc/en-us/articles/204576454-OSRAM-LIGHTIFY-Tunable-White-60-Bulb) 38 | -------------------------------------------------------------------------------- /smartapps/smartthings/feed-my-pet.src/feed-my-pet.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | * Feed My Pet 14 | * 15 | * Author: SmartThings 16 | */ 17 | definition( 18 | name: "Feed My Pet", 19 | namespace: "smartthings", 20 | author: "SmartThings", 21 | description: "Setup a schedule for when your pet is fed. Purchase any SmartThings certified pet food feeder and install the Feed My Pet app, and set the time. You and your pet are ready to go. Your life just got smarter.", 22 | category: "Pets", 23 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/dogfood_feeder.png", 24 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/dogfood_feeder@2x.png" 25 | ) 26 | 27 | preferences { 28 | section("Choose your pet feeder...") { 29 | input "feeder", "device.PetFeederShield", title: "Where?" 30 | } 31 | section("Feed my pet at...") { 32 | input "time1", "time", title: "When?" 33 | } 34 | } 35 | 36 | def installed() 37 | { 38 | schedule(time1, "scheduleCheck") 39 | } 40 | 41 | def updated() 42 | { 43 | unschedule() 44 | schedule(time1, "scheduleCheck") 45 | } 46 | 47 | def scheduleCheck() 48 | { 49 | log.trace "scheduledFeeding" 50 | feeder?.feed() 51 | } 52 | -------------------------------------------------------------------------------- /smartapps/resteele/monitor-on-sense.src/monitor-on-sense.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Monitor on Sense 3 | * 4 | * Copyright 2014 Rachel Steele 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 7 | * in compliance with the License. You may obtain a copy of the License at: 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 12 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing permissions and limitations under the License. 14 | * 15 | */ 16 | definition( 17 | name: "Monitor on Sense", 18 | namespace: "resteele", 19 | author: "Rachel Steele", 20 | description: "Turn on switch when vibration is sensed", 21 | category: "My Apps", 22 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png", 23 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png", 24 | oauth: [displayName: "Monitor on Vibrate", displayLink: ""]) 25 | 26 | 27 | preferences { 28 | section("When vibration is sensed...") { 29 | input "accelerationSensor", "capability.accelerationSensor", title: "Which Sensor?" 30 | } 31 | section("Turn on switch...") { 32 | input "switch1", "capability.switch" 33 | } 34 | } 35 | 36 | 37 | def installed() { 38 | subscribe(accelerationSensor, "acceleration.active", accelerationActiveHandler) 39 | } 40 | 41 | def updated() { 42 | unsubscribe() 43 | subscribe(accelerationSensor, "acceleration.active", accelerationActiveHandler) 44 | } 45 | 46 | 47 | def accelerationActiveHandler(evt) { 48 | switch1.on() 49 | } 50 | -------------------------------------------------------------------------------- /smartapps/smartthings/garage-door-opener.src/garage-door-opener.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | * Garage Door Opener 14 | * 15 | * Author: SmartThings 16 | */ 17 | definition( 18 | name: "Garage Door Opener", 19 | namespace: "smartthings", 20 | author: "SmartThings", 21 | description: "Open your garage door when a switch is turned on.", 22 | category: "Convenience", 23 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/garage_outlet.png", 24 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/garage_outlet@2x.png" 25 | ) 26 | 27 | preferences { 28 | section("When the garage door switch is turned on, open the garage door...") { 29 | input "switch1", "capability.switch" 30 | } 31 | } 32 | 33 | def installed() { 34 | subscribe(app, appTouchHandler) 35 | subscribeToCommand(switch1, "on", onCommand) 36 | } 37 | 38 | def updated() { 39 | unsubscribe() 40 | subscribe(app, appTouchHandler) 41 | subscribeToCommand(switch1, "on", onCommand) 42 | } 43 | 44 | def appTouch(evt) { 45 | log.debug "appTouch: $evt.value, $evt" 46 | switch1?.on() 47 | } 48 | 49 | def onCommand(evt) { 50 | log.debug "onCommand: $evt.value, $evt" 51 | switch1?.off(delay: 3000) 52 | } 53 | -------------------------------------------------------------------------------- /smartapps/smartthings/notify-me-when-it-opens.src/notify-me-when-it-opens.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | * Notify Me When It Opens 14 | * 15 | * Author: SmartThings 16 | */ 17 | definition( 18 | name: "Notify Me When It Opens", 19 | namespace: "smartthings", 20 | author: "SmartThings", 21 | description: "Get a push message sent to your phone when an open/close sensor is opened.", 22 | category: "Convenience", 23 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/window_contact.png", 24 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/window_contact@2x.png" 25 | ) 26 | 27 | preferences { 28 | section("When the door opens..."){ 29 | input "contact1", "capability.contactSensor", title: "Where?" 30 | } 31 | } 32 | 33 | def installed() 34 | { 35 | subscribe(contact1, "contact.open", contactOpenHandler) 36 | } 37 | 38 | def updated() 39 | { 40 | unsubscribe() 41 | subscribe(contact1, "contact.open", contactOpenHandler) 42 | } 43 | 44 | def contactOpenHandler(evt) { 45 | log.trace "$evt.value: $evt, $settings" 46 | 47 | log.debug "$contact1 was opened, sending push message to user" 48 | sendPush("Your ${contact1.label ?: contact1.name} was opened") 49 | } 50 | -------------------------------------------------------------------------------- /devicetypes/smartthings/testing/simulated-water-valve.src/simulated-water-valve.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | definition (name: "Simulated Water Valve", namespace: "smartthings/testing", author: "SmartThings") { 16 | capability "Actuator" 17 | capability "Valve" 18 | capability "Sensor" 19 | } 20 | 21 | // tile definitions 22 | tiles { 23 | standardTile("contact", "device.contact", width: 2, height: 2, canChangeIcon: true) { 24 | state "closed", label: '${name}', action: "valve.open", icon: "st.valves.water.closed", backgroundColor: "#e86d13" 25 | state "open", label: '${name}', action: "valve.close", icon: "st.valves.water.open", backgroundColor: "#53a7c0" 26 | } 27 | standardTile("refresh", "device.switch", inactiveLabel: false, decoration: "flat") { 28 | state "default", label:'', action:"refresh.refresh", icon:"st.secondary.refresh" 29 | } 30 | 31 | main "contact" 32 | details(["contact","refresh"]) 33 | } 34 | } 35 | 36 | def installed() { 37 | sendEvent(name: "contact", value: "closed") 38 | } 39 | 40 | def open() { 41 | sendEvent(name: "contact", value: "open") 42 | } 43 | 44 | def close() { 45 | sendEvent(name: "contact", value: "closed") 46 | } 47 | -------------------------------------------------------------------------------- /smartapps/smartthings/turn-it-on-when-it-opens.src/turn-it-on-when-it-opens.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | * Turn It On When It Opens 14 | * 15 | * Author: SmartThings 16 | */ 17 | definition( 18 | name: "Turn It On When It Opens", 19 | namespace: "smartthings", 20 | author: "SmartThings", 21 | description: "Turn something on when an open/close sensor opens.", 22 | category: "Convenience", 23 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/light_contact-outlet.png", 24 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/light_contact-outlet@2x.png" 25 | ) 26 | 27 | preferences { 28 | section("When the door opens..."){ 29 | input "contact1", "capability.contactSensor", title: "Where?" 30 | } 31 | section("Turn on a light..."){ 32 | input "switches", "capability.switch", multiple: true 33 | } 34 | } 35 | 36 | 37 | def installed() 38 | { 39 | subscribe(contact1, "contact.open", contactOpenHandler) 40 | } 41 | 42 | def updated() 43 | { 44 | unsubscribe() 45 | subscribe(contact1, "contact.open", contactOpenHandler) 46 | } 47 | 48 | def contactOpenHandler(evt) { 49 | log.debug "$evt.value: $evt, $settings" 50 | log.trace "Turning on switches: $switches" 51 | switches.on() 52 | } 53 | 54 | -------------------------------------------------------------------------------- /devicetypes/smartthings/arduino-thingshield.src/arduino-thingshield.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | definition (name: "Arduino ThingShield", namespace: "smartthings", author: "SmartThings") { 16 | 17 | fingerprint profileId: "0104", deviceId: "0138", inClusters: "0000" 18 | } 19 | 20 | // Simulator metadata 21 | simulator { 22 | // status messages 23 | status "ping": "catchall: 0104 0000 01 01 0040 00 6A67 00 00 0000 0A 00 0A70696E67" 24 | status "hello": "catchall: 0104 0000 01 01 0040 00 0A21 00 00 0000 0A 00 0A48656c6c6f20576f726c6421" 25 | } 26 | 27 | // UI tile definitions 28 | tiles { 29 | standardTile("shield", "device.shield", width: 2, height: 2) { 30 | state "default", icon:"st.shields.shields.arduino", backgroundColor:"#ffffff" 31 | } 32 | 33 | main "shield" 34 | details "shield" 35 | } 36 | } 37 | 38 | // Parse incoming device messages to generate events 39 | def parse(String description) { 40 | def value = zigbee.parse(description)?.text 41 | def name = value && value != "ping" ? "response" : null 42 | def result = createEvent(name: name, value: value) 43 | log.debug "Parse returned ${result?.descriptionText}" 44 | return result 45 | } 46 | 47 | // Commands to device 48 | // TBD 49 | -------------------------------------------------------------------------------- /devicetypes/capabilities/temperature-measurement-capability.src/temperature-measurement-capability.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | definition (name: "Temperature Measurement Capability", namespace: "capabilities", author: "SmartThings") { 16 | capability "Temperature Measurement" 17 | } 18 | 19 | // simulator metadata 20 | simulator { 21 | for (int i = 0; i <= 100; i += 10) { 22 | status "${i} F": "temperature:$i" 23 | } 24 | } 25 | 26 | // UI tile definitions 27 | tiles { 28 | valueTile("temperature", "device.temperature", width: 2, height: 2) { 29 | state("temperature", label:'${currentValue}°', unit:"F", 30 | backgroundColors:[ 31 | [value: 31, color: "#153591"], 32 | [value: 44, color: "#1e9cbb"], 33 | [value: 59, color: "#90d2a7"], 34 | [value: 74, color: "#44b621"], 35 | [value: 84, color: "#f1d801"], 36 | [value: 95, color: "#d04e00"], 37 | [value: 96, color: "#bc2323"] 38 | ] 39 | ) 40 | } 41 | main "temperature" 42 | details "temperature" 43 | } 44 | } 45 | 46 | // Parse incoming device messages to generate events 47 | def parse(String description) { 48 | def pair = description.split(":") 49 | createEvent(name: pair[0].trim(), value: pair[1].trim(), unit:"F") 50 | } 51 | -------------------------------------------------------------------------------- /devicetypes/smartthings/testing/simulated-contact-sensor.src/simulated-contact-sensor.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | // Automatically generated. Make future change here. 16 | definition (name: "Simulated Contact Sensor", namespace: "smartthings/testing", author: "bob") { 17 | capability "Contact Sensor" 18 | capability "Sensor" 19 | 20 | command "open" 21 | command "close" 22 | } 23 | 24 | simulator { 25 | status "open": "contact:open" 26 | status "closed": "contact:closed" 27 | } 28 | 29 | tiles { 30 | standardTile("contact", "device.contact", width: 2, height: 2) { 31 | state("closed", label:'${name}', icon:"st.contact.contact.closed", backgroundColor:"#79b821", action: "open") 32 | state("open", label:'${name}', icon:"st.contact.contact.open", backgroundColor:"#ffa81e", action: "close") 33 | } 34 | main "contact" 35 | details "contact" 36 | } 37 | } 38 | 39 | def parse(String description) { 40 | def pair = description.split(":") 41 | createEvent(name: pair[0].trim(), value: pair[1].trim()) 42 | } 43 | 44 | def open() { 45 | log.trace "open()" 46 | sendEvent(name: "contact", value: "open") 47 | } 48 | 49 | def close() { 50 | log.trace "close()" 51 | sendEvent(name: "contact", value: "closed") 52 | } 53 | -------------------------------------------------------------------------------- /devicetypes/smartthings/momentary-button-tile.src/momentary-button-tile.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | * Momentary Button Tile 14 | * 15 | * Author: SmartThings 16 | * 17 | * Date: 2013-05-01 18 | */ 19 | metadata { 20 | definition (name: "Momentary Button Tile", namespace: "smartthings", author: "SmartThings") { 21 | capability "Actuator" 22 | capability "Switch" 23 | capability "Momentary" 24 | capability "Sensor" 25 | } 26 | 27 | // simulator metadata 28 | simulator { 29 | } 30 | 31 | // UI tile definitions 32 | tiles { 33 | standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true) { 34 | state "off", label: 'Push', action: "momentary.push", backgroundColor: "#ffffff", nextState: "on" 35 | state "on", label: 'Push', action: "momentary.push", backgroundColor: "#53a7c0" 36 | } 37 | main "switch" 38 | details "switch" 39 | } 40 | } 41 | 42 | def parse(String description) { 43 | } 44 | 45 | def push() { 46 | sendEvent(name: "switch", value: "on", isStateChange: true, display: false) 47 | sendEvent(name: "switch", value: "off", isStateChange: true, display: false) 48 | sendEvent(name: "momentary", value: "pushed", isStateChange: true) 49 | } 50 | 51 | def on() { 52 | push() 53 | } 54 | 55 | def off() { 56 | push() 57 | } 58 | -------------------------------------------------------------------------------- /smartapps/smartthings/notify-me-when.src/i18n/messages.properties: -------------------------------------------------------------------------------- 1 | '''Acceleration Detected'''.ko=가속이 감지되었을 때 2 | '''Arrival Of'''.ko=도착했을 때 3 | '''Both Push and SMS?'''.ko=푸시 알람과 SMS 모두 사용 4 | '''Button Pushed'''.ko=버튼이 눌렸을 때 5 | '''Contact Closes'''.ko=닫힘이 감지되었을 때 6 | '''Contact Opens'''.ko=열림이 감지되었을 때 7 | '''Departure Of'''.ko=출발할 때 8 | '''Message Text'''.ko=문자 메시지 9 | '''Minutes'''.ko=메시지 전송 간격(분) 10 | '''Motion Here'''.ko=움직임이 감지되었을 때 11 | '''Phone Number (for SMS, optional)'''.ko=전화번호 (옵션) 12 | '''Receive notifications when anything happens in your home.'''.ko=집 안에 무슨 일이 일어나면 알림이 전송됩니다. 13 | '''Smoke Detected'''.ko=연기가 감지되었을 때 14 | '''Switch Turned Off'''.ko=스위치가 꺼졌을 때 15 | '''Switch Turned On'''.ko=스위치가 켜졌을 때 16 | '''Choose one or more, when...'''.ko=다음 상황 중 하나 이상 선택 17 | '''Yes'''.ko=예 18 | '''No'''.ko=아니요 19 | '''Send this message (optional, sends standard status message if not specified)'''.ko=메시지 작성 (작성하지 않을 경우 디폴트 메시지 전송) 20 | '''Via a push notification and/or an SMS message'''.ko=푸시 알람 및 SMS 설정 21 | '''Set for specific mode(s)'''.ko=특정 상태 설정 22 | '''Tap to set'''.ko=눌러서 설정 23 | '''Minimum time between messages (optional, defaults to every message)'''.ko=메시지 전송 간격 설정 24 | '''If outside the US please make sure to enter the proper country code'''.ko=미국 이외 국가에 거주한다면 국가 코드와 함께 입력하여 주세요. 25 | '''Water Sensor Wet'''.ko=누수가 감지되었을 때 26 | '''{{ triggerEvent.linkText }} has arrived at the {{ location.name }}'''.ko={{ location.name }}에 {{ triggerEvent.linkText }} 귀가 27 | '''{{ triggerEvent.linkText }} has arrived at {{ location.name }}'''.ko={{ location.name }}에 {{ triggerEvent.linkText }} 귀가 28 | '''{{ triggerEvent.linkText }} has left the {{ location.name }}'''.ko={{ location.name }}에서 {{ triggerEvent.linkText }} 외출 29 | '''{{ triggerEvent.linkText }} has left {{ location.name }}'''.ko={{ location.name }}에서 {{ triggerEvent.linkText }} 외출 30 | '''Assign a name'''.ko=이름 설정 31 | '''Choose Modes'''.ko=상태 선택 32 | -------------------------------------------------------------------------------- /devicetypes/capabilities/button-capability.src/button-capability.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | definition (name: "Button Capability", namespace: "capabilities", author: "SmartThings") { 16 | capability "Button" 17 | } 18 | 19 | simulator { 20 | status "button 1 pushed": "command: 2001, payload: 01" 21 | status "button 1 held": "command: 2001, payload: 15" 22 | status "button 2 pushed": "command: 2001, payload: 29" 23 | status "button 2 held": "command: 2001, payload: 3D" 24 | status "wakeup": "command: 8407, payload: " 25 | } 26 | tiles { 27 | standardTile("button", "device.button", width: 2, height: 2) { 28 | state "default", label: "", icon: "st.unknown.zwave.remote-controller", backgroundColor: "#ffffff" 29 | } 30 | main "button" 31 | details "button" 32 | } 33 | } 34 | 35 | def parse(String description) { 36 | def results = [] 37 | if (description.startsWith("Err")) { 38 | results = createEvent(descriptionText:description, displayed:true) 39 | } else { 40 | def cmd = zwave.parse(description, [0x2B: 1, 0x80: 1, 0x84: 1]) 41 | if(cmd) results += zwaveEvent(cmd) 42 | if(!results) results = [ descriptionText: cmd, displayed: false ] 43 | } 44 | // log.debug("Parsed '$description' to $results") 45 | return results 46 | } 47 | -------------------------------------------------------------------------------- /devicetypes/smartthings/testing/simulated-motion-sensor.src/simulated-motion-sensor.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | // Automatically generated. Make future change here. 16 | definition (name: "Simulated Motion Sensor", namespace: "smartthings/testing", author: "bob") { 17 | capability "Motion Sensor" 18 | capability "Sensor" 19 | 20 | command "active" 21 | command "inactive" 22 | } 23 | 24 | simulator { 25 | status "active": "motion:active" 26 | status "inactive": "motion:inactive" 27 | } 28 | 29 | tiles { 30 | standardTile("motion", "device.motion", width: 2, height: 2) { 31 | state("inactive", label:'no motion', icon:"st.motion.motion.inactive", backgroundColor:"#ffffff", action: "active") 32 | state("active", label:'motion', icon:"st.motion.motion.active", backgroundColor:"#53a7c0", action: "inactive") 33 | } 34 | main "motion" 35 | details "motion" 36 | } 37 | } 38 | 39 | def parse(String description) { 40 | def pair = description.split(":") 41 | createEvent(name: pair[0].trim(), value: pair[1].trim()) 42 | } 43 | 44 | def active() { 45 | log.trace "active()" 46 | sendEvent(name: "motion", value: "active") 47 | } 48 | 49 | def inactive() { 50 | log.trace "inactive()" 51 | sendEvent(name: "motion", value: "inactive") 52 | } 53 | -------------------------------------------------------------------------------- /devicetypes/smartthings/door-shield.src/door-shield.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | definition (name: "Door Shield", namespace: "smartthings", author: "SmartThings") { 16 | 17 | command "open" 18 | } 19 | 20 | // simulator metadata 21 | simulator { 22 | // status messages 23 | status "ping": "catchall: 0104 0000 01 01 0040 00 6A67 00 00 0000 0A 00 0A70696E67" 24 | status "response": "catchall: 0104 0000 01 01 0040 00 0A21 00 00 0000 0A 00 0A4F4D4E4F4D4E4F4D4E4F4D" 25 | } 26 | 27 | // UI tile definitions 28 | tiles { 29 | standardTile("shield", "device.shield", width: 2, height: 2, canChangeBackground: true) { 30 | state(name:"default", action:"open", icon:"st.shields.shields.door-shield", backgroundColor:"#ffffff") 31 | } 32 | 33 | main "shield" 34 | details "shield" 35 | } 36 | } 37 | 38 | // Parse incoming device messages to generate events 39 | def parse(String description) { 40 | def value = zigbee.parse(description)?.text 41 | def name = value && value != "ping" ? "response" : null 42 | def result = createEvent(name: name, value: value) 43 | log.debug "Parse returned ${result?.descriptionText}" 44 | return result 45 | } 46 | 47 | // Commands sent to the device 48 | def open() { 49 | zigbee.smartShield(text: "open sesame").format() 50 | } 51 | -------------------------------------------------------------------------------- /smartapps/smartthings/dry-the-wetspot.src/dry-the-wetspot.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Dry the Wetspot 3 | * 4 | * Copyright 2014 Scottin Pollock 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 7 | * in compliance with the License. You may obtain a copy of the License at: 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 12 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing permissions and limitations under the License. 14 | * 15 | */ 16 | definition( 17 | name: "Dry the Wetspot", 18 | namespace: "smartthings", 19 | author: "Scottin Pollock", 20 | description: "Turns switch on and off based on moisture sensor input.", 21 | category: "Safety & Security", 22 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Developers/dry-the-wet-spot.png", 23 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Developers/dry-the-wet-spot@2x.png" 24 | ) 25 | 26 | 27 | preferences { 28 | section("When water is sensed...") { 29 | input "sensor", "capability.waterSensor", title: "Where?", required: true 30 | } 31 | section("Turn on a pump...") { 32 | input "pump", "capability.switch", title: "Which?", required: true 33 | } 34 | } 35 | 36 | def installed() { 37 | subscribe(sensor, "water.dry", waterHandler) 38 | subscribe(sensor, "water.wet", waterHandler) 39 | } 40 | 41 | def updated() { 42 | unsubscribe() 43 | subscribe(sensor, "water.dry", waterHandler) 44 | subscribe(sensor, "water.wet", waterHandler) 45 | } 46 | 47 | def waterHandler(evt) { 48 | log.debug "Sensor says ${evt.value}" 49 | if (evt.value == "wet") { 50 | pump.on() 51 | } else if (evt.value == "dry") { 52 | pump.off() 53 | } 54 | } 55 | 56 | -------------------------------------------------------------------------------- /smartapps/smartthings/undead-early-warning.src/undead-early-warning.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | * The simplest Undead Early Warning system that could possibly work. ;) 14 | * 15 | * Author: SmartThings 16 | */ 17 | definition( 18 | name: "Undead Early Warning", 19 | namespace: "smartthings", 20 | author: "SmartThings", 21 | description: "Undead Early Warning", 22 | category: "Safety & Security", 23 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/SafetyAndSecurity/App-UndeadEarlyWarning.png", 24 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/SafetyAndSecurity/App-UndeadEarlyWarning@2x.png" 25 | ) 26 | 27 | preferences { 28 | section("When the door opens...") { 29 | input "contacts", "capability.contactSensor", multiple: true, title: "Where could they come from?" 30 | } 31 | section("Turn on the lights!") { 32 | input "switches", "capability.switch", multiple: true 33 | } 34 | } 35 | 36 | def installed() 37 | { 38 | subscribe(contacts, "contact.open", contactOpenHandler) 39 | } 40 | 41 | def updated() 42 | { 43 | unsubscribe() 44 | subscribe(contacts, "contact.open", contactOpenHandler) 45 | } 46 | 47 | def contactOpenHandler(evt) { 48 | log.debug "$evt.value: $evt, $settings" 49 | log.trace "The Undead are coming! Turning on the lights: $switches" 50 | switches.on() 51 | } 52 | -------------------------------------------------------------------------------- /smartapps/smartthings/let-there-be-light.src/let-there-be-light.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | * Let There Be Light! 14 | * Turn your lights on when an open/close sensor opens and off when the sensor closes. 15 | * 16 | * Author: SmartThings 17 | */ 18 | definition( 19 | name: "Let There Be Light!", 20 | namespace: "smartthings", 21 | author: "SmartThings", 22 | description: "Turn your lights on when a SmartSense Multi is opened and turn them off when it is closed.", 23 | category: "Convenience", 24 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/light_contact-outlet.png", 25 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/light_contact-outlet@2x.png" 26 | ) 27 | 28 | preferences { 29 | section("When the door opens/closes...") { 30 | input "contact1", "capability.contactSensor", title: "Where?" 31 | } 32 | section("Turn on/off a light...") { 33 | input "switch1", "capability.switch" 34 | } 35 | } 36 | 37 | def installed() { 38 | subscribe(contact1, "contact", contactHandler) 39 | } 40 | 41 | def updated() { 42 | unsubscribe() 43 | subscribe(contact1, "contact", contactHandler) 44 | } 45 | 46 | def contactHandler(evt) { 47 | log.debug "$evt.value" 48 | if (evt.value == "open") { 49 | switch1.on() 50 | } else if (evt.value == "closed") { 51 | switch1.off() 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /smartapps/smartthings/turn-on-only-if-i-arrive-after-sunset.src/turn-on-only-if-i-arrive-after-sunset.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Turn On Only If I Arrive After Sunset 3 | * 4 | * Author: Danny De Leo 5 | */ 6 | definition( 7 | name: "Turn On Only If I Arrive After Sunset", 8 | namespace: "smartthings", 9 | author: "SmartThings", 10 | description: "Turn something on only if you arrive after sunset and back off anytime you leave.", 11 | category: "Convenience", 12 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/light_presence-outlet.png", 13 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/light_presence-outlet@2x.png" 14 | ) 15 | 16 | preferences { 17 | section("When I arrive and leave..."){ 18 | input "presence1", "capability.presenceSensor", title: "Who?", multiple: true 19 | } 20 | section("Turn on/off a light..."){ 21 | input "switch1", "capability.switch", multiple: true 22 | } 23 | } 24 | 25 | def installed() 26 | { 27 | subscribe(presence1, "presence", presenceHandler) 28 | } 29 | 30 | def updated() 31 | { 32 | unsubscribe() 33 | subscribe(presence1, "presence", presenceHandler) 34 | } 35 | 36 | def presenceHandler(evt) 37 | { 38 | def now = new Date() 39 | def sunTime = getSunriseAndSunset(); 40 | 41 | log.debug "nowTime: $now" 42 | log.debug "riseTime: $sunTime.sunrise" 43 | log.debug "setTime: $sunTime.sunset" 44 | log.debug "presenceHandler $evt.name: $evt.value" 45 | 46 | def current = presence1.currentValue("presence") 47 | log.debug current 48 | def presenceValue = presence1.find{it.currentPresence == "present"} 49 | log.debug presenceValue 50 | if(presenceValue && (now > sunTime.sunset)) { 51 | switch1.on() 52 | log.debug "Welcome home at night!" 53 | } 54 | else if(presenceValue && (now < sunTime.sunset)) { 55 | log.debug "Welcome home at daytime!" 56 | } 57 | else { 58 | switch1.off() 59 | log.debug "Everyone's away." 60 | } 61 | } 62 | 63 | -------------------------------------------------------------------------------- /smartapps/smartthings/unlock-it-when-i-arrive.src/unlock-it-when-i-arrive.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | * Unlock It When I Arrive 14 | * 15 | * Author: SmartThings 16 | * Date: 2013-02-11 17 | */ 18 | 19 | definition( 20 | name: "Unlock It When I Arrive", 21 | namespace: "smartthings", 22 | author: "SmartThings", 23 | description: "Unlocks the door when you arrive at your location.", 24 | category: "Safety & Security", 25 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png", 26 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience%402x.png", 27 | oauth: true 28 | ) 29 | 30 | preferences { 31 | section("When I arrive..."){ 32 | input "presence1", "capability.presenceSensor", title: "Who?", multiple: true 33 | } 34 | section("Unlock the lock..."){ 35 | input "lock1", "capability.lock", multiple: true 36 | } 37 | } 38 | 39 | def installed() 40 | { 41 | subscribe(presence1, "presence.present", presence) 42 | } 43 | 44 | def updated() 45 | { 46 | unsubscribe() 47 | subscribe(presence1, "presence.present", presence) 48 | } 49 | 50 | def presence(evt) 51 | { 52 | def anyLocked = lock1.count{it.currentLock == "unlocked"} != lock1.size() 53 | if (anyLocked) { 54 | sendPush "Unlocked door due to arrival of $evt.displayName" 55 | lock1.unlock() 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /devicetypes/smartthings/tyco-door-window-sensor.src/README.md: -------------------------------------------------------------------------------- 1 | # Tyco Door Window Sensor 2 | 3 | 4 | 5 | Works with: 6 | 7 | * [Tyco Door Window Sensor](https://support.smartthings.com/hc/en-us/articles/204834100-Tyco-Door-Window-Sensor) 8 | 9 | ## Table of contents 10 | 11 | * [Capabilities](#capabilities) 12 | * [Health](#device-health) 13 | * [Battery](#battery-specification) 14 | 15 | ## Capabilities 16 | 17 | * **Battery** - defines device uses a battery 18 | * **Configuration** - _configure()_ command called when device is installed or device preferences updated 19 | * **Contact Sensor** - can detect contact (open/close) 20 | * **Refresh** - _refresh()_ command for status updates 21 | * **Temperature Measurement** - can measure the device temperature 22 | * **Health Check** - indicates ability to get device health notifications 23 | 24 | ## Device Health 25 | 26 | Contact sensor with maxReportTime of 5 mins. 27 | Check-in interval is double the value of maxReportTime for Zigbee device. 28 | This gives the device twice the amount of time to respond before it is marked as offline. 29 | Check-in interval = 12 min 30 | 31 | ## Battery Specification 32 | 33 | 3V CR2032 battery is required. 34 | 35 | ## Troubleshooting 36 | 37 | If the device doesn't pair when trying from the SmartThings mobile app, it is possible that either the sensor needs to be reseted or the sensor is out of range. 38 | Reset needs to be done by inserting the battery in the sensor and then quickly pressing the adjacent black button 10 times. Pairing should be tried again now. 39 | It may happen that sensor is out of range, then pairing needs to be tried again by placing the sensor closer to the hub. 40 | Instructions related to pairing, resetting and removing the different motion sensors from SmartThings can be found in the following links 41 | for the different models: 42 | * [Tyco Door Window Sensor (MCT-340)](https://support.smartthings.com/hc/en-us/articles/204834100-Tyco-Door-Window-Sensor) 43 | -------------------------------------------------------------------------------- /devicetypes/smartthings/testing/simulated-presence-sensor.src/simulated-presence-sensor.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | // Automatically generated. Make future change here. 16 | definition (name: "Simulated Presence Sensor", namespace: "smartthings/testing", author: "bob") { 17 | capability "Presence Sensor" 18 | capability "Sensor" 19 | 20 | command "arrived" 21 | command "departed" 22 | } 23 | 24 | simulator { 25 | status "present": "presence: present" 26 | status "not present": "presence: not present" 27 | } 28 | 29 | tiles { 30 | standardTile("presence", "device.presence", width: 2, height: 2, canChangeBackground: true) { 31 | state("not present", label:'not present', icon:"st.presence.tile.not-present", backgroundColor:"#ffffff", action:"arrived") 32 | state("present", label:'present', icon:"st.presence.tile.present", backgroundColor:"#53a7c0", action:"departed") 33 | } 34 | main "presence" 35 | details "presence" 36 | } 37 | } 38 | 39 | def parse(String description) { 40 | def pair = description.split(":") 41 | createEvent(name: pair[0].trim(), value: pair[1].trim()) 42 | } 43 | 44 | // handle commands 45 | def arrived() { 46 | log.trace "Executing 'arrived'" 47 | sendEvent(name: "presence", value: "present") 48 | } 49 | 50 | 51 | def departed() { 52 | log.trace "Executing 'arrived'" 53 | sendEvent(name: "presence", value: "not present") 54 | } 55 | -------------------------------------------------------------------------------- /devicetypes/smartthings/zigbee-rgbw-bulb.src/README.md: -------------------------------------------------------------------------------- 1 | # OSRAM LIGHTIFY LED RGBW Bulb 2 | 3 | 4 | 5 | Works with: 6 | 7 | * [OSRAM LIGHTIFY LED RGBW Bulb](https://support.smartthings.com/hc/en-us/articles/207728173-OSRAM-LIGHTIFY-LED-Smart-Connected-Light-A19-RGBW) 8 | 9 | ## Table of contents 10 | 11 | * [Capabilities](#capabilities) 12 | * [Health](#device-health) 13 | * [Battery](#battery-specification) 14 | 15 | ## Capabilities 16 | 17 | * **Actuator** - It represents that a device has commands. 18 | * **Color Control** - It represents that the color attributes of a device can be controlled (hue, saturation, color value). 19 | * **Color Temperature** - It represents color temperature capability measured in degree Kelvin. 20 | * **Polling** - It represents that a device can be polled. 21 | * **Switch** - can detect state (possible values: on/off) 22 | * **Switch Level** - can detect current light level (0-100 in percent) 23 | * **Configuration** - _configure()_ command called when device is installed or device preferences updated 24 | * **Refresh** - _refresh()_ command for status updates 25 | * **Health Check** - indicates ability to get device health notifications 26 | 27 | 28 | ## Device Health 29 | 30 | A Category C6 OSRAM LIGHTIFY LED RGBW Bulb with maxReportTime of 5 mins. 31 | Check-in interval is double the value of maxReportTime. 32 | This gives the device twice the amount of time to respond before it is marked as offline. 33 | Check-in interval = 12 mins 34 | 35 | 36 | ## Troubleshooting 37 | 38 | If the device doesn't pair when trying from the SmartThings mobile app, it is possible that the device is out of range. 39 | Pairing needs to be tried again by placing the device closer to the hub. 40 | It may also happen that you need to reset the device. 41 | Instructions related to pairing, resetting and removing the device from SmartThings can be found in the following link: 42 | * [Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/207728173-OSRAM-LIGHTIFY-LED-Smart-Connected-Light-A19-RGBW) -------------------------------------------------------------------------------- /smartapps/smartthings/light-up-the-night.src/light-up-the-night.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | * Light Up The Night 14 | * 15 | * Author: SmartThings 16 | */ 17 | definition( 18 | name: "Light Up the Night", 19 | namespace: "smartthings", 20 | author: "SmartThings", 21 | description: "Turn your lights on when it gets dark and off when it becomes light again.", 22 | category: "Convenience", 23 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/light_outlet-luminance.png", 24 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/light_outlet-luminance@2x.png" 25 | ) 26 | 27 | preferences { 28 | section("Monitor the luminosity...") { 29 | input "lightSensor", "capability.illuminanceMeasurement" 30 | } 31 | section("Turn on a light...") { 32 | input "lights", "capability.switch", multiple: true 33 | } 34 | } 35 | 36 | def installed() { 37 | subscribe(lightSensor, "illuminance", illuminanceHandler) 38 | } 39 | 40 | def updated() { 41 | unsubscribe() 42 | subscribe(lightSensor, "illuminance", illuminanceHandler) 43 | } 44 | 45 | // New aeon implementation 46 | def illuminanceHandler(evt) { 47 | def lastStatus = state.lastStatus 48 | if (lastStatus != "on" && evt.integerValue < 30) { 49 | lights.on() 50 | state.lastStatus = "on" 51 | } 52 | else if (lastStatus != "off" && evt.integerValue > 50) { 53 | lights.off() 54 | state.lastStatus = "off" 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /devicetypes/smartthings/tile-ux/tile-basic-colorwheel.src/tile-basic-colorwheel.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2016 SmartThings, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | definition ( 16 | name: "colorWheelDeviceTile", 17 | namespace: "smartthings/tile-ux", 18 | author: "SmartThings") { 19 | 20 | capability "Color Control" 21 | } 22 | 23 | tiles(scale: 2) { 24 | valueTile("currentColor", "device.color") { 25 | state "color", label: '${currentValue}', defaultState: true 26 | } 27 | 28 | controlTile("rgbSelector", "device.color", "color", height: 6, width: 6, inactiveLabel: false) { 29 | state "color", action: "color control.setColor" 30 | } 31 | 32 | main("currentColor") 33 | details([ 34 | "rgbSelector" 35 | ]) 36 | } 37 | } 38 | 39 | // parse events into attributes 40 | def parse(String description) { 41 | log.debug "Parsing '${description}'" 42 | } 43 | 44 | def setColor(value) { 45 | log.debug "setting color: $value" 46 | if (value.hex) { sendEvent(name: "color", value: value.hex) } 47 | if (value.hue) { sendEvent(name: "hue", value: value.hue) } 48 | if (value.saturation) { sendEvent(name: "saturation", value: value.saturation) } 49 | } 50 | 51 | def setSaturation(percent) { 52 | log.debug "Executing 'setSaturation'" 53 | sendEvent(name: "saturation", value: percent) 54 | } 55 | 56 | def setHue(percent) { 57 | log.debug "Executing 'setHue'" 58 | sendEvent(name: "hue", value: percent) 59 | } 60 | -------------------------------------------------------------------------------- /devicetypes/smartthings/open-closed-sensor.src/open-closed-sensor.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | definition (name: "Open/Closed Sensor", namespace: "smartthings", author: "SmartThings") { 16 | capability "Contact Sensor" 17 | capability "Sensor" 18 | 19 | fingerprint profileId: "0104", deviceId: "0402", inClusters: "0000,0001,0003,0009,0500", outClusters: "0000" 20 | } 21 | 22 | // simulator metadata 23 | simulator { 24 | // status messages 25 | status "open": "zone report :: type: 19 value: 0031" 26 | status "closed": "zone report :: type: 19 value: 0030" 27 | } 28 | 29 | // UI tile definitions 30 | tiles { 31 | standardTile("contact", "device.contact", width: 2, height: 2) { 32 | state "open", label: '${name}', icon: "st.contact.contact.open", backgroundColor: "#ffa81e" 33 | state "closed", label: '${name}', icon: "st.contact.contact.closed", backgroundColor: "#79b821" 34 | } 35 | 36 | main "contact" 37 | details "contact" 38 | } 39 | } 40 | 41 | // Parse incoming device messages to generate events 42 | def parse(String description) { 43 | def name = null 44 | def value = description 45 | if (zigbee.isZoneType19(description)) { 46 | name = "contact" 47 | value = zigbee.translateStatusZoneType19(description) ? "open" : "closed" 48 | } 49 | 50 | def result = createEvent(name: name, value: value) 51 | log.debug "Parse returned ${result?.descriptionText}" 52 | return result 53 | } 54 | -------------------------------------------------------------------------------- /devicetypes/capabilities/lock-capability.src/lock-capability.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | definition (name: "Lock Capability", namespace: "capabilities", author: "SmartThings") { 16 | capability "Lock" 17 | } 18 | 19 | simulator { 20 | status "locked": "lock:locked" 21 | status "unlocked": "lock:unlocked" 22 | 23 | reply "lock": "lock:locked" 24 | reply "unlock": "lock:unlocked" 25 | } 26 | 27 | tiles { 28 | standardTile("toggle", "device.lock", width: 2, height: 2) { 29 | state "unlocked", label:'unlocked', action:"lock.lock", icon:"st.locks.lock.unlocked", backgroundColor:"#ffffff" 30 | state "locked", label:'locked', action:"lock.unlock", icon:"st.locks.lock.locked", backgroundColor:"#79b821" 31 | } 32 | standardTile("lock", "device.lock", inactiveLabel: false, decoration: "flat") { 33 | state "default", label:'lock', action:"lock.lock", icon:"st.locks.lock.locked" 34 | } 35 | standardTile("unlock", "device.lock", inactiveLabel: false, decoration: "flat") { 36 | state "default", label:'unlock', action:"lock.unlock", icon:"st.locks.lock.unlocked" 37 | } 38 | 39 | main "toggle" 40 | details(["toggle", "lock", "unlock", "refresh"]) 41 | } 42 | } 43 | 44 | def parse(String description) { 45 | def pair = description.split(":") 46 | createEvent(name: pair[0].trim(), value: pair[1].trim()) 47 | } 48 | 49 | def lock() { 50 | "lock" 51 | } 52 | 53 | def unlock() { 54 | "unlock" 55 | } 56 | -------------------------------------------------------------------------------- /smartapps/skp19/door-lock-code-distress-message.src/door-lock-code-distress-message.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Door Lock Code Distress Message 3 | * 4 | * Copyright 2014 skp19 5 | * 6 | */ 7 | definition( 8 | name: "Door Lock Code Distress Message", 9 | namespace: "skp19", 10 | author: "skp19", 11 | description: "Sends a text to someone when a specific code is entered", 12 | category: "Safety & Security", 13 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png", 14 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png") 15 | 16 | import groovy.json.JsonSlurper 17 | 18 | preferences { 19 | section("Choose Locks") { 20 | input "lock1", "capability.lock", multiple: true 21 | } 22 | section("Enter User Code Number (This is not the code used to unlock the door)") { 23 | input "distressCode", "number", defaultValue: "0" 24 | } 25 | section("Distress Message Details") { 26 | input "phone1", "phone", title: "Phone number to send message to" 27 | input "distressMsg", "text", title: "Message to send" 28 | } 29 | section("User Code Discovery Mode (Enable and unlock the door using desired code. A message will be sent containing the user code used to unlock the door.)") { 30 | input "discoveryMode", "bool", title: "Enable" 31 | } 32 | } 33 | 34 | def installed() { 35 | subscribe(lock1, "lock", checkCode) 36 | } 37 | 38 | def updated() { 39 | unsubscribe() 40 | subscribe(lock1, "lock", checkCode) 41 | } 42 | 43 | def checkCode(evt) { 44 | log.debug "$evt.value: $evt, $settings" 45 | 46 | if(evt.value == "unlocked" && evt.data) { 47 | def lockData = new JsonSlurper().parseText(evt.data) 48 | 49 | if(discoveryMode) { 50 | sendPush "Door unlocked with user code $lockData.usedCode" 51 | } 52 | 53 | if(lockData.usedCode == distressCode && discoveryMode == false) { 54 | log.info "Distress Message Sent" 55 | sendSms(phone1, distressMsg) 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /devicetypes/dianoga/netatmo-rain.src/netatmo-rain.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * netatmo-basestation 3 | * 4 | * Copyright 2014 Brian Steere 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 7 | * in compliance with the License. You may obtain a copy of the License at: 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 12 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing permissions and limitations under the License. 14 | * 15 | */ 16 | metadata { 17 | definition (name: "Netatmo Rain", namespace: "dianoga", author: "Brian Steere") { 18 | capability "Sensor" 19 | 20 | attribute "rain", "number" 21 | attribute "rainSumHour", "number" 22 | attribute "rainSumDay", "number" 23 | attribute "units", "string" 24 | 25 | command "poll" 26 | } 27 | 28 | simulator { 29 | // TODO: define status and reply messages here 30 | } 31 | 32 | tiles { 33 | valueTile("rain", "device.rain", width: 2, height: 2, inactiveLabel: false) { 34 | state "default", label:'${currentValue}' 35 | } 36 | valueTile("rainSumHour", "device.rainSumHour", inactiveLabel: false) { 37 | state "default", label:'${currentValue}\nhour' 38 | } 39 | valueTile("rainSumDay", "device.rainSumDay", inactiveLabel: false) { 40 | state "default", label:'${currentValue}\nday' 41 | } 42 | standardTile("refresh", "device.rain", inactiveLabel: false, decoration: "flat") { 43 | state "default", action:"refresh.poll", icon:"st.secondary.refresh" 44 | } 45 | main (["rain", "rainSumHour", "rainSumDay"]) 46 | details(["rain", "rainSumHour", "rainSumDay", "refresh"]) 47 | } 48 | } 49 | 50 | // parse events into attributes 51 | def parse(String description) { 52 | log.debug "Parsing '${description}'" 53 | } 54 | 55 | def poll() { 56 | parent.poll() 57 | } 58 | -------------------------------------------------------------------------------- /devicetypes/smartthings/smartsense-moisture-sensor.src/i18n/messages.properties: -------------------------------------------------------------------------------- 1 | # Copyright 2016 SmartThings 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 4 | # use this file except in compliance with the License. You may obtain a copy 5 | # of the License at: 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | # Korean (ko) 15 | # Device Preferences 16 | '''Dry'''.ko=건조 17 | '''Wet'''.ko=누수 18 | '''dry'''.ko=건조 19 | '''wet'''.ko=누수 20 | '''battery'''.ko=배터리 21 | '''Temperature Offset'''.ko=온도 직접 설정 22 | '''This feature allows you to correct any temperature variations by selecting an offset. Ex: If your sensor consistently reports a temp that's 5 degrees too warm, you'd enter '-5'. If 3 degrees too cold, enter '+3'.'''.ko=기준 온도를 원하는대로 몇 도 올리거나 내려서 설정할 수 있습니다. 23 | '''Degrees'''.ko=온도 24 | '''Adjust temperature by this many degrees'''.ko=몇 도씩 온도를 조절하십시오 25 | '''Give your device a name'''.ko=기기 이름 설정 26 | '''Water Leak Sensor'''.ko=누수감지 센서 27 | '''${currentValue}% battery'''.ko=${currentValue}% 배터리 28 | # Events descriptionText 29 | '''{{ device.displayName }} is dry'''.ko={{ device.displayName }}가 건조 30 | '''{{ device.displayName }} is wet'''.ko={{ device.displayName }}누수 31 | '''{{ device.displayName }} was {{ value }}°C'''.ko={{ device.displayName }}에서 {{ value }}°C 감지 32 | '''{{ device.displayName }} was {{ value }}°F'''.ko={{ device.displayName }}이(가) {{ value }}°F였습니다 33 | '''{{ device.displayName }} battery has too much power: (> 3.5) volts.'''.ko={{ device.displayName }} 배터리 전력이 너무 높습니다(3.5볼트 초과). 34 | '''{{ device.displayName }} battery was {{ value }}%'''.ko={{ device.displayName }}의 남은 배터리 {{ value }}% 35 | #============================================================================== 36 | -------------------------------------------------------------------------------- /devicetypes/smartthings/testing/simulated-button.src/simulated-button.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | definition (name: "Simulated Button", namespace: "smartthings/testing", author: "SmartThings") { 16 | capability "Actuator" 17 | capability "Button" 18 | capability "Sensor" 19 | 20 | command "push1" 21 | command "hold1" 22 | } 23 | 24 | simulator { 25 | 26 | } 27 | tiles { 28 | standardTile("button", "device.button", width: 1, height: 1) { 29 | state "default", label: "", icon: "st.unknown.zwave.remote-controller", backgroundColor: "#ffffff" 30 | } 31 | standardTile("push1", "device.button", width: 1, height: 1, decoration: "flat") { 32 | state "default", label: "Push 1", backgroundColor: "#ffffff", action: "push1" 33 | } 34 | standardTile("hold1", "device.button", width: 1, height: 1, decoration: "flat") { 35 | state "default", label: "Hold 1", backgroundColor: "#ffffff", action: "hold1" 36 | } 37 | main "button" 38 | details(["button","push1","hold1"]) 39 | } 40 | } 41 | 42 | def parse(String description) { 43 | 44 | } 45 | 46 | def hold1() { 47 | sendEvent(name: "button", value: "held", data: [buttonNumber: "1"], descriptionText: "$device.displayName button 1 was held", isStateChange: true) 48 | } 49 | 50 | def push1() { 51 | sendEvent(name: "button", value: "pushed", data: [buttonNumber: "1"], descriptionText: "$device.displayName button 1 was pushed", isStateChange: true) 52 | } 53 | -------------------------------------------------------------------------------- /smartapps/smartthings/presence-change-push.src/presence-change-push.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | * Presence Change Push 14 | * 15 | * Author: SmartThings 16 | */ 17 | definition( 18 | name: "Presence Change Push", 19 | namespace: "smartthings", 20 | author: "SmartThings", 21 | description: "Get a push notification when a SmartSense Presence tag or smartphone arrives at or departs from a location.", 22 | category: "Safety & Security", 23 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/text_presence.png", 24 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/text_presence@2x.png" 25 | ) 26 | 27 | preferences { 28 | section("When a presence sensor arrives or departs this location..") { 29 | input "presence", "capability.presenceSensor", title: "Which sensor?" 30 | } 31 | } 32 | 33 | def installed() { 34 | subscribe(presence, "presence", presenceHandler) 35 | } 36 | 37 | def updated() { 38 | unsubscribe() 39 | subscribe(presence, "presence", presenceHandler) 40 | } 41 | 42 | def presenceHandler(evt) { 43 | if (evt.value == "present") { 44 | // log.debug "${presence.label ?: presence.name} has arrived at the ${location}" 45 | sendPush("${presence.label ?: presence.name} has arrived at the ${location}") 46 | } else if (evt.value == "not present") { 47 | // log.debug "${presence.label ?: presence.name} has left the ${location}" 48 | sendPush("${presence.label ?: presence.name} has left the ${location}") 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /devicetypes/smartthings/light-sensor.src/light-sensor.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | definition (name: "Light Sensor", namespace: "smartthings", author: "SmartThings") { 16 | capability "Illuminance Measurement" 17 | capability "Sensor" 18 | 19 | fingerprint profileId: "0104", deviceId: "0106", inClusters: "0000,0001,0003,0009,0400" 20 | } 21 | 22 | // simulator metadata 23 | simulator { 24 | status "dark": "illuminance: 8" 25 | status "light": "illuminance: 300" 26 | status "bright": "illuminance: 1000" 27 | } 28 | 29 | // UI tile definitions 30 | tiles { 31 | valueTile("illuminance", "device.illuminance", width: 2, height: 2) { 32 | state("illuminance", label:'${currentValue}', unit:"lux", 33 | backgroundColors:[ 34 | [value: 9, color: "#767676"], 35 | [value: 315, color: "#ffa81e"], 36 | [value: 1000, color: "#fbd41b"] 37 | ] 38 | ) 39 | } 40 | 41 | main "illuminance" 42 | details "illuminance" 43 | } 44 | } 45 | 46 | // Parse incoming device messages to generate events 47 | def parse(String description) { 48 | def result 49 | if (description?.startsWith("illuminance: ")) { 50 | def raw = description - "illuminance: " 51 | if (raw.isNumber()) { 52 | result = createEvent( 53 | name: "illuminance", 54 | value: Math.round(zigbee.lux(raw as Integer)).toString(), 55 | unit: "lux" 56 | ) 57 | } 58 | } 59 | log.debug "Parse returned ${result?.descriptionText}" 60 | return result 61 | } 62 | -------------------------------------------------------------------------------- /devicetypes/smartthings/smartsense-motion-sensor.src/i18n/messages.properties: -------------------------------------------------------------------------------- 1 | # Copyright 2016 SmartThings 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 4 | # use this file except in compliance with the License. You may obtain a copy 5 | # of the License at: 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | # Korean (ko) 15 | # Device Preferences 16 | '''battery'''.ko=배터리 17 | '''Temperature Offset'''.ko=온도 직접 설정 18 | '''This feature allows you to correct any temperature variations by selecting an offset. Ex: If your sensor consistently reports a temp that's 5 degrees too warm, you'd enter '-5'. If 3 degrees too cold, enter '+3'.'''.ko=기준 온도를 원하는대로 몇 도 올리거나 내려서 설정할 수 있습니다. 19 | '''Degrees'''.ko=온도 20 | '''Adjust temperature by this many degrees'''.ko=몇 도씩 온도를 조절하십시오 21 | '''Give your device a name'''.ko=기기 이름 설정 22 | '''Motion Sensor'''.ko=모션 센서 23 | '''motion'''.ko= 동작 감지 24 | '''no motion'''.ko=동작 없음 25 | '''${currentValue}% battery'''.ko=${currentValue}% 배터리 26 | # Events descriptionText 27 | '''{{ device.displayName }} detected motion'''.ko={{ device.displayName }}에서 움직임이 감지되었습니다. 28 | '''{{ device.displayName }} motion has stopped'''.ko={{ device.displayName }}에서 움직임이 중단되었습니다. 29 | '''{{ device.displayName }} was {{ value }}°C'''.ko={{ device.displayName }}에서 {{ value }}°C 감지 30 | '''{{ device.displayName }} was {{ value }}°F'''.ko={{ device.displayName }}이(가) {{ value }}°F였습니다 31 | '''{{ device.displayName }} battery has too much power: (> 3.5) volts.'''.ko={{ device.displayName }} 배터리 전력이 너무 높습니다(3.5볼트 초과). 32 | '''{{ device.displayName }} battery was {{ value }}%'''.ko={{ device.displayName }}의 남은 배터리 {{ value }}% 33 | #============================================================================== 34 | -------------------------------------------------------------------------------- /smartapps/smartthings/turn-it-on-for-5-minutes.src/turn-it-on-for-5-minutes.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | * Turn It On For 5 Minutes 14 | * Turn on a switch when a contact sensor opens and then turn it back off 5 minutes later. 15 | * 16 | * Author: SmartThings 17 | */ 18 | definition( 19 | name: "Turn It On For 5 Minutes", 20 | namespace: "smartthings", 21 | author: "SmartThings", 22 | description: "When a SmartSense Multi is opened, a switch will be turned on, and then turned off after 5 minutes.", 23 | category: "Safety & Security", 24 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/light_contact-outlet.png", 25 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/light_contact-outlet@2x.png" 26 | ) 27 | 28 | preferences { 29 | section("When it opens..."){ 30 | input "contact1", "capability.contactSensor" 31 | } 32 | section("Turn on a switch for 5 minutes..."){ 33 | input "switch1", "capability.switch" 34 | } 35 | } 36 | 37 | def installed() { 38 | log.debug "Installed with settings: ${settings}" 39 | subscribe(contact1, "contact.open", contactOpenHandler) 40 | } 41 | 42 | def updated(settings) { 43 | log.debug "Updated with settings: ${settings}" 44 | unsubscribe() 45 | subscribe(contact1, "contact.open", contactOpenHandler) 46 | } 47 | 48 | def contactOpenHandler(evt) { 49 | switch1.on() 50 | def fiveMinuteDelay = 60 * 5 51 | runIn(fiveMinuteDelay, turnOffSwitch) 52 | } 53 | 54 | def turnOffSwitch() { 55 | switch1.off() 56 | } 57 | -------------------------------------------------------------------------------- /smartapps/smartthings/brighten-dark-places.src/brighten-dark-places.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | * Brighten Dark Places 14 | * 15 | * Author: SmartThings 16 | */ 17 | definition( 18 | name: "Brighten Dark Places", 19 | namespace: "smartthings", 20 | author: "SmartThings", 21 | description: "Turn your lights on when a open/close sensor opens and the space is dark.", 22 | category: "Convenience", 23 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/light_contact-outlet-luminance.png", 24 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/light_contact-outlet-luminance@2x.png" 25 | ) 26 | 27 | preferences { 28 | section("When the door opens...") { 29 | input "contact1", "capability.contactSensor", title: "Where?" 30 | } 31 | section("And it's dark...") { 32 | input "luminance1", "capability.illuminanceMeasurement", title: "Where?" 33 | } 34 | section("Turn on a light...") { 35 | input "switch1", "capability.switch" 36 | } 37 | } 38 | 39 | def installed() 40 | { 41 | subscribe(contact1, "contact.open", contactOpenHandler) 42 | } 43 | 44 | def updated() 45 | { 46 | unsubscribe() 47 | subscribe(contact1, "contact.open", contactOpenHandler) 48 | } 49 | 50 | def contactOpenHandler(evt) { 51 | def lightSensorState = luminance1.currentIlluminance 52 | log.debug "SENSOR = $lightSensorState" 53 | if (lightSensorState != null && lightSensorState < 10) { 54 | log.trace "light.on() ... [luminance: ${lightSensorState}]" 55 | switch1.on() 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /smartapps/hwustrack/coffee-after-shower.src/coffee-after-shower.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Coffee After Shower 3 | * 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing permissions and limitations under the License. 13 | * 14 | */ 15 | definition( 16 | name: "Coffee After Shower", 17 | namespace: "hwustrack", 18 | author: "Hans Wustrack", 19 | description: "This app is designed simply to turn on your coffee machine while you are taking a shower.", 20 | category: "My Apps", 21 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png", 22 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png") 23 | 24 | 25 | preferences { 26 | section("About") { 27 | paragraph "This app is designed simply to turn on your coffee machine " + 28 | "while you are taking a shower." 29 | } 30 | section("Bathroom humidity sensor") { 31 | input "bathroom", "capability.relativeHumidityMeasurement", title: "Which humidity sensor?" 32 | } 33 | section("Coffee maker to turn on") { 34 | input "coffee", "capability.switch", title: "Which switch?" 35 | } 36 | section("Humidity level to switch coffee on at") { 37 | input "relHum", "number", title: "Humidity level?", defaultValue: 50 38 | } 39 | } 40 | 41 | def installed() { 42 | subscribe(bathroom, "humidity", coffeeMaker) 43 | } 44 | 45 | def updated() { 46 | unsubscribe() 47 | subscribe(bathroom, "humidity", coffeeMaker) 48 | } 49 | 50 | def coffeeMaker(shower) { 51 | log.info "Humidity value: $shower.value" 52 | if (shower.value.toInteger() > relHum) { 53 | coffee.on() 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /smartapps/smartthings/turn-it-on-when-im-here.src/turn-it-on-when-im-here.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | * Turn It On When I'm Here 14 | * 15 | * Author: SmartThings 16 | */ 17 | definition( 18 | name: "Turn It On When I'm Here", 19 | namespace: "smartthings", 20 | author: "SmartThings", 21 | description: "Turn something on when you arrive and back off when you leave.", 22 | category: "Convenience", 23 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/light_presence-outlet.png", 24 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/light_presence-outlet@2x.png" 25 | ) 26 | 27 | preferences { 28 | section("When I arrive and leave..."){ 29 | input "presence1", "capability.presenceSensor", title: "Who?", multiple: true 30 | } 31 | section("Turn on/off a light..."){ 32 | input "switch1", "capability.switch", multiple: true 33 | } 34 | } 35 | 36 | def installed() 37 | { 38 | subscribe(presence1, "presence", presenceHandler) 39 | } 40 | 41 | def updated() 42 | { 43 | unsubscribe() 44 | subscribe(presence1, "presence", presenceHandler) 45 | } 46 | 47 | def presenceHandler(evt) 48 | { 49 | log.debug "presenceHandler $evt.name: $evt.value" 50 | def current = presence1.currentValue("presence") 51 | log.debug current 52 | def presenceValue = presence1.find{it.currentPresence == "present"} 53 | log.debug presenceValue 54 | if(presenceValue){ 55 | switch1.on() 56 | log.debug "Someone's home!" 57 | } 58 | else{ 59 | switch1.off() 60 | log.debug "Everyone's away." 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /devicetypes/smartthings/testing/simulated-lock.src/simulated-lock.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | // Automatically generated. Make future change here. 16 | definition (name: "Simulated Lock", namespace: "smartthings/testing", author: "bob") { 17 | capability "Lock" 18 | capability "Sensor" 19 | capability "Actuator" 20 | } 21 | 22 | // Simulated lock 23 | tiles { 24 | standardTile("toggle", "device.lock", width: 2, height: 2) { 25 | state "unlocked", label:'unlocked', action:"lock.lock", icon:"st.locks.lock.unlocked", backgroundColor:"#ffffff" 26 | state "locked", label:'locked', action:"lock.unlock", icon:"st.locks.lock.locked", backgroundColor:"#79b821" 27 | } 28 | standardTile("lock", "device.lock", inactiveLabel: false, decoration: "flat") { 29 | state "default", label:'lock', action:"lock.lock", icon:"st.locks.lock.locked" 30 | } 31 | standardTile("unlock", "device.lock", inactiveLabel: false, decoration: "flat") { 32 | state "default", label:'unlock', action:"lock.unlock", icon:"st.locks.lock.unlocked" 33 | } 34 | 35 | main "toggle" 36 | details(["toggle", "lock", "unlock"]) 37 | } 38 | } 39 | 40 | def parse(String description) { 41 | log.trace "parse $description" 42 | def pair = description.split(":") 43 | createEvent(name: pair[0].trim(), value: pair[1].trim()) 44 | } 45 | 46 | def lock() { 47 | log.trace "lock()" 48 | sendEvent(name: "lock", value: "locked") 49 | } 50 | 51 | def unlock() { 52 | log.trace "unlock()" 53 | sendEvent(name: "lock", value: "unlocked") 54 | } 55 | -------------------------------------------------------------------------------- /devicetypes/smartthings/testing/simulated-water-sensor.src/simulated-water-sensor.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | // Automatically generated. Make future change here. 16 | definition (name: "Simulated Water Sensor", namespace: "smartthings/testing", author: "SmartThings") { 17 | capability "Water Sensor" 18 | capability "Sensor" 19 | 20 | command "wet" 21 | command "dry" 22 | } 23 | 24 | simulator { 25 | status "wet": "water:wet" 26 | status "dry": "water:dry" 27 | } 28 | 29 | tiles { 30 | standardTile("water", "device.water", width: 2, height: 2) { 31 | state "dry", icon:"st.alarm.water.dry", backgroundColor:"#ffffff", action: "wet" 32 | state "wet", icon:"st.alarm.water.wet", backgroundColor:"#53a7c0", action: "dry" 33 | } 34 | standardTile("wet", "device.water", inactiveLabel: false, decoration: "flat") { 35 | state "default", label:'Wet', action:"wet", icon: "st.alarm.water.wet" 36 | } 37 | standardTile("dry", "device.water", inactiveLabel: false, decoration: "flat") { 38 | state "default", label:'Dry', action:"dry", icon: "st.alarm.water.dry" 39 | } 40 | main "water" 41 | details(["water","wet","dry"]) 42 | } 43 | } 44 | 45 | def parse(String description) { 46 | def pair = description.split(":") 47 | createEvent(name: pair[0].trim(), value: pair[1].trim()) 48 | } 49 | 50 | def wet() { 51 | log.trace "wet()" 52 | sendEvent(name: "water", value: "wet") 53 | } 54 | 55 | def dry() { 56 | log.trace "dry()" 57 | sendEvent(name: "water", value: "dry") 58 | } 59 | -------------------------------------------------------------------------------- /devicetypes/smartthings/pet-feeder-shield.src/pet-feeder-shield.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | definition (name: "Pet Feeder Shield", namespace: "smartthings", author: "SmartThings") { 16 | 17 | command "feed" 18 | } 19 | 20 | // Simulator metadata 21 | simulator { 22 | // status messages 23 | status "ping": "catchall: 0104 0000 01 01 0040 00 6A67 00 00 0000 0A 00 0A70696E67" 24 | status "response": "catchall: 0104 0000 01 01 0040 00 0A21 00 00 0000 0A 00 0A4F4D4E4F4D4E4F4D4E4F4D" 25 | 26 | // reply messages 27 | reply "raw 0x0 { 00 00 0a 0a 6f 6e }": "catchall: 0104 0000 01 01 0040 00 0A21 00 00 0000 0A 00 0A6F6E" 28 | reply "raw 0x0 { 00 00 0a 0a 6f 66 66 }": "catchall: 0104 0000 01 01 0040 00 0A21 00 00 0000 0A 00 0A6F6666" 29 | } 30 | 31 | // UI tile definitions 32 | tiles { 33 | standardTile("feeder", "device.petFeederShield", width: 2, height: 2, canChangeBackground: true) { 34 | state "default", action: "feed", icon: "st.shields.shields.pet-feeder", backgroundColor: "#ffffff" 35 | } 36 | 37 | main "feeder" 38 | details "feeder" 39 | } 40 | } 41 | 42 | // Parse incoming device messages to generate events 43 | def parse(String description) { 44 | def value = zigbee.parse(description)?.text 45 | def name = value && value != "ping" ? "response" : null 46 | def result = createEvent(name: name, value: value) 47 | log.debug "Parse returned ${result?.descriptionText}" 48 | return result 49 | } 50 | 51 | // Commands sent to the device 52 | def feed() { 53 | zigbee.smartShield(text: "feed" ).format() 54 | } 55 | -------------------------------------------------------------------------------- /devicetypes/smartthings/smartsense-moisture-sensor.src/README.md: -------------------------------------------------------------------------------- 1 | # Smartsense Moisture Sensor 2 | 3 | 4 | 5 | Works with: 6 | 7 | * [Samsung SmartThings Moisture Sensor](https://shop.smartthings.com/#!/products/samsung-smartthings-water-leak-sensor) 8 | 9 | ## Table of contents 10 | 11 | * [Capabilities](#capabilities) 12 | * [Health](#device-health) 13 | * [Battery](#battery-specification) 14 | 15 | ## Capabilities 16 | 17 | * **Configuration** - _configure()_ command called when device is installed or device preferences updated 18 | * **Battery** - defines device uses a battery 19 | * **Refresh** - _refresh()_ command for status updates 20 | * **Temperature Measurement** - defines device measures current temperature 21 | * **Water Sensor** - can detect presence of water (dry or wet) 22 | * **Health Check** - indicates ability to get device health notifications 23 | 24 | ## Device Health 25 | 26 | A Category C2 moisture sensor with maxReportTime of 5 mins. 27 | Check-in interval is double the value of maxReportTime. 28 | This gives the device twice the amount of time to respond before it is marked as offline. 29 | Check-in interval = 12 mins 30 | 31 | ## Battery Specification 32 | 33 | One CR2 3V battery required. 34 | 35 | ## Troubleshooting 36 | 37 | If the sensor doesn't pair when trying from the SmartThings mobile app, it is possible that the sensor is out of range. 38 | Pairing needs to be tried again by placing the sensor closer to the hub. 39 | Instructions related to pairing, resetting and removing the different sensors from SmartThings can be found in the following links 40 | for the different models: 41 | * [SmartSense Moisture Sensor Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/202847044-SmartSense-Moisture-Sensor) 42 | * [Samsung SmartThings Water Leak Sensor Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/205957630) 43 | Other troubleshooting tips are listed as follows: 44 | * [Troubleshooting: Samsung SmartThings Water Leak Sensor won’t pair after removing pull-tab](https://support.smartthings.com/hc/en-us/articles/204966616-Troubleshooting-Samsung-SmartThings-device-won-t-pair-after-removing-pull-tab) 45 | -------------------------------------------------------------------------------- /smartapps/smartthings/text-me-when-it-opens.src/text-me-when-it-opens.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | * Text Me When It Opens 14 | * 15 | * Author: SmartThings 16 | */ 17 | definition( 18 | name: "Text Me When It Opens", 19 | namespace: "smartthings", 20 | author: "SmartThings", 21 | description: "Get a text message sent to your phone when an open/close sensor is opened.", 22 | category: "Convenience", 23 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/window_contact.png", 24 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/window_contact@2x.png" 25 | ) 26 | 27 | preferences { 28 | section("When the door opens...") { 29 | input "contact1", "capability.contactSensor", title: "Where?" 30 | } 31 | section("Text me at...") { 32 | input("recipients", "contact", title: "Send notifications to") { 33 | input "phone1", "phone", title: "Phone number?" 34 | } 35 | } 36 | } 37 | 38 | def installed() 39 | { 40 | subscribe(contact1, "contact.open", contactOpenHandler) 41 | } 42 | 43 | def updated() 44 | { 45 | unsubscribe() 46 | subscribe(contact1, "contact.open", contactOpenHandler) 47 | } 48 | 49 | def contactOpenHandler(evt) { 50 | log.trace "$evt.value: $evt, $settings" 51 | log.debug "$contact1 was opened, sending text" 52 | if (location.contactBookEnabled) { 53 | sendNotificationToContacts("Your ${contact1.label ?: contact1.name} was opened", recipients) 54 | } 55 | else { 56 | sendSms(phone1, "Your ${contact1.label ?: contact1.name} was opened") 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /smartapps/smartthings/power-allowance.src/power-allowance.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | * Power Allowance 14 | * 15 | * Author: SmartThings 16 | */ 17 | definition( 18 | name: "Power Allowance", 19 | namespace: "smartthings", 20 | author: "SmartThings", 21 | description: "Save energy or restrict total time an appliance (like a curling iron or TV) can be in use. When a switch turns on, automatically turn it back off after a set number of minutes you specify.", 22 | category: "Green Living", 23 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/light_outlet.png", 24 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/light_outlet@2x.png" 25 | ) 26 | 27 | preferences { 28 | section("When a switch turns on...") { 29 | input "theSwitch", "capability.switch" 30 | } 31 | section("Turn it off how many minutes later?") { 32 | input "minutesLater", "number", title: "When?" 33 | } 34 | } 35 | 36 | def installed() { 37 | log.debug "Installed with settings: ${settings}" 38 | subscribe(theSwitch, "switch.on", switchOnHandler, [filterEvents: false]) 39 | } 40 | 41 | def updated() { 42 | log.debug "Updated with settings: ${settings}" 43 | 44 | unsubscribe() 45 | subscribe(theSwitch, "switch.on", switchOnHandler, [filterEvents: false]) 46 | } 47 | 48 | def switchOnHandler(evt) { 49 | log.debug "Switch ${theSwitch} turned: ${evt.value}" 50 | def delay = minutesLater * 60 51 | log.debug "Turning off in ${minutesLater} minutes (${delay}seconds)" 52 | runIn(delay, turnOffSwitch) 53 | } 54 | 55 | def turnOffSwitch() { 56 | theSwitch.off() 57 | } 58 | -------------------------------------------------------------------------------- /smartapps/smartthings/once-a-day.src/once-a-day.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | * Once a Day 14 | * 15 | * Author: SmartThings 16 | * 17 | * Turn on one or more switches at a specified time and turn them off at a later time. 18 | */ 19 | 20 | definition( 21 | name: "Once a Day", 22 | namespace: "smartthings", 23 | author: "SmartThings", 24 | description: "Turn on one or more switches at a specified time and turn them off at a later time.", 25 | category: "Convenience", 26 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/light_outlet.png", 27 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/light_outlet@2x.png" 28 | ) 29 | 30 | preferences { 31 | section("Select switches to control...") { 32 | input name: "switches", type: "capability.switch", multiple: true 33 | } 34 | section("Turn them all on at...") { 35 | input name: "startTime", title: "Turn On Time?", type: "time" 36 | } 37 | section("And turn them off at...") { 38 | input name: "stopTime", title: "Turn Off Time?", type: "time" 39 | } 40 | } 41 | 42 | def installed() { 43 | log.debug "Installed with settings: ${settings}" 44 | schedule(startTime, "startTimerCallback") 45 | schedule(stopTime, "stopTimerCallback") 46 | 47 | } 48 | 49 | def updated(settings) { 50 | unschedule() 51 | schedule(startTime, "startTimerCallback") 52 | schedule(stopTime, "stopTimerCallback") 53 | } 54 | 55 | def startTimerCallback() { 56 | log.debug "Turning on switches" 57 | switches.on() 58 | 59 | } 60 | 61 | def stopTimerCallback() { 62 | log.debug "Turning off switches" 63 | switches.off() 64 | } 65 | -------------------------------------------------------------------------------- /devicetypes/smartthings/motion-detector.src/motion-detector.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | definition (name: "Motion Detector", namespace: "smartthings", author: "SmartThings") { 16 | capability "Motion Sensor" 17 | capability "Sensor" 18 | 19 | fingerprint profileId: "0104", deviceId: "0402", inClusters: "0000,0001,0003,0009,0500" 20 | } 21 | 22 | // simulator metadata 23 | simulator { 24 | status "active": "zone report :: type: 19 value: 0031" 25 | status "inactive": "zone report :: type: 19 value: 0030" 26 | } 27 | 28 | // UI tile definitions 29 | tiles { 30 | standardTile("motion", "device.motion", width: 2, height: 2) { 31 | state("active", label:'motion', icon:"st.motion.motion.active", backgroundColor:"#53a7c0") 32 | state("inactive", label:'no motion', icon:"st.motion.motion.inactive", backgroundColor:"#ffffff") 33 | } 34 | 35 | main "motion" 36 | details "motion" 37 | } 38 | } 39 | 40 | // Parse incoming device messages to generate events 41 | def parse(String description) { 42 | def name = null 43 | def value = description 44 | def descriptionText = null 45 | if (zigbee.isZoneType19(description)) { 46 | name = "motion" 47 | def isActive = zigbee.translateStatusZoneType19(description) 48 | value = isActive ? "active" : "inactive" 49 | descriptionText = isActive ? "${device.displayName} detected motion" : "${device.displayName} motion has stopped" 50 | } 51 | 52 | def result = createEvent( 53 | name: name, 54 | value: value, 55 | descriptionText: descriptionText 56 | ) 57 | 58 | log.debug "Parse returned ${result?.descriptionText}" 59 | return result 60 | } 61 | -------------------------------------------------------------------------------- /smartapps/imbrianj/hall-light-welcome-home.src/hall-light-welcome-home.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Hall Light: Welcome Home 3 | * 4 | * Author: brian@bevey.org 5 | * Date: 9/25/13 6 | * 7 | * Turn on the hall light if someone comes home (presence) and the door opens. 8 | */ 9 | 10 | definition( 11 | name: "Hall Light: Welcome Home", 12 | namespace: "imbrianj", 13 | author: "brian@bevey.org", 14 | description: "Turn on the hall light if someone comes home (presence) and the door opens.", 15 | category: "Convenience", 16 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png", 17 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience%402x.png" 18 | ) 19 | 20 | preferences { 21 | section("People to watch for?") { 22 | input "people", "capability.presenceSensor", multiple: true 23 | } 24 | 25 | section("Front Door?") { 26 | input "sensors", "capability.contactSensor", multiple: true 27 | } 28 | 29 | section("Hall Light?") { 30 | input "lights", "capability.switch", title: "Switch Turned On", multilple: true 31 | } 32 | 33 | section("Presence Delay (defaults to 30s)?") { 34 | input name: "presenceDelay", type: "number", title: "How Long?", required: false 35 | } 36 | 37 | section("Door Contact Delay (defaults to 10s)?") { 38 | input name: "contactDelay", type: "number", title: "How Long?", required: false 39 | } 40 | } 41 | 42 | def installed() { 43 | init() 44 | } 45 | 46 | def updated() { 47 | unsubscribe() 48 | init() 49 | } 50 | 51 | def init() { 52 | state.lastClosed = now() 53 | subscribe(people, "presence.present", presence) 54 | subscribe(sensors, "contact.open", doorOpened) 55 | } 56 | 57 | def presence(evt) { 58 | def delay = contactDelay ?: 10 59 | 60 | state.lastPresence = now() 61 | 62 | if(now() - (delay * 1000) < state.lastContact) { 63 | log.info('Presence was delayed, but you probably still want the light on.') 64 | lights?.on() 65 | } 66 | } 67 | 68 | def doorOpened(evt) { 69 | def delay = presenceDelay ?: 30 70 | 71 | state.lastContact = now() 72 | 73 | if(now() - (delay * 1000) < state.lastPresence) { 74 | log.info('Welcome home! Let me get that light for you.') 75 | lights?.on() 76 | } 77 | } -------------------------------------------------------------------------------- /devicetypes/smartthings/smartpower-outlet-v1.src/smartpower-outlet-v1.groovy: -------------------------------------------------------------------------------- 1 | metadata { 2 | // Automatically generated. Make future change here. 3 | definition (name: "SmartPower Outlet V1", namespace: "smartthings", author: "SmartThings") { 4 | capability "Actuator" 5 | capability "Switch" 6 | capability "Sensor" 7 | 8 | fingerprint profileId: "0104", inClusters: "0006, 0004, 0003, 0000, 0005", outClusters: "0019", manufacturer: "Compacta International, Ltd", model: "ZBMPlug15", deviceJoinName: "SmartPower Outlet V1" 9 | } 10 | 11 | // simulator metadata 12 | simulator { 13 | // status messages 14 | status "on": "on/off: 1" 15 | status "off": "on/off: 0" 16 | 17 | // reply messages 18 | reply "zcl on-off on": "on/off: 1" 19 | reply "zcl on-off off": "on/off: 0" 20 | } 21 | 22 | tiles(scale: 2) { 23 | multiAttributeTile(name:"switch", type: "lighting", width: 6, height: 4, canChangeIcon: true){ 24 | tileAttribute ("device.switch", key: "PRIMARY_CONTROL") { 25 | attributeState "off", label: '${name}', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff" 26 | attributeState "on", label: '${name}', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#79b821" 27 | } 28 | } 29 | main "switch" 30 | details "switch" 31 | } 32 | } 33 | 34 | // Parse incoming device messages to generate events 35 | def parse(String description) { 36 | if (description?.startsWith("catchall: 0104 000A")) { 37 | log.debug "Dropping catchall for SmartPower Outlet" 38 | return [] 39 | } else { 40 | def name = description?.startsWith("on/off: ") ? "switch" : null 41 | def value = name == "switch" ? (description?.endsWith(" 1") ? "on" : "off") : null 42 | def result = createEvent(name: name, value: value) 43 | log.debug "Parse returned ${result?.descriptionText}" 44 | return result 45 | } 46 | } 47 | 48 | // Commands to device 49 | def on() { 50 | [ 51 | 'zcl on-off on', 52 | 'delay 200', 53 | "send 0x${zigbee.deviceNetworkId} 0x01 0x${zigbee.endpointId}", 54 | 'delay 500' 55 | 56 | ] 57 | 58 | } 59 | 60 | def off() { 61 | [ 62 | 'zcl on-off off', 63 | 'delay 200', 64 | "send 0x${zigbee.deviceNetworkId} 0x01 0x${zigbee.endpointId}", 65 | 'delay 500' 66 | ] 67 | } 68 | -------------------------------------------------------------------------------- /devicetypes/smartthings/tile-ux/README.md: -------------------------------------------------------------------------------- 1 | # Device Tiles Examples and Reference 2 | 3 | This package contains examples of Device tiles, organized by tile type. 4 | 5 | ## Purpose 6 | 7 | Each Device Handler shows example usages of a specific tile, and is meant to represent the variety of permutations that a tile can be configured. 8 | 9 | The various tiles can be used by QA to test tiles on all supported mobile devices, and by developers as a reference implementation. 10 | 11 | ## Installation 12 | 13 | 1. Self-publish the Device Handlers in this package. 14 | 2. Self-publish the Device Tile Controller SmartApp. The SmartApp can be found [here](https://github.com/SmartThingsCommunity/SmartThingsPublic/blob/master/smartapps/smartthings/tile-ux/device-tile-controller.src/device-tile-controller.groovy). 15 | 3. Install the SmartApp from the Marketplace, under "My Apps". 16 | 4. Select the simulated devices you want to install and press "Done". 17 | 18 | The simulated devices can then be found in the "Things" view of "My Home" in the mobile app. 19 | You may wish to create a new room for these simulated devices for easy access. 20 | 21 | ## Usage 22 | 23 | Each simulated device can be interacted with like other devices. 24 | You can use the mobile app to interact with the tiles to see how they look and behave. 25 | 26 | ## Troubleshooting 27 | 28 | If you get an error when installing the simulated devices using the controller SmartApp, ensure that you have published all the Device Handlers for yourself. 29 | Also check live logging to see if there is a specific tile that is causing installation issues. 30 | 31 | ## FAQ 32 | 33 | *Question: A tile isn't behaving as expected. What should I do?* 34 | 35 | QA should create a JIRA ticket for any issues or inconsistencies of tiles across devices. 36 | 37 | Developers may file a support ticket, and reference the specific tile and issue observed. 38 | 39 | *Question: I'd like to contribute an example tile usage that would be helpful for testing and reference purposes. Can I do that?* 40 | 41 | We recommend that you open an issue in the SmartThingsPublic repository describing the example tile and usage. 42 | That way we can discuss with you the proposed change, and then if appropriate you can create a PR associated to the issue. 43 | -------------------------------------------------------------------------------- /devicetypes/smartthings/logitech-harmony-hub-c2c.src/logitech-harmony-hub-c2c.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Logitech Harmony Hub 3 | * 4 | * Author: SmartThings 5 | */ 6 | metadata { 7 | definition (name: "Logitech Harmony Hub C2C", namespace: "smartthings", author: "SmartThings") { 8 | capability "Media Controller" 9 | capability "Refresh" 10 | 11 | command "activityoff" 12 | command "alloff" 13 | command "refresh" 14 | } 15 | 16 | simulator { 17 | } 18 | 19 | tiles { 20 | standardTile("icon", "icon", width: 1, height: 1, canChangeIcon: false, inactiveLabel: true, canChangeBackground: false) { 21 | state "default", label: "Harmony", action: "", icon: "st.harmony.harmony-hub-icon", backgroundColor: "#FFFFFF" 22 | } 23 | valueTile("currentActivity", "device.currentActivity", decoration: "flat", height: 1, width: 3, inactiveLabel: false) { 24 | state "default", label:'${currentValue}' 25 | } 26 | standardTile("huboff", "device.switch", inactiveLabel: false, decoration: "flat") { 27 | state "default", label:'End Activity', action:"activityoff", icon:"st.harmony.harmony-hub-icon" 28 | } 29 | standardTile("alloff", "device.switch", inactiveLabel: false, decoration: "flat") { 30 | state "default", label:'All Activities', action:"alloff", icon:"st.secondary.off" 31 | } 32 | standardTile("refresh", "device.power", inactiveLabel: false, decoration: "flat") { 33 | state "default", label:'', action:"refresh.refresh", icon:"st.secondary.refresh" 34 | } 35 | 36 | main (["icon"]) 37 | details(["currentActivity", "huboff", "refresh"]) 38 | } 39 | } 40 | 41 | def startActivity(String activityId) { 42 | log.debug "Executing 'Start Activity'" 43 | log.trace parent.activity("$device.deviceNetworkId-$activityId","start") 44 | } 45 | 46 | def activityoff() { 47 | log.debug "Executing 'Activity Off'" 48 | log.trace parent.activity(device.deviceNetworkId,"hub") 49 | } 50 | 51 | def alloff() { 52 | log.debug "Executing 'All Off'" 53 | log.trace parent.activity("all","end") 54 | } 55 | 56 | def poll() { 57 | log.debug "Executing 'Poll'" 58 | log.trace parent.poll() 59 | } 60 | 61 | def refresh() { 62 | log.debug "Executing 'Refresh'" 63 | log.trace parent.poll() 64 | } 65 | -------------------------------------------------------------------------------- /smartapps/smartthings/habit-helper.src/habit-helper.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | * Habit Helper 14 | * Every day at a specific time, get a text reminding you about your habit 15 | * 16 | * Author: SmartThings 17 | */ 18 | definition( 19 | name: "Habit Helper", 20 | namespace: "smartthings", 21 | author: "SmartThings", 22 | description: "Add something you want to be reminded about each day and get a text message to help you form positive habits.", 23 | category: "Family", 24 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/text.png", 25 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/text@2x.png" 26 | ) 27 | 28 | preferences { 29 | section("Remind me about..."){ 30 | input "message1", "text", title: "What?" 31 | } 32 | section("At what time?"){ 33 | input "time1", "time", title: "When?" 34 | } 35 | section("Text me at..."){ 36 | input("recipients", "contact", title: "Send notifications to") { 37 | input "phone1", "phone", title: "Phone number?" 38 | } 39 | } 40 | } 41 | 42 | def installed() 43 | { 44 | schedule(time1, "scheduleCheck") 45 | } 46 | 47 | def updated() 48 | { 49 | unschedule() 50 | schedule(time1, "scheduleCheck") 51 | } 52 | 53 | def scheduleCheck() 54 | { 55 | log.trace "scheduledCheck" 56 | 57 | def message = message1 ?: "SmartThings - Habit Helper Reminder!" 58 | 59 | if (location.contactBookEnabled) { 60 | log.debug "Texting reminder to contacts:${recipients?.size()}" 61 | sendNotificationToContacts(message, recipients) 62 | } 63 | else { 64 | log.debug "Texting reminder" 65 | sendSms(phone1, message) 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /devicetypes/smartthings/tile-ux/tile-basic-presence.src/tile-basic-presence.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2016 SmartThings, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | definition ( 16 | name: "presenceDeviceTile", 17 | namespace: "smartthings/tile-ux", 18 | author: "SmartThings") { 19 | 20 | capability "Presence Sensor" 21 | 22 | command "arrived" 23 | command "departed" 24 | } 25 | 26 | tiles(scale: 2) { 27 | // You only get a presence tile view when the size is 3x3 otherwise it's a value tile 28 | standardTile("presence", "device.presence", width: 3, height: 3, canChangeBackground: true) { 29 | state("present", labelIcon:"st.presence.tile.mobile-present", backgroundColor:"#53a7c0") 30 | state("not present", labelIcon:"st.presence.tile.mobile-not-present", backgroundColor:"#ebeef2") 31 | } 32 | 33 | standardTile("notPresentBtn", "device.fake", width: 3, height: 3, decoration: "flat") { 34 | state("not present", label:'not present', backgroundColor:"#ffffff", action:"departed") 35 | } 36 | 37 | standardTile("presentBtn", "device.fake", width: 3, height: 3, decoration: "flat") { 38 | state("present", label:'present', backgroundColor:"#53a7c0", action:"arrived") 39 | } 40 | 41 | main("presence") 42 | details([ 43 | "presence", "presenceControl", "notPresentBtn", "presentBtn" 44 | ]) 45 | } 46 | } 47 | 48 | def installed() { 49 | sendEvent(name: "presence", value: "present") 50 | } 51 | 52 | def parse(String description) { 53 | } 54 | 55 | def arrived() { 56 | log.trace "Executing 'arrived'" 57 | sendEvent(name: "presence", value: "present") 58 | } 59 | 60 | def departed() { 61 | log.trace "Executing 'arrived'" 62 | sendEvent(name: "presence", value: "not present") 63 | } 64 | -------------------------------------------------------------------------------- /smartapps/smartthings/energy-saver.src/energy-saver.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Energy Saver 3 | * 4 | * Copyright 2014 SmartThings 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 7 | * in compliance with the License. You may obtain a copy of the License at: 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 12 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing permissions and limitations under the License. 14 | * 15 | */ 16 | definition( 17 | name: "Energy Saver", 18 | namespace: "smartthings", 19 | author: "SmartThings", 20 | description: "Turn things off if you're using too much energy", 21 | category: "Green Living", 22 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/light_outlet.png", 23 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/light_outlet@2x.png", 24 | iconX3Url: "https://s3.amazonaws.com/smartapp-icons/Meta/light_outlet@2x.png" 25 | ) 26 | 27 | preferences { 28 | section { 29 | input(name: "meter", type: "capability.powerMeter", title: "When This Power Meter...", required: true, multiple: false, description: null) 30 | input(name: "threshold", type: "number", title: "Reports Above...", required: true, description: "in either watts or kw.") 31 | } 32 | section { 33 | input(name: "switches", type: "capability.switch", title: "Turn Off These Switches", required: true, multiple: true, description: null) 34 | } 35 | } 36 | 37 | def installed() { 38 | log.debug "Installed with settings: ${settings}" 39 | initialize() 40 | } 41 | 42 | def updated() { 43 | log.debug "Updated with settings: ${settings}" 44 | unsubscribe() 45 | initialize() 46 | } 47 | 48 | def initialize() { 49 | subscribe(meter, "power", meterHandler) 50 | } 51 | 52 | def meterHandler(evt) { 53 | def meterValue = evt.value as double 54 | def thresholdValue = threshold as int 55 | if (meterValue > thresholdValue) { 56 | log.debug "${meter} reported energy consumption above ${threshold}. Turning of switches." 57 | switches.off() 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /smartapps/sidjohn1/smart-turn-it-on.src/smart-turn-it-on.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Smart turn it on 3 | * 4 | * Author: sidjohn1@gmail.com 5 | * Date: 2013-10-21 6 | */ 7 | 8 | // Automatically generated. Make future change here. 9 | definition( 10 | name: "Smart turn it on", 11 | namespace: "sidjohn1", 12 | author: "sidjohn1@gmail.com", 13 | description: "Turns on selected device(s) at a set time on selected days of the week only if a selected person is present and turns off selected device(s) after a set time.", 14 | category: "Convenience", 15 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png", 16 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience%402x.png" 17 | ) 18 | 19 | preferences { 20 | section("Turn on which device?"){ 21 | input "switchOne", "capability.switch",title:"Select Light", required: true, multiple: true 22 | } 23 | section("For Whom?") { 24 | input "presenceOne", "capability.presenceSensor", title: "Select Person", required: true, multiple: true 25 | } 26 | section("On which Days?") { 27 | input "dayOne", "enum", title:"Select Days", required: true, multiple:true, metadata: [values: ['Mon','Tue','Wed','Thu','Fri','Sat','Sun']] 28 | } 29 | section("At what time?") { 30 | input name: "timeOne", title: "Select Time", type: "time", required: true 31 | } 32 | section("For how long?") { 33 | input name: "timeTwo", title: "Number of minutes", type: "number", required: true 34 | } 35 | } 36 | 37 | def installed() { 38 | if (timeOne) 39 | { 40 | log.debug "scheduling 'Smart turn it on' to run at $timeOne" 41 | schedule(timeOne, "turnOn") 42 | } 43 | } 44 | 45 | def updated() { 46 | unsubscribe() 47 | unschedule() 48 | if (timeOne) 49 | { 50 | log.debug "scheduling 'Smart turn it on' to run at $timeOne" 51 | schedule(timeOne, "turnOn") 52 | } 53 | } 54 | 55 | def turnOn(){ 56 | log.debug "Start" 57 | def dayCheck = dayOne.contains(new Date().format("EEE")) 58 | def dayTwo = new Date().format("EEE"); 59 | if(dayCheck){ 60 | def presenceTwo = presenceOne.latestValue("presence").contains("present") 61 | if (presenceTwo) { 62 | switchOne.on() 63 | def delay = timeTwo * 60 64 | runIn(delay, "turnOff") 65 | } 66 | } 67 | } 68 | 69 | 70 | 71 | def turnOff() { 72 | switchOne.off() 73 | } -------------------------------------------------------------------------------- /devicetypes/smartthings/smartsense-multi-sensor.src/i18n/messages.properties: -------------------------------------------------------------------------------- 1 | # Copyright 2016 SmartThings 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 4 | # use this file except in compliance with the License. You may obtain a copy 5 | # of the License at: 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | # Korean (ko) 15 | # Device Preferences 16 | '''Yes'''.ko=예 17 | '''No'''.ko=아니요 18 | '''battery'''.ko=배터리 19 | '''Temperature Offset'''.ko=온도 직접 설정 20 | '''This feature allows you to correct any temperature variations by selecting an offset. Ex: If your sensor consistently reports a temp that's 5 degrees too warm, you'd enter '-5'. If 3 degrees too cold, enter '+3'.'''.ko=기준 온도를 원하는대로 몇 도 올리거나 내려서 설정할 수 있습니다. 21 | '''Degrees'''.ko=온도 22 | '''Adjust temperature by this many degrees'''.ko=몇 도씩 온도를 조절하십시오 23 | '''Do you want to use this sensor on a garage door?'''.ko=차고 문의 센서 사용 설정하기 24 | '''Tap to set'''.ko=눌러서 설정 25 | '''Give your device a name'''.ko=기기 이름 설정 26 | '''Multipurpose Sensor'''.ko=문 및 창 센서 27 | # Events descriptionText 28 | '''{{ device.displayName }} was opened'''.ko={{ device.displayName }}에서 열림이 감지되었습니다. 29 | '''{{ device.displayName }} was closed'''.ko={{ device.displayName }}에서 닫힘이 감지되었습니다. 30 | '''{{ device.displayName }} was active'''.ko={{ device.displayName }} 활성화 31 | '''{{ device.displayName }} was inactive'''.ko={{ device.displayName }} 비활성화 32 | '''{{ device.displayName }} was {{ value }}°C'''.ko={{ device.displayName }}에서 {{ value }}°C 감지 33 | '''{{ device.displayName }} was {{ value }}°F'''.ko={{ device.displayName }}이(가) {{ value }}°F였습니다 34 | '''{{ device.displayName }} battery was {{ value }}%'''.ko={{ device.displayName }}의 남은 배터리 {{ value }}% 35 | '''Updating device to garage sensor'''.ko=기기-차고 센서 업데이트 중 36 | '''Updating device to open/close sensor'''.ko=기기-열림/닫힘 센서 업데이트 중 37 | '''Inactive'''.ko=비활성 상태 38 | '''Active'''.ko=활성 상태 39 | '''Open'''.ko= 열림이 감지될 때 40 | '''Closed'''.ko=닫힘 41 | '''${currentValue}% battery'''.ko=${currentValue}% 배터리 42 | -------------------------------------------------------------------------------- /devicetypes/smartthings/on-off-shield.src/on-off-shield.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | definition (name: "On/Off Shield", namespace: "smartthings", author: "SmartThings") { 16 | capability "Actuator" 17 | capability "Switch" 18 | capability "Sensor" 19 | } 20 | 21 | // Simulator metadata 22 | simulator { 23 | status "on": "catchall: 0104 0000 01 01 0040 00 0A21 00 00 0000 0A 00 0A6F6E" 24 | status "off": "catchall: 0104 0000 01 01 0040 00 0A21 00 00 0000 0A 00 0A6F6666" 25 | 26 | // reply messages 27 | reply "raw 0x0 { 00 00 0a 0a 6f 6e }": "catchall: 0104 0000 01 01 0040 00 0A21 00 00 0000 0A 00 0A6F6E" 28 | reply "raw 0x0 { 00 00 0a 0a 6f 66 66 }": "catchall: 0104 0000 01 01 0040 00 0A21 00 00 0000 0A 00 0A6F6666" 29 | } 30 | 31 | // UI tile definitions 32 | tiles { 33 | standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true, canChangeBackground: true) { 34 | state "on", label: '${name}', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#79b821" 35 | state "off", label: '${name}', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff" 36 | } 37 | 38 | main "switch" 39 | details "switch" 40 | } 41 | } 42 | 43 | // Parse incoming device messages to generate events 44 | def parse(String description) { 45 | def value = zigbee.parse(description)?.text 46 | def name = value in ["on","off"] ? "switch" : null 47 | def result = createEvent(name: name, value: value) 48 | log.debug "Parse returned ${result?.descriptionText}" 49 | return result 50 | } 51 | 52 | // Commands sent to the device 53 | def on() { 54 | zigbee.smartShield(text: "on").format() 55 | } 56 | 57 | def off() { 58 | zigbee.smartShield(text: "off").format() 59 | } 60 | -------------------------------------------------------------------------------- /devicetypes/dianoga/netatmo-additional-module.src/netatmo-additional-module.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * netatmo-basestation 3 | * 4 | * Copyright 2014 Brian Steere 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 7 | * in compliance with the License. You may obtain a copy of the License at: 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 12 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing permissions and limitations under the License. 14 | * 15 | */ 16 | metadata { 17 | definition (name: "Netatmo Additional Module", namespace: "dianoga", author: "Brian Steere") { 18 | capability "Sensor" 19 | capability "Relative Humidity Measurement" 20 | capability "Temperature Measurement" 21 | 22 | attribute "carbonDioxide", "string" 23 | } 24 | 25 | simulator { 26 | // TODO: define status and reply messages here 27 | } 28 | 29 | tiles { 30 | valueTile("temperature", "device.temperature", width: 2, height: 2) { 31 | state("temperature", label: '${currentValue}°', unit:"F", backgroundColors: [ 32 | [value: 31, color: "#153591"], 33 | [value: 44, color: "#1e9cbb"], 34 | [value: 59, color: "#90d2a7"], 35 | [value: 74, color: "#44b621"], 36 | [value: 84, color: "#f1d801"], 37 | [value: 95, color: "#d04e00"], 38 | [value: 96, color: "#bc2323"] 39 | ] 40 | ) 41 | } 42 | valueTile("humidity", "device.humidity", inactiveLabel: false) { 43 | state "default", label:'${currentValue}%', unit:"Humidity" 44 | } 45 | valueTile("carbonDioxide", "device.carbonDioxide", inactiveLabel: false) { 46 | state "default", label:'${currentValue}ppm', unit:"CO2" 47 | } 48 | standardTile("refresh", "device.pressure", inactiveLabel: false, decoration: "flat") { 49 | state "default", action:"device.poll", icon:"st.secondary.refresh" 50 | } 51 | main "temperature" 52 | details(["temperature", "humidity", "carbonDioxide", "refresh"]) 53 | } 54 | } 55 | 56 | // parse events into attributes 57 | def parse(String description) { 58 | log.debug "Parsing '${description}'" 59 | 60 | } 61 | 62 | def poll() { 63 | parent.poll() 64 | } -------------------------------------------------------------------------------- /devicetypes/dianoga/netatmo-outdoor-module.src/netatmo-outdoor-module.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * netatmo-outdoor 3 | * 4 | * Copyright 2014 Brian Steere 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 7 | * in compliance with the License. You may obtain a copy of the License at: 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 12 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing permissions and limitations under the License. 14 | * 15 | */ 16 | metadata { 17 | definition (name: "Netatmo Outdoor Module", namespace: "dianoga", author: "Brian Steere") { 18 | capability "Sensor" 19 | capability "Relative Humidity Measurement" 20 | capability "Temperature Measurement" 21 | } 22 | 23 | simulator { 24 | // TODO: define status and reply messages here 25 | } 26 | 27 | tiles { 28 | valueTile("temperature", "device.temperature", width: 2, height: 2) { 29 | state("temperature", label: '${currentValue}°', backgroundColors: [ 30 | [value: 31, color: "#153591"], 31 | [value: 44, color: "#1e9cbb"], 32 | [value: 59, color: "#90d2a7"], 33 | [value: 74, color: "#44b621"], 34 | [value: 84, color: "#f1d801"], 35 | [value: 95, color: "#d04e00"], 36 | [value: 96, color: "#bc2323"] 37 | ] 38 | ) 39 | } 40 | valueTile("humidity", "device.humidity", inactiveLabel: false) { 41 | state "humidity", label:'${currentValue}%', unit:"Humidity" 42 | } 43 | standardTile("refresh", "device.thermostatMode", inactiveLabel: false, decoration: "flat") { 44 | state "default", action:"device.poll", icon:"st.secondary.refresh" 45 | } 46 | main (["temperature", "humidity"]) 47 | details(["temperature", "humidity", "refresh"]) 48 | } 49 | } 50 | 51 | // parse events into attributes 52 | def parse(String description) { 53 | log.debug "Parsing '${description}'" 54 | // TODO: handle 'humidity' attribute 55 | // TODO: handle 'temperature' attribute 56 | // TODO: handle 'carbonDioxide' attribute 57 | // TODO: handle 'noise' attribute 58 | // TODO: handle 'pressure' attribute 59 | 60 | } 61 | 62 | def poll() { 63 | parent.poll() 64 | } 65 | 66 | -------------------------------------------------------------------------------- /devicetypes/wackford/quirky-wink-nimbus.src/quirky-wink-nimbus.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Quirky-Wink-Nimbus-Device.groovy 3 | * 4 | * Author: todd@wackford.net 5 | * Date: 2014-02-22 6 | * 7 | ***************************************************************** 8 | * Setup Namespace, acpabilities, attributes and commands 9 | ***************************************************************** 10 | * Namespace: "wackford" 11 | * 12 | * Capabilities: "polling" 13 | * "refresh" 14 | * 15 | * Custom Attributes: "dial" 16 | * "info" 17 | * 18 | * Custom Commands: "none" 19 | * 20 | ***************************************************************** 21 | * Changes 22 | ***************************************************************** 23 | * 24 | * Change 1: 2014-03-10 25 | * Documented Header 26 | * 27 | ***************************************************************** 28 | * Code 29 | ***************************************************************** 30 | */ 31 | // for the UI 32 | metadata { 33 | 34 | definition(name:"Quirky Wink Nimbus", namespace:"wackford", author:"Todd Wackford") { 35 | 36 | capability "Polling" 37 | capability "Refresh" 38 | capability "Sensor" 39 | 40 | attribute "dial", "string" 41 | attribute "info", "string" 42 | } 43 | 44 | tiles { 45 | standardTile("dial", "device.dial", width: 2, height: 2){ 46 | state("dial", label : '${currentValue}', unit : "", icon:"st.custom.quirky.quirky-device" ) 47 | } 48 | valueTile("info", "device.info", inactiveLabel: false, decoration: "flat") { 49 | state "info", label:'Dial is displaying ${currentValue}', unit:"" 50 | } 51 | standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat") { 52 | state "default", action:"refresh.refresh", icon:"st.secondary.refresh" 53 | } 54 | } 55 | main(["dial"]) 56 | details(["dial","info","refresh" ]) 57 | } 58 | 59 | // parse events into attributes 60 | def parse(description) { 61 | log.debug "parse() - $description" 62 | def results = [] 63 | 64 | if (description?.name && description?.value) 65 | { 66 | results << sendEvent(name: "${description?.name}", value: "${description?.value}") 67 | } 68 | } 69 | 70 | 71 | def poll() { 72 | log.debug "Nimbus executing 'pollNimbus'" 73 | parent.pollNimbus(this) 74 | } 75 | 76 | def refresh() { 77 | log.debug "Nimbus executing 'refresh'" 78 | parent.pollNimbus(this) 79 | } 80 | -------------------------------------------------------------------------------- /devicetypes/smartthings/smartsense-multi-sensor.src/README.md: -------------------------------------------------------------------------------- 1 | # Smartsense Multi Sensor 2 | 3 | 4 | 5 | Works with: 6 | 7 | * [Samsung SmartThings Multi Sensor](https://shop.smartthings.com/#!/products/smartsense-multi) 8 | 9 | ## Table of contents 10 | 11 | * [Capabilities](#capabilities) 12 | * [Health](#device-health) 13 | * [Battery](#battery-specification) 14 | 15 | ## Capabilities 16 | 17 | * **Three Axis** - monitors the state of a single axis 18 | * **Configuration** - _configure()_ command called when device is installed or device preferences updated 19 | * **Battery** - defines device uses a battery 20 | * **Sensor** - detects sensor events 21 | * **Contact Sensor** - can detect contact (possible values: open,closed) 22 | * **Acceleration Sensor** - allows for acceleration detection. 23 | * **Refresh** - _refresh()_ command for status updates 24 | * **Temperature Measurement** - defines device measures current temperature 25 | * **Health Check** - indicates ability to get device health notifications 26 | 27 | ## Device Health 28 | 29 | A Category C2 multi sensor with maxReportTime of 5 mins. 30 | Check-in interval is double the value of maxReportTime. 31 | This gives the device twice the amount of time to respond before it is marked as offline. 32 | Check-in interval = 12 mins 33 | 34 | ## Battery Specification 35 | 36 | One CR2450 (for Samsung SmartThings Multipurpose Sensor) battery / Two AAAA (for SmartSense Multi Sensor) batteries required. 37 | 38 | ## Troubleshooting 39 | 40 | If the sensor doesn't pair when trying from the SmartThings mobile app, it is possible that the sensor is out of range. 41 | Pairing needs to be tried again by placing the sensor closer to the hub. 42 | Other troubleshooting tips are listed as follows: 43 | * [Troubleshooting: Samsung SmartThings Multipurpose Sensor is stuck on "open" or "closed"](https://support.smartthings.com/hc/en-us/articles/200955940-Troubleshooting-Samsung-SmartThings-Multipurpose-Sensor-is-stuck-on-open-or-closed-) 44 | * [Troubleshooting: Temperature reading for the Samsung SmartThings Multipurpose Sensor is off](https://support.smartthings.com/hc/en-us/articles/200756845-Troubleshooting-Temperature-reading-for-the-Samsung-SmartThings-Multipurpose-Sensor-is-off) 45 | * [Troubleshooting: Samsung SmartThings Multipurpose Sensor won’t pair after removing pull-tab](https://support.smartthings.com/hc/en-us/articles/204966616-Troubleshooting-Samsung-SmartThings-device-won-t-pair-after-removing-pull-tab) -------------------------------------------------------------------------------- /devicetypes/smartthings/testing/simulated-switch.src/simulated-switch.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | 16 | definition (name: "Simulated Switch", namespace: "smartthings/testing", author: "bob") { 17 | capability "Switch" 18 | capability "Relay Switch" 19 | capability "Sensor" 20 | capability "Actuator" 21 | 22 | command "onPhysical" 23 | command "offPhysical" 24 | } 25 | 26 | tiles { 27 | standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true) { 28 | state "off", label: '${currentValue}', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff" 29 | state "on", label: '${currentValue}', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#79b821" 30 | } 31 | standardTile("on", "device.switch", decoration: "flat") { 32 | state "default", label: 'On', action: "onPhysical", backgroundColor: "#ffffff" 33 | } 34 | standardTile("off", "device.switch", decoration: "flat") { 35 | state "default", label: 'Off', action: "offPhysical", backgroundColor: "#ffffff" 36 | } 37 | main "switch" 38 | details(["switch","on","off"]) 39 | } 40 | } 41 | 42 | def parse(String description) { 43 | def pair = description.split(":") 44 | createEvent(name: pair[0].trim(), value: pair[1].trim()) 45 | } 46 | 47 | def on() { 48 | log.debug "$version on()" 49 | sendEvent(name: "switch", value: "on") 50 | } 51 | 52 | def off() { 53 | log.debug "$version off()" 54 | sendEvent(name: "switch", value: "off") 55 | } 56 | 57 | def onPhysical() { 58 | log.debug "$version onPhysical()" 59 | sendEvent(name: "switch", value: "on", type: "physical") 60 | } 61 | 62 | def offPhysical() { 63 | log.debug "$version offPhysical()" 64 | sendEvent(name: "switch", value: "off", type: "physical") 65 | } 66 | 67 | private getVersion() { 68 | "PUBLISHED" 69 | } 70 | -------------------------------------------------------------------------------- /smartapps/dianoga/thermostat-auto-off.src/thermostat-auto-off.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * HVAC Auto Off 3 | * 4 | * Author: dianoga7@3dgo.net 5 | * Date: 2013-07-21 6 | */ 7 | 8 | // Automatically generated. Make future change here. 9 | definition( 10 | name: "Thermostat Auto Off", 11 | namespace: "dianoga", 12 | author: "dianoga7@3dgo.net", 13 | description: "Automatically turn off thermostat when windows/doors open. Turn it back on when everything is closed up.", 14 | category: "Green Living", 15 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png", 16 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience%402x.png", 17 | oauth: true 18 | ) 19 | 20 | preferences { 21 | section("Control") { 22 | input("thermostat", "capability.thermostat", title: "Thermostat") 23 | } 24 | 25 | section("Open/Close") { 26 | input("sensors", "capability.contactSensor", title: "Sensors", multiple: true) 27 | input("delay", "number", title: "Delay (seconds)") 28 | } 29 | } 30 | 31 | def installed() { 32 | log.debug "Installed with settings: ${settings}" 33 | 34 | initialize() 35 | } 36 | 37 | def updated() { 38 | log.debug "Updated with settings: ${settings}" 39 | 40 | unsubscribe() 41 | unschedule() 42 | initialize() 43 | } 44 | 45 | def initialize() { 46 | state.changed = false 47 | subscribe(sensors, 'contact', "sensorChange") 48 | } 49 | 50 | def sensorChange(evt) { 51 | log.debug "Desc: $evt.value , $state" 52 | if(evt.value == 'open' && !state.changed) { 53 | unschedule() 54 | runIn(delay, 'turnOff') 55 | } else if(evt.value == 'closed' && state.changed) { 56 | // All closed? 57 | def isOpen = false 58 | for(sensor in sensors) { 59 | if(sensor.id != evt.deviceId && sensor.currentValue('contact') == 'open') { 60 | isOpen = true 61 | } 62 | } 63 | 64 | if(!isOpen) { 65 | unschedule() 66 | runIn(delay, 'restore') 67 | } 68 | } 69 | } 70 | 71 | def turnOff() { 72 | log.debug "Turning off thermostat due to contact open" 73 | state.thermostatMode = thermostat.currentValue("thermostatMode") 74 | thermostat.off() 75 | state.changed = true 76 | log.debug "State: $state" 77 | } 78 | 79 | def restore() { 80 | log.debug "Setting thermostat to $state.thermostatMode" 81 | thermostat.setThermostatMode(state.thermostatMode) 82 | state.changed = false 83 | } -------------------------------------------------------------------------------- /devicetypes/smartthings/testing/simulated-smoke-alarm.src/simulated-smoke-alarm.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | definition (name: "Simulated Smoke Alarm", namespace: "smartthings/testing", author: "SmartThings") { 16 | capability "Smoke Detector" 17 | capability "Sensor" 18 | 19 | command "smoke" 20 | command "test" 21 | command "clear" 22 | } 23 | 24 | simulator { 25 | 26 | } 27 | 28 | tiles { 29 | standardTile("main", "device.smoke", width: 2, height: 2) { 30 | state("clear", label:"Clear", icon:"st.alarm.smoke.clear", backgroundColor:"#ffffff", action:"smoke") 31 | state("detected", label:"Smoke!", icon:"st.alarm.smoke.smoke", backgroundColor:"#e86d13", action:"clear") 32 | state("tested", label:"Test", icon:"st.alarm.smoke.test", backgroundColor:"#e86d13", action:"clear") 33 | } 34 | standardTile("smoke", "device.smoke", inactiveLabel: false, decoration: "flat") { 35 | state "default", label:'Smoke', action:"smoke" 36 | } 37 | standardTile("test", "device.smoke", inactiveLabel: false, decoration: "flat") { 38 | state "default", label:'Test', action:"test" 39 | } 40 | standardTile("reset", "device.smoke", inactiveLabel: false, decoration: "flat") { 41 | state "default", label:'Clear', action:"clear" 42 | } 43 | main "main" 44 | details(["main", "smoke", "test", "clear"]) 45 | } 46 | } 47 | 48 | def parse(String description) { 49 | 50 | } 51 | 52 | def smoke() { 53 | log.debug "smoke()" 54 | sendEvent(name: "smoke", value: "detected", descriptionText: "$device.displayName smoke detected!") 55 | } 56 | 57 | def test() { 58 | log.debug "test()" 59 | sendEvent(name: "smoke", value: "tested", descriptionText: "$device.displayName tested") 60 | } 61 | 62 | def clear() { 63 | log.debug "clear()" 64 | sendEvent(name: "smoke", value: "clear", descriptionText: "$device.displayName clear") 65 | } 66 | -------------------------------------------------------------------------------- /smartapps/smartthings/smartweather-station-controller.src/smartweather-station-controller.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Weather Station Controller 3 | * 4 | * Copyright 2014 SmartThings 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 7 | * in compliance with the License. You may obtain a copy of the License at: 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 12 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing permissions and limitations under the License. 14 | * 15 | */ 16 | 17 | definition( 18 | name: "SmartWeather Station Controller", 19 | namespace: "smartthings", 20 | author: "SmartThings", 21 | description: "Updates SmartWeather Station Tile devices every hour.", 22 | category: "Convenience", 23 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/SafetyAndSecurity/App-MindYourHome.png", 24 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/SafetyAndSecurity/App-MindYourHome@2x.png" 25 | ) 26 | 27 | preferences { 28 | section { 29 | input "weatherDevices", "device.smartweatherStationTile" 30 | } 31 | } 32 | 33 | def installed() { 34 | log.debug "Installed with settings: ${settings}" 35 | 36 | initialize() 37 | } 38 | 39 | def updated() { 40 | log.debug "Updated with settings: ${settings}" 41 | 42 | unschedule() 43 | initialize() 44 | } 45 | 46 | def initialize() { 47 | scheduledEvent() 48 | } 49 | 50 | def scheduledEvent() { 51 | log.info "SmartWeather Station Controller / scheduledEvent terminated due to deprecation" // device handles this itself now -- Bob 52 | /* 53 | log.trace "scheduledEvent()" 54 | 55 | def delayTimeSecs = 60 * 60 // reschedule every 60 minutes 56 | def runAgainWindowMS = 58 * 60 * 1000 // can run at most every 58 minutes 57 | def timeSinceLastRunMS = state.lastRunTime ? now() - state.lastRunTime : null //how long since it last ran? 58 | 59 | if(!timeSinceLastRunMS || timeSinceLastRunMS > runAgainWindowMS){ 60 | runIn(delayTimeSecs, scheduledEvent, [overwrite: false]) 61 | state.lastRunTime = now() 62 | weatherDevices.refresh() 63 | } else { 64 | log.trace "Trying to run smartweather-station-controller too soon. Has only been ${timeSinceLastRunMS} ms but needs to be at least ${runAgainWindowMS} ms" 65 | } 66 | */ 67 | } 68 | -------------------------------------------------------------------------------- /smartapps/smartthings/flood-alert.src/flood-alert.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | * Flood Alert 14 | * 15 | * Author: SmartThings 16 | */ 17 | definition( 18 | name: "Flood Alert!", 19 | namespace: "smartthings", 20 | author: "SmartThings", 21 | description: "Get a push notification or text message when water is detected where it doesn't belong.", 22 | category: "Safety & Security", 23 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/water_moisture.png", 24 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/water_moisture@2x.png" 25 | ) 26 | 27 | preferences { 28 | section("When there's water detected...") { 29 | input "alarm", "capability.waterSensor", title: "Where?" 30 | } 31 | section("Send a notification to...") { 32 | input("recipients", "contact", title: "Recipients", description: "Send notifications to") { 33 | input "phone", "phone", title: "Phone number?", required: false 34 | } 35 | } 36 | } 37 | 38 | def installed() { 39 | subscribe(alarm, "water.wet", waterWetHandler) 40 | } 41 | 42 | def updated() { 43 | unsubscribe() 44 | subscribe(alarm, "water.wet", waterWetHandler) 45 | } 46 | 47 | def waterWetHandler(evt) { 48 | def deltaSeconds = 60 49 | 50 | def timeAgo = new Date(now() - (1000 * deltaSeconds)) 51 | def recentEvents = alarm.eventsSince(timeAgo) 52 | log.debug "Found ${recentEvents?.size() ?: 0} events in the last $deltaSeconds seconds" 53 | 54 | def alreadySentSms = recentEvents.count { it.value && it.value == "wet" } > 1 55 | 56 | if (alreadySentSms) { 57 | log.debug "SMS already sent within the last $deltaSeconds seconds" 58 | } else { 59 | def msg = "${alarm.displayName} is wet!" 60 | log.debug "$alarm is wet, texting phone number" 61 | 62 | if (location.contactBookEnabled) { 63 | sendNotificationToContacts(msg, recipients) 64 | } 65 | else { 66 | sendPush(msg) 67 | if (phone) { 68 | sendSms(phone, msg) 69 | } 70 | } 71 | } 72 | } 73 | 74 | -------------------------------------------------------------------------------- /devicetypes/smartthings/zwave-controller.src/zwave-controller.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | definition (name: "Z-Wave Controller", namespace: "smartthings", author: "SmartThings") { 16 | 17 | command "on" 18 | command "off" 19 | 20 | fingerprint deviceId: "0x02" 21 | } 22 | 23 | simulator { 24 | 25 | } 26 | 27 | tiles { 28 | standardTile("state", "device.state", width: 2, height: 2) { 29 | state 'connected', icon: "st.unknown.zwave.static-controller", backgroundColor:"#ffffff" 30 | } 31 | standardTile("basicOn", "device.switch", inactiveLabel:false, decoration:"flat") { 32 | state "on", label:"on", action:"on", icon:"st.switches.switch.on" 33 | } 34 | standardTile("basicOff", "device.switch", inactiveLabel: false, decoration:"flat") { 35 | state "off", label:"off", action:"off", icon:"st.switches.switch.off" 36 | } 37 | 38 | main "state" 39 | details(["state", "basicOn", "basicOff"]) 40 | } 41 | } 42 | 43 | def parse(String description) { 44 | def result = null 45 | if (description.startsWith("Err")) { 46 | result = createEvent(descriptionText:description, displayed:true) 47 | } else { 48 | def cmd = zwave.parse(description) 49 | if (cmd) { 50 | result = createEvent(zwaveEvent(cmd)) 51 | } 52 | } 53 | return result 54 | } 55 | 56 | def zwaveEvent(physicalgraph.zwave.commands.securityv1.SecurityMessageEncapsulation cmd) { 57 | def event = [isStateChange: true] 58 | event.linkText = device.label ?: device.name 59 | event.descriptionText = "$event.linkText: ${cmd.encapsulatedCommand()} [secure]" 60 | event 61 | } 62 | 63 | def zwaveEvent(physicalgraph.zwave.Command cmd) { 64 | def event = [isStateChange: true] 65 | event.linkText = device.label ?: device.name 66 | event.descriptionText = "$event.linkText: $cmd" 67 | event 68 | } 69 | 70 | def on() { 71 | zwave.basicV1.basicSet(value: 0xFF).format() 72 | } 73 | 74 | def off() { 75 | zwave.basicV1.basicSet(value: 0x00).format() 76 | } 77 | -------------------------------------------------------------------------------- /devicetypes/smartthings/ecobee-sensor.src/ecobee-sensor.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | * Ecobee Sensor 14 | * 15 | * Author: SmartThings 16 | */ 17 | metadata { 18 | definition (name: "Ecobee Sensor", namespace: "smartthings", author: "SmartThings") { 19 | capability "Sensor" 20 | capability "Temperature Measurement" 21 | capability "Motion Sensor" 22 | capability "Refresh" 23 | } 24 | 25 | tiles { 26 | valueTile("temperature", "device.temperature", width: 2, height: 2) { 27 | state("temperature", label:'${currentValue}°', unit:"F", 28 | backgroundColors:[ 29 | // Celsius 30 | [value: 0, color: "#153591"], 31 | [value: 7, color: "#1e9cbb"], 32 | [value: 15, color: "#90d2a7"], 33 | [value: 23, color: "#44b621"], 34 | [value: 28, color: "#f1d801"], 35 | [value: 35, color: "#d04e00"], 36 | [value: 37, color: "#bc2323"], 37 | // Fahrenheit 38 | [value: 40, color: "#153591"], 39 | [value: 44, color: "#1e9cbb"], 40 | [value: 59, color: "#90d2a7"], 41 | [value: 74, color: "#44b621"], 42 | [value: 84, color: "#f1d801"], 43 | [value: 95, color: "#d04e00"], 44 | [value: 96, color: "#bc2323"] 45 | ] 46 | ) 47 | } 48 | 49 | standardTile("motion", "device.motion") { 50 | state("inactive", label:'no motion', icon:"st.motion.motion.inactive", backgroundColor:"#ffffff") 51 | state("active", label:'motion', icon:"st.motion.motion.active", backgroundColor:"#53a7c0") 52 | } 53 | 54 | standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat") { 55 | state "default", action:"refresh.refresh", icon:"st.secondary.refresh" 56 | } 57 | 58 | main (["temperature","motion"]) 59 | details(["temperature","motion","refresh"]) 60 | } 61 | } 62 | 63 | def refresh() { 64 | log.debug "refresh called" 65 | poll() 66 | } 67 | 68 | void poll() { 69 | log.debug "Executing 'poll' using parent SmartApp" 70 | parent.pollChild() 71 | 72 | } 73 | -------------------------------------------------------------------------------- /smartapps/imbrianj/door-knocker.src/door-knocker.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Door Knocker 3 | * 4 | * Author: brian@bevey.org 5 | * Date: 9/10/13 6 | * 7 | * Let me know when someone knocks on the door, but ignore 8 | * when someone is opening the door. 9 | */ 10 | 11 | definition( 12 | name: "Door Knocker", 13 | namespace: "imbrianj", 14 | author: "brian@bevey.org", 15 | description: "Alert if door is knocked, but not opened.", 16 | category: "Convenience", 17 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png", 18 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience%402x.png" 19 | ) 20 | 21 | preferences { 22 | section("When Someone Knocks?") { 23 | input name: "knockSensor", type: "capability.accelerationSensor", title: "Where?" 24 | } 25 | 26 | section("But not when they open this door?") { 27 | input name: "openSensor", type: "capability.contactSensor", title: "Where?" 28 | } 29 | 30 | section("Knock Delay (defaults to 5s)?") { 31 | input name: "knockDelay", type: "number", title: "How Long?", required: false 32 | } 33 | 34 | section("Notifications") { 35 | input "sendPushMessage", "enum", title: "Send a push notification?", metadata: [values: ["Yes", "No"]], required: false 36 | input "phone", "phone", title: "Send a Text Message?", required: false 37 | } 38 | } 39 | 40 | def installed() { 41 | init() 42 | } 43 | 44 | def updated() { 45 | unsubscribe() 46 | init() 47 | } 48 | 49 | def init() { 50 | state.lastClosed = 0 51 | subscribe(knockSensor, "acceleration.active", handleEvent) 52 | subscribe(openSensor, "contact.closed", doorClosed) 53 | } 54 | 55 | def doorClosed(evt) { 56 | state.lastClosed = now() 57 | } 58 | 59 | def doorKnock() { 60 | if((openSensor.latestValue("contact") == "closed") && 61 | (now() - (60 * 1000) > state.lastClosed)) { 62 | log.debug("${knockSensor.label ?: knockSensor.name} detected a knock.") 63 | send("${knockSensor.label ?: knockSensor.name} detected a knock.") 64 | } 65 | 66 | else { 67 | log.debug("${knockSensor.label ?: knockSensor.name} knocked, but looks like it was just someone opening the door.") 68 | } 69 | } 70 | 71 | def handleEvent(evt) { 72 | def delay = knockDelay ?: 5 73 | runIn(delay, "doorKnock") 74 | } 75 | 76 | private send(msg) { 77 | if(sendPushMessage != "No") { 78 | log.debug("Sending push message") 79 | sendPush(msg) 80 | } 81 | 82 | if(phone) { 83 | log.debug("Sending text message") 84 | sendSms(phone, msg) 85 | } 86 | 87 | log.debug(msg) 88 | } 89 | -------------------------------------------------------------------------------- /devicetypes/smartthings/tile-ux/tile-basic-slider.src/tile-basic-slider.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2016 SmartThings, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | */ 14 | metadata { 15 | definition ( 16 | name: "sliderDeviceTile", 17 | namespace: "smartthings/tile-ux", 18 | author: "SmartThings") { 19 | 20 | capability "Switch Level" 21 | command "setRangedLevel", ["number"] 22 | } 23 | 24 | tiles(scale: 2) { 25 | controlTile("tinySlider", "device.level", "slider", height: 2, width: 2, inactiveLabel: false) { 26 | state "level", action:"switch level.setLevel" 27 | } 28 | 29 | controlTile("mediumSlider", "device.level", "slider", height: 2, width: 4, inactiveLabel: false) { 30 | state "level", action:"switch level.setLevel" 31 | } 32 | 33 | controlTile("largeSlider", "device.level", "slider", decoration: "flat", height: 2, width: 6, inactiveLabel: false) { 34 | state "level", action:"switch level.setLevel" 35 | } 36 | 37 | controlTile("rangeSlider", "device.rangedLevel", "slider", height: 2, width: 4, range: "(20..80)") { 38 | state "level", action:"setRangedLevel" 39 | } 40 | 41 | valueTile("rangeValue", "device.rangedLevel", height: 2, width: 2) { 42 | state "range", label:'${currentValue}', defaultState: true 43 | } 44 | 45 | controlTile("rangeSliderConstrained", "device.rangedLevel", "slider", height: 2, width: 4, range: "(40..60)") { 46 | state "level", action:"setRangedLevel" 47 | } 48 | 49 | main("rangeValue") 50 | details([ 51 | "tinySlider", "mediumSlider", 52 | "largeSlider", 53 | "rangeSlider", "rangeValue", 54 | "rangeSliderConstrained" 55 | ]) 56 | } 57 | } 58 | 59 | def installed() { 60 | sendEvent(name: "level", value: 63) 61 | sendEvent(name: "rangedLevel", value: 47) 62 | } 63 | 64 | def parse(String description) { 65 | } 66 | 67 | def setLevel(value) { 68 | log.debug "setting level to $value" 69 | sendEvent(name:"level", value:value) 70 | } 71 | 72 | def setRangedLevel(value) { 73 | log.debug "setting ranged level to $value" 74 | sendEvent(name:"rangedLevel", value:value) 75 | } 76 | -------------------------------------------------------------------------------- /devicetypes/smartthings/smartsense-motion-sensor.src/README.md: -------------------------------------------------------------------------------- 1 | # Smartsense Motion Sensor 2 | 3 | 4 | 5 | Works with: 6 | 7 | * [Samsung SmartThings Motion Sensor](https://shop.smartthings.com/#!/products/samsung-smartthings-motion-sensor) 8 | 9 | ## Table of contents 10 | 11 | * [Capabilities](#capabilities) 12 | * [Health](#device-health) 13 | * [Battery](#battery-specification) 14 | 15 | ## Capabilities 16 | 17 | * **Configuration** - _configure()_ command called when device is installed or device preferences updated 18 | * **Motion Sensor** - can detect motion 19 | * **Battery** - defines device uses a battery 20 | * **Refresh** - _refresh()_ command for status updates 21 | * **Health Check** - indicates ability to get device health notifications 22 | 23 | ## Device Health 24 | 25 | A Category C2 motion sensor with maxReportTime of 5 mins. 26 | Check-in interval is double the value of maxReportTime. 27 | This gives the device twice the amount of time to respond before it is marked as offline. 28 | Check-in interval = 12 mins 29 | 30 | ## Battery Specification 31 | 32 | One CR2477 (for Samsung SmartThings Motion Sensor) / CR123A (SmartSense Motion Sensor) 3V battery is required. 33 | 34 | ## Troubleshooting 35 | 36 | If the device doesn't pair when trying from the SmartThings mobile app, it is possible that the sensor is out of range. 37 | Pairing needs to be tried again by placing the sensor closer to the hub. 38 | Instructions related to pairing, resetting and removing the different motion sensors from SmartThings can be found in the following links 39 | for the different models: 40 | * [SmartSense Motion Sensor (original model) Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/200903280-SmartSense-Motion-Sensor-original-model-) 41 | * [SmartSense Motion Sensor (2014 model) Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/203077520-SmartSense-Motion-Sensor-2014-model-) 42 | * [Samsung SmartThings Motion Sensor (2015 model) Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/205957580-Samsung-SmartThings-Motion-Sensor-2015-model-) 43 | Other troubleshooting tips are listed as follows: 44 | * [Troubleshooting: Samsung SmartThings Motion Sensor is stuck showing "Motion Detected" or "No Motion"](https://support.smartthings.com/hc/en-us/articles/200961130-Troubleshooting-Samsung-SmartThings-Motion-Sensor-is-stuck-showing-Motion-Detected-or-No-Motion-) 45 | * [Troubleshooting: Samsung SmartThings Motion Sensor won’t pair after removing pull-tab](https://support.smartthings.com/hc/en-us/articles/204966616-Troubleshooting-Samsung-SmartThings-device-won-t-pair-after-removing-pull-tab) 46 | -------------------------------------------------------------------------------- /smartapps/kristopherkubicki/turn-off-with-motion.src/turn-off-with-motion.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Turn Off With Motion 3 | * 4 | * Copyright 2014 Kristopher Kubicki 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 7 | * in compliance with the License. You may obtain a copy of the License at: 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 12 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing permissions and limitations under the License. 14 | * 15 | */ 16 | definition( 17 | name: "Turn Off With Motion", 18 | namespace: "KristopherKubicki", 19 | author: "Kristopher Kubicki", 20 | description: "Turns off a device if there is motion", 21 | category: "My Apps", 22 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png", 23 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png") 24 | 25 | 26 | 27 | preferences { 28 | section("Turn off when there's movement..."){ 29 | input "motion1", "capability.motionSensor", title: "Where?", multiple: true 30 | } 31 | section("And on when there's been no movement for..."){ 32 | input "minutes1", "number", title: "Minutes?" 33 | } 34 | section("Turn off/on light(s)..."){ 35 | input "switches", "capability.switch", multiple: true 36 | } 37 | } 38 | 39 | 40 | def installed() 41 | { 42 | subscribe(motion1, "motion", motionHandler) 43 | schedule("0 * * * * ?", "scheduleCheck") 44 | } 45 | 46 | def updated() 47 | { 48 | unsubscribe() 49 | subscribe(motion1, "motion", motionHandler) 50 | unschedule() 51 | schedule("0 * * * * ?", "scheduleCheck") 52 | } 53 | 54 | def motionHandler(evt) { 55 | log.debug "$evt.name: $evt.value" 56 | 57 | if (evt.value == "active") { 58 | log.debug "turning on lights" 59 | switches.off() 60 | state.inactiveAt = null 61 | } else if (evt.value == "inactive") { 62 | if (!state.inactiveAt) { 63 | state.inactiveAt = now() 64 | } 65 | } 66 | } 67 | 68 | def scheduleCheck() { 69 | log.debug "schedule check, ts = ${state.inactiveAt}" 70 | if (state.inactiveAt) { 71 | def elapsed = now() - state.inactiveAt 72 | def threshold = 1000 * 60 * minutes1 73 | if (elapsed >= threshold) { 74 | log.debug "turning off lights" 75 | switches.on() 76 | state.inactiveAt = null 77 | } 78 | else { 79 | log.debug "${elapsed / 1000} sec since motion stopped" 80 | } 81 | } 82 | } -------------------------------------------------------------------------------- /smartapps/smartthings/the-gun-case-moved.src/the-gun-case-moved.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | * The Gun Case Moved 14 | * 15 | * Author: SmartThings 16 | */ 17 | definition( 18 | name: "The Gun Case Moved", 19 | namespace: "smartthings", 20 | author: "SmartThings", 21 | description: "Send a text when your gun case moves", 22 | category: "Safety & Security", 23 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/text_accelerometer.png", 24 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/text_accelerometer@2x.png" 25 | ) 26 | 27 | preferences { 28 | section("When the gun case moves..."){ 29 | input "accelerationSensor", "capability.accelerationSensor", title: "Where?" 30 | } 31 | section("Text me at..."){ 32 | input("recipients", "contact", title: "Send notifications to") { 33 | input "phone1", "phone", title: "Phone number?" 34 | } 35 | } 36 | } 37 | 38 | def installed() { 39 | subscribe(accelerationSensor, "acceleration.active", accelerationActiveHandler) 40 | } 41 | 42 | def updated() { 43 | unsubscribe() 44 | subscribe(accelerationSensor, "acceleration.active", accelerationActiveHandler) 45 | } 46 | 47 | def accelerationActiveHandler(evt) { 48 | // Don't send a continuous stream of text messages 49 | def deltaSeconds = 5 50 | def timeAgo = new Date(now() - (1000 * deltaSeconds)) 51 | def recentEvents = accelerationSensor.eventsSince(timeAgo) 52 | log.trace "Found ${recentEvents?.size() ?: 0} events in the last $deltaSeconds seconds" 53 | def alreadySentSms = recentEvents.count { it.value && it.value == "active" } > 1 54 | 55 | if (alreadySentSms) { 56 | log.debug "SMS already sent to phone within the last $deltaSeconds seconds" 57 | } else { 58 | if (location.contactBookEnabled) { 59 | sendNotificationToContacts("Gun case has moved!", recipients) 60 | } 61 | else { 62 | log.debug "$accelerationSensor has moved, texting phone" 63 | sendSms(phone1, "Gun case has moved!") 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /smartapps/smartthings/camera-power-scheduler.src/camera-power-scheduler.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 SmartThings 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at: 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 10 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing permissions and limitations under the License. 12 | * 13 | * Schedule the Camera Power 14 | * 15 | * Author: danny@smartthings.com 16 | * Date: 2013-10-07 17 | */ 18 | 19 | definition( 20 | name: "Camera Power Scheduler", 21 | namespace: "smartthings", 22 | author: "SmartThings", 23 | description: "Turn the power on and off at a specific time. ", 24 | category: "Available Beta Apps", 25 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Partner/dropcam-on-off-schedule.png", 26 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Partner/dropcam-on-off-schedule@2x.png" 27 | ) 28 | 29 | preferences { 30 | section("Camera power..."){ 31 | input "switch1", "capability.switch", multiple: true 32 | } 33 | section("Turn the Camera On at..."){ 34 | input "startTime", "time", title: "Start Time", required:false 35 | } 36 | section("Turn the Camera Off at..."){ 37 | input "endTime", "time", title: "End Time", required:false 38 | } 39 | } 40 | 41 | def installed() 42 | { 43 | initialize() 44 | } 45 | 46 | def updated() 47 | { 48 | unschedule() 49 | initialize() 50 | } 51 | 52 | def initialize() { 53 | /* 54 | def tz = location.timeZone 55 | 56 | //if it's after the startTime but before the end time, turn it on 57 | if(startTime && timeToday(startTime,tz).time > timeToday(now,tz).time){ 58 | 59 | if(endTime && timeToday(endTime,tz).time < timeToday(now,tz).time){ 60 | switch1.on() 61 | } 62 | else{ 63 | switch1.off() 64 | } 65 | } 66 | else if(endTime && timeToday(endtime,tz).time > timeToday(now,tz).time) 67 | { 68 | switch1.off() 69 | } 70 | */ 71 | 72 | if(startTime) 73 | runDaily(startTime, turnOnCamera) 74 | if(endTime) 75 | runDaily(endTime,turnOffCamera) 76 | } 77 | 78 | def turnOnCamera() 79 | { 80 | log.info "turned on camera" 81 | switch1.on() 82 | } 83 | 84 | def turnOffCamera() 85 | { 86 | log.info "turned off camera" 87 | switch1.off() 88 | } 89 | -------------------------------------------------------------------------------- /smartapps/johnrucker/door-jammed-notification.src/door-jammed-notification.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Door Jammed Notification 3 | * 4 | * Copyright 2015 John Rucker 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 7 | * in compliance with the License. You may obtain a copy of the License at: 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 12 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing permissions and limitations under the License. 14 | * 15 | */ 16 | 17 | definition( 18 | name: "Door Jammed Notification", 19 | namespace: "JohnRucker", 20 | author: "John.Rucker@Solar-current.com", 21 | description: "Sends a SmartThings notification and text messages when your CoopBoss detects a door jam.", 22 | category: "My Apps", 23 | iconUrl: "http://coopboss.com/images/SmartThingsIcons/coopbossLogo.png", 24 | iconX2Url: "http://coopboss.com/images/SmartThingsIcons/coopbossLogo2x.png", 25 | iconX3Url: "http://coopboss.com/images/SmartThingsIcons/coopbossLogo3x.png") 26 | 27 | preferences { 28 | section("When the door state changes") { 29 | paragraph "Send a SmartThings notification when the coop's door jammed and did not close." 30 | input "doorSensor", "capability.doorControl", title: "Select CoopBoss", required: true, multiple: false 31 | input("recipients", "contact", title: "Recipients", description: "Send notifications to") { 32 | input "phone", "phone", title: "Phone number?", required: true} 33 | } 34 | } 35 | 36 | def installed() { 37 | log.debug "Installed with settings: ${settings}" 38 | initialize() 39 | } 40 | 41 | def updated() { 42 | log.debug "Updated with settings: ${settings}" 43 | unsubscribe() 44 | initialize() 45 | } 46 | 47 | def initialize() { 48 | subscribe(doorSensor, "doorState", coopDoorStateHandler) 49 | } 50 | 51 | def coopDoorStateHandler(evt) { 52 | if (evt.value == "jammed"){ 53 | def msg = "WARNING ${doorSensor.displayName} door is jammed and did not close!" 54 | log.debug "WARNING ${doorSensor.displayName} door is jammed and did not close, texting $phone" 55 | 56 | if (location.contactBookEnabled) { 57 | sendNotificationToContacts(msg, recipients) 58 | } 59 | else { 60 | sendPush(msg) 61 | if (phone) { 62 | sendSms(phone, msg) 63 | } 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /devicetypes/wackford/quirky-wink-powerstrip.src/quirky-wink-powerstrip.groovy: -------------------------------------------------------------------------------- 1 | /* Quirky-Wink-Powerstrip-Device.groovy 2 | * 3 | * Author: todd@wackford.net 4 | * Date: 2014-01-28 5 | * 6 | ***************************************************************** 7 | * Setup Namespace, acpabilities, attributes and commands 8 | ***************************************************************** 9 | * Namespace: "wackford" 10 | * 11 | * Capabilities: "switch" 12 | * "polling" 13 | * "refresh" 14 | * 15 | * Custom Attributes: "none" 16 | * 17 | * Custom Commands: "none" 18 | * 19 | ***************************************************************** 20 | * Changes 21 | ***************************************************************** 22 | * 23 | * Change 1: 2014-03-10 24 | * Documented Header 25 | * 26 | ***************************************************************** 27 | * Code 28 | ***************************************************************** 29 | */ 30 | // for the UI 31 | metadata { 32 | 33 | definition(name:"Quirky Wink Powerstrip", namespace:"wackford", author:"Todd Wackford") { 34 | 35 | capability "Switch" 36 | capability "Polling" 37 | capability "Refresh" 38 | capability "Sensor" 39 | capability "Actuator" 40 | } 41 | 42 | simulator { 43 | // TODO: define status and reply messages here 44 | } 45 | 46 | tiles { 47 | standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true) { 48 | state "off", label: '${name}', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff" 49 | state "on", label: '${name}', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#79b821" 50 | } 51 | standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat") { 52 | state "default", action:"refresh.refresh", icon:"st.secondary.refresh" 53 | } 54 | } 55 | main(["switch"]) 56 | details(["switch", "refresh" ]) 57 | } 58 | 59 | 60 | // parse events into attributes 61 | def parse(description) { 62 | log.debug "parse() - $description" 63 | def results = [] 64 | 65 | if (description?.name && description?.value) 66 | { 67 | results << sendEvent(name: "${description?.name}", value: "${description?.value}") 68 | } 69 | } 70 | 71 | 72 | // handle commands 73 | def on() { 74 | log.debug "Executing 'on'" 75 | log.debug this 76 | parent.on(this) 77 | } 78 | 79 | def off() { 80 | log.debug "Executing 'off'" 81 | parent.off(this) 82 | } 83 | 84 | def poll() { 85 | log.debug "Executing 'poll'" 86 | parent.pollOutlet(this) 87 | } 88 | 89 | def refresh() { 90 | log.debug "Executing 'refresh'" 91 | poll() 92 | } 93 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | --------------------------------------------------------------------------------