├── LICENSE.md └── LICENSE.md ├── README.md └── devicetypes └── rboy ├── rboy-apps-virtual-blink-camera-motion-sensor.src └── rboy-apps-virtual-blink-camera-motion-sensor.groovy └── rboy-apps-virtual-blink-sync-module-switch.src └── rboy-apps-virtual-blink-sync-module-switch.groovy /LICENSE.md/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright RBoy Apps. You can find the license terms on www.rboyapps.com 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | SmartThings Blink Camera IFTTT Integration 2 | 3 | https://community.smartthings.com/t/release-blink-camera-ifttt-integration/192789 4 | 5 | 6 | ## Where To Buy Blink Cameras and Sync Modules 7 | - [Camera (add on)](https://amzn.to/3MF3enY) 8 | - [Sync module 2 (add on)](https://amzn.to/3Qc2xFz) 9 | - [2 Camera + Sync module kit](https://amzn.to/3xnRssq) 10 | - [Mini 2 Camera kit](https://amzn.to/3zvqstB) 11 | - [Outdoor 6 Camera + Sync module kit](https://amzn.to/3mDW3le) 12 | 13 | 14 | ## Key Features: 15 | - Arm/disarm sync modules from SmartThings (via Virtual Sync Module switch) 16 | - Get camera motion detection notifications in SmartThings (via Virtual Camera Motion sensor) 17 | - Adjustable setting for motion sensor reset time (default 15 seconds) 18 | 19 | -------------------------------------------------------------------------------- /devicetypes/rboy/rboy-apps-virtual-blink-camera-motion-sensor.src/rboy-apps-virtual-blink-camera-motion-sensor.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * ----------------------- 3 | * --- DEVICE HANDLER ---- 4 | * ----------------------- 5 | * 6 | */ 7 | 8 | /* **DISCLAIMER** 9 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 10 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | * Without limitation of the foregoing, Contributors/Regents expressly does not warrant that: 12 | * 1. the software will meet your requirements or expectations; 13 | * 2. the software or the software content will be free of bugs, errors, viruses or other defects; 14 | * 3. any results, output, or data provided through or generated by the software will be accurate, up-to-date, complete or reliable; 15 | * 4. the software will be compatible with third party software; 16 | * 5. any errors in the software will be corrected. 17 | * The user assumes all responsibility for selecting the software and for the results obtained from the use of the software. The user shall bear the entire risk as to the quality and the performance of the software. 18 | */ 19 | 20 | /** 21 | * Virtual Blink Camera Motion Sensor 22 | * 23 | * Copyright RBoy Apps 24 | * Change log: 25 | * 2020-12-05 - (v01.01.01) Only display motion sensor, not switch events 26 | * 2020-05-05 - (v01.01.00) Updated to reset on initialize and reset motion after X seconds 27 | * 2018-08-05 - (v01.00.00) Initial public release 28 | * 29 | */ 30 | 31 | import groovy.transform.Field 32 | @Field final Integer RESET_TIME = 15 // Reset time in seconds 33 | 34 | preferences { 35 | input "resetTime", "number", title: "Time after which to reset the motion", required: false, displayDuringSetup: false, range: "1..120" 36 | } 37 | 38 | metadata { 39 | definition (name: "RBoy Apps Virtual Blink Camera Motion Sensor", namespace: "rboy", author: "RBoy Apps", ocfDeviceType: "x.com.st.d.sensor.motion", mnmn: "SmartThings", vid:"generic-motion") { 40 | capability "Sensor" 41 | capability "Motion Sensor" 42 | capability "Switch" // For IFTTT 43 | capability "Health Check" 44 | } 45 | 46 | tiles(scale: 2) { 47 | multiAttributeTile(name:"summary", type: "generic", width: 6, height: 4, canChangeIcon: true) { 48 | tileAttribute ("device.motion", key: "PRIMARY_CONTROL") { 49 | attributeState "inactive", label:'no motion', icon:"st.motion.motion.inactive", backgroundColor:"#ffffff" 50 | attributeState "active", label:'motion', icon:"st.motion.motion.active", backgroundColor:"#00a0dc" 51 | } 52 | } 53 | standardTile("motion", "device.motion", width: 2, height: 2, inactiveLabel: false) { 54 | state "inactive", label:'no motion', icon:"st.motion.motion.inactive", backgroundColor:"#ffffff" 55 | state "active", label:'motion', icon:"st.motion.motion.active", backgroundColor:"#00a0dc" 56 | } 57 | 58 | main "summary" 59 | details(["summary"]) 60 | } 61 | } 62 | 63 | def installed() { 64 | // Device-Watch simply pings if no device events received for checkInterval duration of 32min = 2 * 15min + 2min lag time 65 | sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "lan", hubHardwareId: device.hub?.hardwareID, offlinePingable: "1"]) 66 | off() // Reset it 67 | } 68 | 69 | def updated() { 70 | // Device-Watch simply pings if no device events received for checkInterval duration of 32min = 2 * 15min + 2min lag time 71 | sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "lan", hubHardwareId: device.hub?.hardwareID, offlinePingable: "1"]) 72 | off() // Reset it 73 | } 74 | 75 | def ping() { 76 | sendEvent(name: "motion", value: device.currentValue("motion")) 77 | } 78 | 79 | def on() { 80 | log.trace "Switch on, triggered motion and resetting in ${resetTime ?: RESET_TIME} seconds" 81 | sendEvent(name: "switch", value: "on", displayed: false) 82 | sendEvent(name: "motion", value: "active") 83 | runIn(resetTime ?: RESET_TIME, off) // IFTTT doesn't turn it off, automatically set it to off after X seconds 84 | } 85 | 86 | def off() { 87 | log.trace "Switch off, resetting motion" 88 | sendEvent(name: "switch", value: "off", displayed: false) 89 | sendEvent(name: "motion", value: "inactive") 90 | } 91 | 92 | // THIS IS THE END OF THE FILE 93 | -------------------------------------------------------------------------------- /devicetypes/rboy/rboy-apps-virtual-blink-sync-module-switch.src/rboy-apps-virtual-blink-sync-module-switch.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * ----------------------- 3 | * --- DEVICE HANDLER ---- 4 | * ----------------------- 5 | * 6 | */ 7 | 8 | /* **DISCLAIMER** 9 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 10 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | * Without limitation of the foregoing, Contributors/Regents expressly does not warrant that: 12 | * 1. the software will meet your requirements or expectations; 13 | * 2. the software or the software content will be free of bugs, errors, viruses or other defects; 14 | * 3. any results, output, or data provided through or generated by the software will be accurate, up-to-date, complete or reliable; 15 | * 4. the software will be compatible with third party software; 16 | * 5. any errors in the software will be corrected. 17 | * The user assumes all responsibility for selecting the software and for the results obtained from the use of the software. The user shall bear the entire risk as to the quality and the performance of the software. 18 | */ 19 | 20 | /** 21 | * Virtual Blink Sync Module Switch 22 | * 23 | * Copyright RBoy Apps 24 | * Change log: 25 | * 2020-05-05 - (v01.01.00) Updated to reset on initialize 26 | * 2018-08-05 - (v01.00.00) Initial public release 27 | * 28 | */ 29 | 30 | 31 | metadata { 32 | definition (name: "RBoy Apps Virtual Blink Sync Module Switch", namespace: "rboy", author: "RBoy Apps", ocfDeviceType: "oic.d.switch", mnmn: "SmartThings", vid:"generic-switch") { 33 | capability "Actuator" 34 | capability "Switch" 35 | capability "Relay Switch" 36 | capability "Health Check" 37 | } 38 | 39 | tiles(scale: 2) { 40 | multiAttributeTile(name:"summary", type: "generic", width: 6, height: 4, canChangeIcon: true) { 41 | tileAttribute ("device.switch", key: "PRIMARY_CONTROL") { 42 | attributeState "off", label:'Disarmed', action: "switch.on", icon: "https://www.rboyapps.com/images/SystemOff.png", backgroundColor:"#ffffff" 43 | attributeState "on", label:'Armed', action: "switch.off", icon: "https://www.rboyapps.com/images/SystemOn.png", backgroundColor:"#00a0dc" 44 | } 45 | } 46 | standardTile("switch", "device.switch", width: 4, height: 2, canChangeIcon: true, decoration: "flat") { 47 | state "off", label: "Disarmed", action: "switch.on", icon: "https://www.rboyapps.com/images/SystemOff.png", backgroundColor: "#ffffff" 48 | state "on", label: "Armed", action: "switch.off", icon: "https://www.rboyapps.com/images/SystemOn.png", backgroundColor: "#00a0dc" 49 | } 50 | 51 | main "summary" 52 | details(["summary"]) 53 | } 54 | } 55 | 56 | def installed() { 57 | // Device-Watch simply pings if no device events received for checkInterval duration of 32min = 2 * 15min + 2min lag time 58 | sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "lan", hubHardwareId: device.hub?.hardwareID, offlinePingable: "1"]) 59 | off() // Reset it 60 | } 61 | 62 | def updated() { 63 | // Device-Watch simply pings if no device events received for checkInterval duration of 32min = 2 * 15min + 2min lag time 64 | sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "lan", hubHardwareId: device.hub?.hardwareID, offlinePingable: "1"]) 65 | } 66 | 67 | def ping() { 68 | sendEvent(name: "switch", value: device.currentValue("switch")) 69 | } 70 | 71 | def on() { 72 | def msg = "${device.displayName} sync module is being armed" 73 | log.info msg 74 | sendEvent(name: "switch", value: "on", descriptionText: msg) 75 | } 76 | 77 | def off() { 78 | def msg = "${device.displayName} sync module is being disarmed" 79 | log.info msg 80 | sendEvent(name: "switch", value: "off", descriptionText: msg) 81 | } 82 | 83 | // THIS IS THE END OF THE FILE 84 | --------------------------------------------------------------------------------