├── README.md ├── devicetypes ├── capabilities │ ├── acceleration-sensor-capability.src │ │ └── acceleration-sensor-capability.groovy │ ├── alarm-capability.src │ │ └── alarm-capability.groovy │ ├── button-capability.src │ │ └── button-capability.groovy │ ├── contact-sensor-capability.src │ │ └── contact-sensor-capability.groovy │ ├── illuminance-measurement-capability.src │ │ └── illuminance-measurement-capability.groovy │ ├── lock-capability.src │ │ └── lock-capability.groovy │ ├── momentary-capability.src │ │ └── momentary-capability.groovy │ ├── motion-sensor-capability.src │ │ └── motion-sensor-capability.groovy │ ├── presence-sensor-capability.src │ │ └── presence-sensor-capability.groovy │ ├── relative-humidity-measurement-capability.src │ │ └── relative-humidity-measurement-capability.groovy │ ├── switch-capability.src │ │ └── switch-capability.groovy │ ├── switch-level-capability.src │ │ └── switch-level-capability.groovy │ ├── temperature-measurement-capability.src │ │ └── temperature-measurement-capability.groovy │ ├── thermostat-capability.src │ │ └── thermostat-capability.groovy │ ├── three-axis-capability.src │ │ └── three-axis-capability.groovy │ └── water-sensor-capability.src │ │ └── water-sensor-capability.groovy ├── com-obycode │ └── obything-music.src │ │ └── obything-music.groovy ├── dianoga │ ├── netatmo-additional-module.src │ │ └── netatmo-additional-module.groovy │ ├── netatmo-basestation.src │ │ └── netatmo-basestation.groovy │ ├── netatmo-outdoor-module.src │ │ └── netatmo-outdoor-module.groovy │ └── netatmo-rain.src │ │ └── netatmo-rain.groovy ├── erocm123 │ ├── aeon-dsc17103-micro-double-switch.src │ │ └── aeon-dsc17103-micro-double-switch.groovy │ ├── aeon-multisensor-6-advanced.src │ │ ├── 9 Multisensor 6 V1.07 - ES.pdf │ │ └── aeon-multisensor-6-advanced.groovy │ ├── aeon-multisensor.src │ │ └── aeon-multisensor.groovy │ ├── aeon-rgbw-bulb-advanced.src │ │ └── aeon-rgbw-bulb-advanced.groovy │ ├── aeon-smartstrip-6-switch.src │ │ └── aeon-smartstrip-6-switch.groovy │ ├── aeon-smartstrip.src │ │ └── aeon-smartstrip.groovy │ ├── aeon-wallmote.src │ │ └── aeon-wallmote.groovy │ ├── alarm-com-smart-thermostat.src │ │ └── alarm-com-smart-thermostat.groovy │ ├── carbon-dioxide-detector-child-device.src │ │ └── carbon-dioxide-detector-child-device.groovy │ ├── carbon-monoxide-detector-child-device.src │ │ └── carbon-monoxide-detector-child-device.groovy │ ├── contact-sensor-child-device.src │ │ └── contact-sensor-child-device.groovy │ ├── ecolink-firefighter.src │ │ └── ecolink-firefighter.groovy │ ├── enerwave-8-button-scene-controller-zwn-sc8.src │ │ └── enerwave-8-button-scene-controller-zwn-sc8.groovy │ ├── enerwave-ceiling-mounted-motion-sensor.src │ │ └── enerwave-ceiling-mounted-motion-sensor.groovy │ ├── enerwave-metering-switch-zw15rm-plus.src │ │ └── enerwave-metering-switch-zw15rm-plus.groovy │ ├── enerwave-rsm1-plus.src │ │ └── enerwave-rsm1-plus.groovy │ ├── enerwave-rsm2-dual-relay-switch.src │ │ └── enerwave-rsm2-dual-relay-switch.groovy │ ├── enerwave-rsm2-plus-v5-11.src │ │ └── enerwave-rsm2-plus-v5-11.groovy │ ├── enerwave-rsm2-plus.src │ │ └── enerwave-rsm2-plus.groovy │ ├── enerwave-zigbee-dimmer-255.src │ │ └── enerwave-zigbee-dimmer-255.groovy │ ├── enerwave-zigbee-outlet-switch-zb15r-zb333-zb15s.src │ │ └── enerwave-zigbee-outlet-switch-zb15r-zb333-zb15s.groovy │ ├── enerwave-zw15sm-metering-switch.src │ │ └── enerwave-zw15sm-metering-switch.groovy │ ├── ezmultipli.src │ │ └── ezmultipli.groovy │ ├── fibaro-dimmer-2.src │ │ └── fibaro-dimmer-2.groovy │ ├── fibaro-double-switch-2-fgs-223.src │ │ └── fibaro-double-switch-2-fgs-223.groovy │ ├── fibaro-flood-sensor-advanced.src │ │ └── fibaro-flood-sensor-advanced.groovy │ ├── fibaro-rgbw-controller-advanced.src │ │ └── fibaro-rgbw-controller-advanced.groovy │ ├── fibaro-single-switch-2-fgs-213.src │ │ └── fibaro-single-switch-2-fgs-213.groovy │ ├── fosbaby-lullaby-control.src │ │ └── fosbaby-lullaby-control.groovy │ ├── generic-dual-relay.src │ │ └── generic-dual-relay.groovy │ ├── generic-zwave-association-handler.src │ │ └── generic-zwave-association-handler.groovy │ ├── homeseer-hs-wd100-dimmer-switch.src │ │ └── homeseer-hs-wd100-dimmer-switch.groovy │ ├── inovelli-1-channel-outdoor-smart-plug-nzw96.src │ │ └── inovelli-1-channel-outdoor-smart-plug-nzw96.groovy │ ├── inovelli-1-channel-smart-plug-nzw36-w-scene.src │ │ └── inovelli-1-channel-smart-plug-nzw36-w-scene.groovy │ ├── inovelli-2-channel-outdoor-smart-plug-nzw97.src │ │ └── inovelli-2-channel-outdoor-smart-plug-nzw97.groovy │ ├── inovelli-2-channel-smart-plug-alternate.src │ │ └── inovelli-2-channel-smart-plug-alternate.groovy │ ├── inovelli-2-channel-smart-plug-nzw37-w-scene.src │ │ └── inovelli-2-channel-smart-plug-nzw37-w-scene.groovy │ ├── inovelli-2-channel-smart-plug.src │ │ └── inovelli-2-channel-smart-plug.groovy │ ├── inovelli-dimmer-nzw31-w-scene.src │ │ └── inovelli-dimmer-nzw31-w-scene.groovy │ ├── inovelli-dimmer-nzw31.src │ │ └── inovelli-dimmer-nzw31.groovy │ ├── inovelli-dimmer-smart-plug-nzw39-w-scene.src │ │ └── inovelli-dimmer-smart-plug-nzw39-w-scene.groovy │ ├── inovelli-dimmer-smart-plug-nzw39.src │ │ └── inovelli-dimmer-smart-plug-nzw39.groovy │ ├── inovelli-door-window-sensor-nzw1201.src │ │ └── inovelli-door-window-sensor-nzw1201.groovy │ ├── inovelli-door-window-sensor.src │ │ └── inovelli-door-window-sensor.groovy │ ├── inovelli-switch-nzw30-w-scene.src │ │ └── inovelli-switch-nzw30-w-scene.groovy │ ├── inovelli-switch-nzw30.src │ │ └── inovelli-switch-nzw30.groovy │ ├── latest_commit.txt │ ├── lock-child-device.src │ │ └── lock-child-device.groovy │ ├── lockable-door-window-child-device.src │ │ └── lockable-door-window-child-device.groovy │ ├── metering-switch-child-device.src │ │ └── metering-switch-child-device.groovy │ ├── mipow-playbulb.src │ │ ├── find_handle.sh │ │ ├── mipow-playbulb.groovy │ │ ├── playbulb.php │ │ └── playbulb.sh │ ├── motion-sensor-child-device.src │ │ └── motion-sensor-child-device.groovy │ ├── philio-pan04-dual-relay.src │ │ └── philio-pan04-dual-relay.groovy │ ├── qubino-flush-1-relay.src │ │ └── qubino-flush-1-relay.groovy │ ├── qubino-flush-1d-relay.src │ │ ├── configure.png │ │ ├── configure@2x.png │ │ └── qubino-flush-1d-relay.groovy │ ├── qubino-flush-2-relays.src │ │ └── qubino-flush-2-relays.groovy │ ├── qubino-flush-dimmer.src │ │ └── qubino-flush-dimmer.groovy │ ├── remotec-zrc-90-scene-master.src │ │ └── remotec-zrc-90-scene-master.groovy │ ├── simulated-dimmer.src │ │ └── simulated-dimmer.groovy │ ├── simulated-energy-switch.src │ │ └── simulated-energy-switch.groovy │ ├── simulated-switch.src │ │ └── simulated-switch.groovy │ ├── smartlife-rgbw-controller.src │ │ ├── SmartLifeRGBW.ino │ │ ├── SmartLifeRGBWController.ino.generic.bin │ │ └── smartlife-rgbw-controller.groovy │ ├── smartlife-rgbw-virtual-switch.src │ │ └── smartlife-rgbw-virtual-switch.groovy │ ├── smoke-detector-child-device.src │ │ └── smoke-detector-child-device.groovy │ ├── sonoff-4ch-tasmota.src │ │ └── sonoff-4ch-tasmota.groovy │ ├── sonoff-4ch-wifi-switch.src │ │ ├── Sonoff4CH.ino.generic.bin │ │ └── sonoff-4ch-wifi-switch.groovy │ ├── sonoff-bridge-tasmota.src │ │ └── sonoff-bridge-tasmota.groovy │ ├── sonoff-dimmer-tasmota.src │ │ └── sonoff-dimmer-tasmota.groovy │ ├── sonoff-dual-wifi-switch.src │ │ ├── SonoffDual.ino.generic.bin │ │ └── sonoff-dual-wifi-switch.groovy │ ├── sonoff-ifan02-wifi-controller.src │ │ ├── SonoffIFan02.ino.generic.bin │ │ └── sonoff-ifan02-wifi-controller.groovy │ ├── sonoff-pow-wifi-switch.src │ │ ├── SonoffPOW.ino.generic.bin │ │ └── sonoff-pow-wifi-switch.groovy │ ├── sonoff-s20-tasmota.src │ │ └── sonoff-s20-tasmota.groovy │ ├── sonoff-s31-tasmota.src │ │ └── sonoff-s31-tasmota.groovy │ ├── sonoff-sc-tasmota.src │ │ └── sonoff-sc-tasmota.groovy │ ├── sonoff-th-tasmota.src │ │ └── sonoff-th-tasmota.groovy │ ├── sonoff-th-wifi-switch.src │ │ ├── SonoffTH.ino.generic.bin │ │ └── sonoff-th-wifi-switch.groovy │ ├── sonoff-wifi-switch.src │ │ ├── ESPEasy_R120.zip │ │ ├── Sonoff.ino │ │ ├── Sonoff.ino.generic.bin │ │ ├── SonoffS20.ino.generic.bin │ │ ├── SonoffShelly.ino.generic.bin │ │ ├── SonoffTouch.ino.generic.bin │ │ ├── firmware_flash.zip │ │ └── sonoff-wifi-switch.groovy │ ├── switch-child-device.src │ │ └── switch-child-device.groovy │ ├── switch-level-child-device.src │ │ └── switch-level-child-device.groovy │ ├── verilock-translator.src │ │ └── verilock-translator.groovy │ ├── water-sensor-child-device.src │ │ └── water-sensor-child-device.groovy │ ├── xiaomi-door-window-sensor.src │ │ └── xiaomi-door-window-sensor.groovy │ ├── xiaomi-motion-sensor.src │ │ └── xiaomi-motion-sensor.groovy │ ├── xiaomi-smart-button.src │ │ └── xiaomi-smart-button.groovy │ ├── zipato-rgbw-bulb-2-advanced.src │ │ └── zipato-rgbw-bulb-2-advanced.groovy │ ├── zipato-rgbw-bulb-advanced.src │ │ └── zipato-rgbw-bulb-advanced.groovy │ ├── zooz-4-in-1-sensor-advanced.src │ │ └── zooz-4-in-1-sensor-advanced.groovy │ ├── zooz-contact-sensor.src │ │ └── zooz-contact-sensor.groovy │ ├── zooz-mini-plug.src │ │ └── zooz-mini-plug.groovy │ ├── zooz-mini-sensor.src │ │ └── zooz-mini-sensor.groovy │ ├── zooz-power-strip.src │ │ └── zooz-power-strip.groovy │ └── zooz-zwave-smart-plug.src │ │ └── zooz-zwave-smart-plug.groovy ├── juano2310 │ └── jawbone-user.src │ │ └── jawbone-user.groovy ├── keen-home │ └── keen-home-smart-vent.src │ │ └── keen-home-smart-vent.groovy ├── smartthings │ ├── aeon-home-energy-meter-c3.src │ │ └── aeon-home-energy-meter-c3.groovy │ ├── aeon-home-energy-meter.src │ │ └── aeon-home-energy-meter.groovy │ ├── aeon-illuminator-module.src │ │ └── aeon-illuminator-module.groovy │ ├── aeon-key-fob.src │ │ └── aeon-key-fob.groovy │ ├── aeon-minimote.src │ │ └── aeon-minimote.groovy │ ├── aeon-multisensor-6.src │ │ └── aeon-multisensor-6.groovy │ ├── aeon-multisensor-gen5.src │ │ └── aeon-multisensor-gen5.groovy │ ├── aeon-multisensor.src │ │ └── aeon-multisensor.groovy │ ├── aeon-outlet.src │ │ └── aeon-outlet.groovy │ ├── aeon-rgbw-bulb-custom.src │ │ └── aeon-rgbw-bulb-custom.groovy │ ├── aeon-rgbw-bulb.src │ │ └── aeon-rgbw-bulb.groovy │ ├── aeon-secure-smart-energy-switch-uk.src │ │ └── aeon-secure-smart-energy-switch-uk.groovy │ ├── aeon-siren.src │ │ └── aeon-siren.groovy │ ├── aeon-smartstrip.src │ │ └── aeon-smartstrip.groovy │ ├── arduino-thingshield.src │ │ └── arduino-thingshield.groovy │ ├── arrival-sensor.src │ │ └── arrival-sensor.groovy │ ├── bose-soundtouch.src │ │ └── bose-soundtouch.groovy │ ├── centralite-dimmer.src │ │ └── centralite-dimmer.groovy │ ├── centralite-thermostat.src │ │ └── centralite-thermostat.groovy │ ├── cooper-rf9500.src │ │ └── cooper-rf9500.groovy │ ├── cree-bulb.src │ │ └── cree-bulb.groovy │ ├── ct100-thermostat.src │ │ └── ct100-thermostat.groovy │ ├── danalock.src │ │ └── danalock.groovy │ ├── dimmer-switch.src │ │ └── dimmer-switch.groovy │ ├── door-shield.src │ │ └── door-shield.groovy │ ├── ecobee-thermostat.src │ │ └── ecobee-thermostat.groovy │ ├── econet-vent.src │ │ └── econet-vent.groovy │ ├── everspring-flood-sensor.src │ │ └── everspring-flood-sensor.groovy │ ├── fibaro-dimmer.src │ │ └── fibaro-dimmer.groovy │ ├── fibaro-door-window-sensor.src │ │ └── fibaro-door-window-sensor.groovy │ ├── fibaro-flood-sensor.src │ │ └── fibaro-flood-sensor.groovy │ ├── fibaro-motion-sensor.src │ │ └── fibaro-motion-sensor.groovy │ ├── fibaro-rgbw-controller.src │ │ └── fibaro-rgbw-controller.groovy │ ├── fidure-thermostat.src │ │ └── fidure-thermostat.groovy │ ├── fortrezz-water-valve.src │ │ └── fortrezz-water-valve.groovy │ ├── foscam.src │ │ └── foscam.groovy │ ├── ge-link-bulb.src │ │ └── ge-link-bulb.groovy │ ├── ge-zigbee-dimmer.src │ │ └── ge-zigbee-dimmer.groovy │ ├── ge-zigbee-switch.src │ │ └── ge-zigbee-switch.groovy │ ├── home-energy-meter.src │ │ └── home-energy-meter.groovy │ ├── homeseer-multisensor.src │ │ └── homeseer-multisensor.groovy │ ├── hue-bridge.src │ │ └── hue-bridge.groovy │ ├── hue-bulb.src │ │ └── hue-bulb.groovy │ ├── hue-lux-bulb.src │ │ └── hue-lux-bulb.groovy │ ├── life360-user.src │ │ └── life360-user.groovy │ ├── lifx-color-bulb.src │ │ └── lifx-color-bulb.groovy │ ├── lifx-white-bulb.src │ │ └── lifx-white-bulb.groovy │ ├── light-sensor.src │ │ └── light-sensor.groovy │ ├── logitech-harmony-hub-c2c.src │ │ └── logitech-harmony-hub-c2c.groovy │ ├── mimolite-garage-door-controller.src │ │ └── mimolite-garage-door-controller.groovy │ ├── mobile-presence.src │ │ └── mobile-presence.groovy │ ├── momentary-button-tile.src │ │ └── momentary-button-tile.groovy │ ├── motion-detector.src │ │ └── motion-detector.groovy │ ├── nyce-motion-sensor.src │ │ └── nyce-motion-sensor.groovy │ ├── nyce-open-closed-sensor.src │ │ └── nyce-open-closed-sensor.groovy │ ├── on-off-button-tile.src │ │ └── on-off-button-tile.groovy │ ├── on-off-shield.src │ │ └── on-off-shield.groovy │ ├── open-closed-sensor.src │ │ └── open-closed-sensor.groovy │ ├── osram-lightify-gardenspot-mini-rgb.src │ │ └── osram-lightify-gardenspot-mini-rgb.groovy │ ├── osram-lightify-led-flexible-strip-rgbw.src │ │ └── osram-lightify-led-flexible-strip-rgbw.groovy │ ├── osram-lightify-led-tunable-white-60w.src │ │ └── osram-lightify-led-tunable-white-60w.groovy │ ├── particulate-detector.src │ │ └── particulate-detector.groovy │ ├── pet-feeder-shield.src │ │ └── pet-feeder-shield.groovy │ ├── plant-link.src │ │ └── plant-link.groovy │ ├── rgbw-light.src │ │ └── rgbw-light.groovy │ ├── samsung-smart-tv.src │ │ └── samsung-smart-tv.groovy │ ├── secure-dimmer.src │ │ └── secure-dimmer.groovy │ ├── smart-body-analyzer.src │ │ └── smart-body-analyzer.groovy │ ├── smartalert-siren.src │ │ └── smartalert-siren.groovy │ ├── smartpower-dimming-outlet.src │ │ └── smartpower-dimming-outlet.groovy │ ├── smartpower-outlet-v1.src │ │ └── smartpower-outlet-v1.groovy │ ├── smartpower-outlet.src │ │ └── smartpower-outlet.groovy │ ├── smartsense-garage-door-multi.src │ │ └── smartsense-garage-door-multi.groovy │ ├── smartsense-garage-door-sensor-button.src │ │ └── smartsense-garage-door-sensor-button.groovy │ ├── smartsense-moisture-sensor.src │ │ └── smartsense-moisture-sensor.groovy │ ├── smartsense-moisture.src │ │ └── smartsense-moisture.groovy │ ├── smartsense-motion-sensor.src │ │ └── smartsense-motion-sensor.groovy │ ├── smartsense-motion-temp-sensor.src │ │ └── smartsense-motion-temp-sensor.groovy │ ├── smartsense-motion.src │ │ └── smartsense-motion.groovy │ ├── smartsense-multi-sensor.src │ │ └── smartsense-multi-sensor.groovy │ ├── smartsense-multi.src │ │ └── smartsense-multi.groovy │ ├── smartsense-open-closed-accelerometer-sensor.src │ │ └── smartsense-open-closed-accelerometer-sensor.groovy │ ├── smartsense-open-closed-sensor.src │ │ └── smartsense-open-closed-sensor.groovy │ ├── smartsense-temp-humidity-sensor.src │ │ └── smartsense-temp-humidity-sensor.groovy │ ├── smartsense-virtual-open-closed.src │ │ └── smartsense-virtual-open-closed.groovy │ ├── smartweather-station-tile.src │ │ └── smartweather-station-tile.groovy │ ├── spark.src │ │ └── spark.groovy │ ├── sylvania-ultra-iq.src │ │ └── sylvania-ultra-iq.groovy │ ├── temperature-sensor.src │ │ └── temperature-sensor.groovy │ ├── testing │ │ ├── simulated-alarm.src │ │ │ └── simulated-alarm.groovy │ │ ├── simulated-button.src │ │ │ └── simulated-button.groovy │ │ ├── simulated-color-control.src │ │ │ └── simulated-color-control.groovy │ │ ├── simulated-contact-sensor.src │ │ │ └── simulated-contact-sensor.groovy │ │ ├── simulated-garage-door-opener.src │ │ │ └── simulated-garage-door-opener.groovy │ │ ├── simulated-lock.src │ │ │ └── simulated-lock.groovy │ │ ├── simulated-minimote.src │ │ │ └── simulated-minimote.groovy │ │ ├── simulated-motion-sensor.src │ │ │ └── simulated-motion-sensor.groovy │ │ ├── simulated-presence-sensor.src │ │ │ └── simulated-presence-sensor.groovy │ │ ├── simulated-smoke-alarm.src │ │ │ └── simulated-smoke-alarm.groovy │ │ ├── simulated-switch.src │ │ │ └── simulated-switch.groovy │ │ ├── simulated-temperature-sensor.src │ │ │ └── simulated-temperature-sensor.groovy │ │ ├── simulated-thermostat.src │ │ │ └── simulated-thermostat.groovy │ │ ├── simulated-water-sensor.src │ │ │ └── simulated-water-sensor.groovy │ │ └── simulated-water-valve.src │ │ │ └── simulated-water-valve.groovy │ ├── thing.src │ │ └── thing.groovy │ ├── tyco-door-window-sensor.src │ │ └── tyco-door-window-sensor.groovy │ ├── unknown.src │ │ └── unknown.groovy │ ├── wattvision.src │ │ └── wattvision.groovy │ ├── wemo-bulb.src │ │ └── wemo-bulb.groovy │ ├── wemo-light-switch.src │ │ └── wemo-light-switch.groovy │ ├── wemo-motion.src │ │ └── wemo-motion.groovy │ ├── wemo-switch.src │ │ └── wemo-switch.groovy │ ├── wireless-scale.src │ │ └── wireless-scale.groovy │ ├── zigbee-dimmer.src │ │ └── zigbee-dimmer.groovy │ ├── zigbee-hue-bulb.src │ │ └── zigbee-hue-bulb.groovy │ ├── zigbee-valve.src │ │ └── zigbee-valve.groovy │ ├── zwave-controller.src │ │ └── zwave-controller.groovy │ ├── zwave-device-mc.src │ │ └── zwave-device-mc.groovy │ ├── zwave-device.src │ │ └── zwave-device.groovy │ ├── zwave-door-window-sensor.src │ │ └── zwave-door-window-sensor.groovy │ ├── zwave-garage-door-opener.src │ │ └── zwave-garage-door-opener.groovy │ ├── zwave-lock.src │ │ └── zwave-lock.groovy │ ├── zwave-metering-dimmer.src │ │ └── zwave-metering-dimmer.groovy │ ├── zwave-metering-switch.src │ │ └── zwave-metering-switch.groovy │ ├── zwave-motion-sensor.src │ │ └── zwave-motion-sensor.groovy │ ├── zwave-relay.src │ │ └── zwave-relay.groovy │ ├── zwave-remote.src │ │ └── zwave-remote.groovy │ ├── zwave-sensor.src │ │ └── zwave-sensor.groovy │ ├── zwave-siren.src │ │ └── zwave-siren.groovy │ ├── zwave-smoke-alarm.src │ │ └── zwave-smoke-alarm.groovy │ ├── zwave-switch-secure.src │ │ └── zwave-switch-secure.groovy │ ├── zwave-switch.src │ │ └── zwave-switch.groovy │ ├── zwave-thermostat.src │ │ └── zwave-thermostat.groovy │ ├── zwave-virtual-momentary-contact-switch.src │ │ └── zwave-virtual-momentary-contact-switch.groovy │ ├── zwave-water-sensor.src │ │ └── zwave-water-sensor.groovy │ └── zwave-water-valve.src │ │ └── zwave-water-valve.groovy ├── superuser │ └── switch-too.src │ │ └── switch-too.groovy ├── vlaminck │ └── minecraft │ │ └── smart-block.src │ │ └── smart-block.groovy ├── wackford │ ├── quirky-wink-eggtray.src │ │ └── quirky-wink-eggtray.groovy │ ├── quirky-wink-nimbus.src │ │ └── quirky-wink-nimbus.groovy │ ├── quirky-wink-porkfolio.src │ │ └── quirky-wink-porkfolio.groovy │ ├── quirky-wink-powerstrip.src │ │ └── quirky-wink-powerstrip.groovy │ ├── quirky-wink-spotter.src │ │ └── quirky-wink-spotter.groovy │ └── tcp-bulb.src │ │ └── tcp-bulb.groovy └── zenwithin │ └── zen-thermostat.src │ └── zen-thermostat.groovy └── smartapps ├── arno └── bright-when-dark-and-or-bright-after-sunset.src │ └── bright-when-dark-and-or-bright-after-sunset.groovy ├── charette-joseph-gmail-com └── good-night-house.src │ └── good-night-house.groovy ├── chrisb └── goodnight-ubi.src │ └── goodnight-ubi.groovy ├── com-andrewreitz └── jenkins-notifier.src │ └── jenkins-notifier.groovy ├── com-obycode └── obything-music-connect.src │ └── obything-music-connect.groovy ├── com-sudarkoff └── working-from-home.src │ └── working-from-home.groovy ├── curb └── curb-control.src │ └── curb-control.groovy ├── dianoga ├── netatmo-connect.src │ └── netatmo-connect.groovy ├── thermostat-auto-off.src │ └── thermostat-auto-off.groovy └── whole-house-fan.src │ └── whole-house-fan.groovy ├── docwisdom └── humidity-alert.src │ └── humidity-alert.groovy ├── dooglave └── let-there-be-dark.src │ └── let-there-be-dark.groovy ├── egid ├── smart-windows.src │ └── smart-windows.groovy └── weather-windows.src │ └── weather-windows.groovy ├── erocm123 ├── button-controller-enhanced-lighting.src │ ├── button-controller-enhanced-lighting-2x.png │ ├── button-controller-enhanced-lighting-3x.png │ ├── button-controller-enhanced-lighting.groovy │ └── button-controller-enhanced-lighting.png ├── device-monitor.src │ ├── device-monitor-icon-2x.png │ ├── device-monitor-icon-3x.png │ ├── device-monitor-icon.png │ └── device-monitor.groovy ├── dual-relay-adapter.src │ └── dual-relay-adapter.groovy ├── left-in-the-dark.src │ ├── left-in-the-dark-icon-2x.png │ ├── left-in-the-dark-icon-3x.png │ ├── left-in-the-dark-icon.png │ └── left-in-the-dark.groovy ├── meantemp │ ├── mean-temperature-sensor-manager.src │ │ └── mean-temperature-sensor-manager.groovy │ └── mean-temperature-sensor.src │ │ └── mean-temperature-sensor.groovy ├── smartlife-rgbw-light-connect.src │ ├── smartlife-rgbw-icon-2x.png │ ├── smartlife-rgbw-icon-3x.png │ ├── smartlife-rgbw-icon.png │ └── smartlife-rgbw-light-connect.groovy ├── smartlife-virtual-dimmer-sync.src │ └── smartlife-virtual-dimmer-sync.groovy ├── sonoff-connect.src │ ├── sonoff-connect-icon-2x.png │ ├── sonoff-connect-icon-3x.png │ ├── sonoff-connect-icon.png │ └── sonoff-connect.groovy ├── switch-stress-test.src │ └── switch-stress-test.groovy ├── virtual-device-sync.src │ ├── virtual-device-sync-2x.png │ ├── virtual-device-sync-3x.png │ ├── virtual-device-sync.groovy │ └── virtual-device-sync.png ├── virtual-physical-switch-sync.src │ └── virtual-physical-switch-sync.groovy └── z-waveat │ ├── README.md │ ├── zwave-association-tool.src │ └── zwave-association-tool.groovy │ └── zwave-association.src │ └── zwave-association.groovy ├── hwustrack └── coffee-after-shower.src │ └── coffee-after-shower.groovy ├── imbrianj ├── door-knocker.src │ └── door-knocker.groovy ├── forgiving-security.src │ └── forgiving-security.groovy ├── hall-light-welcome-home.src │ └── hall-light-welcome-home.groovy ├── nobody-home.src │ └── nobody-home.groovy ├── ready-for-rain.src │ └── ready-for-rain.groovy ├── safe-watch.src │ └── safe-watch.groovy └── thermostat-window-check.src │ └── thermostat-window-check.groovy ├── initialstate-events └── initial-state-event-streamer.src │ └── initial-state-event-streamer.groovy ├── jls └── my-light-toggle.src │ └── my-light-toggle.groovy ├── jonathan-a └── auto-humidity-vent.src │ └── auto-humidity-vent.groovy ├── juano2310 ├── jawbone-button-notifier.src │ └── jawbone-button-notifier.groovy └── jawbone-up-connect.src │ └── jawbone-up-connect.groovy ├── kristopherkubicki └── turn-off-with-motion.src │ └── turn-off-with-motion.groovy ├── lock-auto-super-enhanced └── enhanced-auto-lock-door.src │ └── enhanced-auto-lock-door.groovy ├── macstainless └── lights-on-when-door-opens-after-sundown.src │ └── lights-on-when-door-opens-after-sundown.groovy ├── mager └── weather-underground-pws-connect.src │ └── weather-underground-pws-connect.groovy ├── michaelstruck ├── color-coordinator.src │ └── color-coordinator.groovy ├── smart-home-ventilation.src │ └── smart-home-ventilation.groovy ├── switch-activates-home-phrase-or-mode.src │ └── switch-activates-home-phrase-or-mode.groovy ├── switch-activates-home-phrase.src │ └── switch-activates-home-phrase.groovy ├── switch-changes-mode.src │ └── switch-changes-mode.groovy └── talking-alarm-clock.src │ └── talking-alarm-clock.groovy ├── naissan └── lights-off-with-no-motion-and-presence.src │ └── lights-off-with-no-motion-and-presence.groovy ├── pope └── smart-light-timer-x-minutes-unless-already-on.src │ └── smart-light-timer-x-minutes-unless-already-on.groovy ├── resteele └── monitor-on-sense.src │ └── monitor-on-sense.groovy ├── shabbatholidaymode └── shabbat-and-holiday-modes.src │ └── shabbat-and-holiday-modes.groovy ├── sheikhsphere └── smart-humidifier.src │ └── smart-humidifier.groovy ├── sidjohn1 └── smart-turn-it-on.src │ └── smart-turn-it-on.groovy ├── skp19 └── door-lock-code-distress-message.src │ └── door-lock-code-distress-message.groovy ├── smart-auto-lock- └── -unlock │ └── smart-auto-lock-unlock.src │ └── smart-auto-lock-unlock.groovy ├── smartthings ├── beacon-control.src │ └── beacon-control.groovy ├── big-turn-off.src │ └── big-turn-off.groovy ├── big-turn-on.src │ └── big-turn-on.groovy ├── bon-voyage.src │ └── bon-voyage.groovy ├── bose-soundtouch-connect.src │ └── bose-soundtouch-connect.groovy ├── brighten-dark-places.src │ └── brighten-dark-places.groovy ├── brighten-my-path.src │ └── brighten-my-path.groovy ├── button-controller.src │ └── button-controller.groovy ├── camera-power-scheduler.src │ └── camera-power-scheduler.groovy ├── cameras-on-when-im-away.src │ └── cameras-on-when-im-away.groovy ├── carpool-notifier.src │ └── carpool-notifier.groovy ├── close-the-valve.src │ └── close-the-valve.groovy ├── curling-iron.src │ └── curling-iron.groovy ├── darken-behind-me.src │ └── darken-behind-me.groovy ├── double-tap.src │ └── double-tap.groovy ├── dry-the-wetspot.src │ └── dry-the-wetspot.groovy ├── ecobee-connect.src │ └── ecobee-connect.groovy ├── elder-care-daily-routine.src │ └── elder-care-daily-routine.groovy ├── elder-care-slip-fall.src │ └── elder-care-slip-fall.groovy ├── energy-alerts.src │ └── energy-alerts.groovy ├── energy-saver.src │ └── energy-saver.groovy ├── examples │ └── every-element.src │ │ └── every-element.groovy ├── feed-my-pet.src │ └── feed-my-pet.groovy ├── flood-alert.src │ └── flood-alert.groovy ├── foscam-connect.src │ └── foscam-connect.groovy ├── garage-door-monitor.src │ └── garage-door-monitor.groovy ├── garage-door-opener.src │ └── garage-door-opener.groovy ├── gentle-wake-up.src │ └── gentle-wake-up.groovy ├── good-night.src │ └── good-night.groovy ├── greetings-earthling.src │ └── greetings-earthling.groovy ├── habit-helper.src │ └── habit-helper.groovy ├── has-barkley-been-fed.src │ └── has-barkley-been-fed.groovy ├── hub-ip-notifier.src │ └── hub-ip-notifier.groovy ├── hue-connect.src │ └── hue-connect.groovy ├── hue-mood-lighting.src │ └── hue-mood-lighting.groovy ├── ifttt.src │ └── ifttt.groovy ├── it-moved.src │ └── it-moved.groovy ├── its-too-cold.src │ └── its-too-cold.groovy ├── its-too-hot.src │ └── its-too-hot.groovy ├── keep-me-cozy-ii.src │ └── keep-me-cozy-ii.groovy ├── keep-me-cozy.src │ └── keep-me-cozy.groovy ├── laundry-monitor.src │ └── laundry-monitor.groovy ├── left-it-open.src │ └── left-it-open.groovy ├── let-there-be-light.src │ └── let-there-be-light.groovy ├── life360-connect.src │ └── life360-connect.groovy ├── lifx-connect.src │ └── lifx-connect.groovy ├── light-follows-me.src │ └── light-follows-me.groovy ├── light-up-the-night.src │ └── light-up-the-night.groovy ├── lights-off-when-closed.src │ └── lights-off-when-closed.groovy ├── lock-it-when-i-leave.src │ └── lock-it-when-i-leave.groovy ├── logitech-harmony-connect.src │ └── logitech-harmony-connect.groovy ├── mail-arrived.src │ └── mail-arrived.groovy ├── make-it-so.src │ └── make-it-so.groovy ├── medicine-reminder.src │ └── medicine-reminder.groovy ├── mini-hue-controller.src │ └── mini-hue-controller.groovy ├── mood-cube.src │ └── mood-cube.groovy ├── nfc-tag-toggle.src │ └── nfc-tag-toggle.groovy ├── notify-me-when-it-opens.src │ └── notify-me-when-it-opens.groovy ├── notify-me-when.src │ └── notify-me-when.groovy ├── notify-me-with-hue.src │ └── notify-me-with-hue.groovy ├── once-a-day.src │ └── once-a-day.groovy ├── photo-burst-when.src │ └── photo-burst-when.groovy ├── power-allowance.src │ └── power-allowance.groovy ├── presence-change-push.src │ └── presence-change-push.groovy ├── presence-change-text.src │ └── presence-change-text.groovy ├── ridiculously-automated-garage-door.src │ └── ridiculously-automated-garage-door.groovy ├── rise-and-shine.src │ └── rise-and-shine.groovy ├── samsung-tv-connect.src │ └── samsung-tv-connect.groovy ├── scheduled-mode-change.src │ └── scheduled-mode-change.groovy ├── send-ham-bridge-command-when.src │ └── send-ham-bridge-command-when.groovy ├── severe-weather-alert.src │ └── severe-weather-alert.groovy ├── single-button-controller.src │ └── single-button-controller.groovy ├── sleepy-time.src │ └── sleepy-time.groovy ├── smart-nightlight.src │ └── smart-nightlight.groovy ├── smart-security.src │ └── smart-security.groovy ├── smartweather-station-controller.src │ └── smartweather-station-controller.groovy ├── sonos-control.src │ └── sonos-control.groovy ├── sonos-mood-music.src │ └── sonos-mood-music.groovy ├── sonos-music-modes.src │ └── sonos-music-modes.groovy ├── sonos-notify-with-sound.src │ └── sonos-notify-with-sound.groovy ├── sonos-remote-control.src │ └── sonos-remote-control.groovy ├── sonos-weather-forecast.src │ └── sonos-weather-forecast.groovy ├── step-notifier.src │ └── step-notifier.groovy ├── sunrise-sunset.src │ └── sunrise-sunset.groovy ├── tesla-connect.src │ └── tesla-connect.groovy ├── text-me-when-it-opens.src │ └── text-me-when-it-opens.groovy ├── text-me-when-theres-motion-and-im-not-here.src │ └── text-me-when-theres-motion-and-im-not-here.groovy ├── the-big-switch.src │ └── the-big-switch.groovy ├── the-flasher.src │ └── the-flasher.groovy ├── the-gun-case-moved.src │ └── the-gun-case-moved.groovy ├── turn-it-on-for-5-minutes.src │ └── turn-it-on-for-5-minutes.groovy ├── turn-it-on-when-im-here.src │ └── turn-it-on-when-im-here.groovy ├── turn-it-on-when-it-opens.src │ └── turn-it-on-when-it-opens.groovy ├── turn-on-only-if-i-arrive-after-sunset.src │ └── turn-on-only-if-i-arrive-after-sunset.groovy ├── ubi.src │ └── ubi.groovy ├── undead-early-warning.src │ └── undead-early-warning.groovy ├── unlock-it-when-i-arrive.src │ └── unlock-it-when-i-arrive.groovy ├── virtual-thermostat.src │ └── virtual-thermostat.groovy ├── wattvision-manager.src │ └── wattvision-manager.groovy ├── wemo-connect.src │ └── wemo-connect.groovy ├── when-its-going-to-rain.src │ └── when-its-going-to-rain.groovy ├── withings-manager.src │ └── withings-manager.groovy ├── withings.src │ └── withings.groovy └── yoics-connect.src │ └── yoics-connect.groovy ├── sprayercontroller └── sprayer-controller-2.src │ └── sprayer-controller-2.groovy ├── statusbits └── smart-alarm.src │ └── smart-alarm.groovy ├── tslagle13 ├── hello-home-phrase-director.src │ └── hello-home-phrase-director.groovy ├── lighting-director.src │ └── lighting-director.groovy ├── thermostat-mode-director.src │ └── thermostat-mode-director.groovy └── vacation-lighting-director.src │ └── vacation-lighting-director.groovy ├── user8798 └── lock-it-at-a-specific-time.src │ └── lock-it-at-a-specific-time.groovy ├── vlaminck ├── alfred-workflow.src │ └── alfred-workflow.groovy └── minecraft │ ├── smartblock-chat-sender.src │ └── smartblock-chat-sender.groovy │ ├── smartblock-linker.src │ └── smartblock-linker.groovy │ ├── smartblock-manager.src │ └── smartblock-manager.groovy │ └── smartblock-notifier.src │ └── smartblock-notifier.groovy ├── wackford ├── quirky-connect.src │ └── quirky-connect.groovy └── tcp-bulbs-connect.src │ └── tcp-bulbs-connect.groovy └── weatherbug └── weatherbug-home.src └── weatherbug-home.groovy /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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/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/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 | -------------------------------------------------------------------------------- /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/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/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/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/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 | -------------------------------------------------------------------------------- /devicetypes/capabilities/switch-level-capability.src/switch-level-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 Level Capability", namespace: "capabilities", author: "SmartThings") { 16 | capability "Switch Level" 17 | } 18 | 19 | simulator { 20 | status "on": "switch:on" 21 | status "off": "switch:off" 22 | 23 | reply "on":"on" 24 | reply "off":"off" 25 | 26 | [5,10,25,33,50,66,75,99].each { 27 | status "$it%": "switch:on,level:$it" 28 | } 29 | reply "setLevel: 0":"switch:off,level:0" 30 | (1..99).each { 31 | reply "setLevel: $it":"switch:on,level:$it" 32 | } 33 | } 34 | 35 | tiles { 36 | standardTile("switch", "device.switch", width: 2, height: 2) { 37 | state "off", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn" 38 | state "on", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#79b821", nextState:"turningOff" 39 | state "turningOn", label:'${name}', icon:"st.switches.switch.on", backgroundColor:"#79b821" 40 | state "turningOff", label:'${name}', icon:"st.switches.switch.off", backgroundColor:"#ffffff" 41 | } 42 | controlTile("levelSliderControl", "device.level", "slider", height: 2, width: 1, inactiveLabel: false) { 43 | state "level", action:"setLevel" 44 | } 45 | standardTile("refresh", "device.switch", inactiveLabel: false, decoration: "flat") { 46 | state "default", label:"", action:"refresh", icon:"st.secondary.refresh" 47 | } 48 | 49 | main "switch" 50 | details "switch", "levelSliderControl", "refresh" 51 | } 52 | } 53 | 54 | def parse(String description) { 55 | log.trace description 56 | def pairs = description.split(",") 57 | def result = [] 58 | pairs.each { 59 | def pair = it.split(":") 60 | result << createEvent(name: pair[0].trim(), value: pair[1].trim()) 61 | } 62 | log.trace result 63 | result 64 | } 65 | 66 | def on() { 67 | 'on' 68 | } 69 | 70 | def off() { 71 | 'off' 72 | } 73 | 74 | def setLevel(value) { 75 | "setLevel: $value" 76 | } 77 | 78 | def refresh() { 79 | 'refresh' 80 | } 81 | -------------------------------------------------------------------------------- /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/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/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 | -------------------------------------------------------------------------------- /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 "Relative Humidity Measurement" 19 | capability "Temperature Measurement" 20 | 21 | attribute "carbonDioxide", "string" 22 | } 23 | 24 | simulator { 25 | // TODO: define status and reply messages here 26 | } 27 | 28 | tiles { 29 | valueTile("temperature", "device.temperature", width: 2, height: 2) { 30 | state("temperature", label: '${currentValue}°', unit:"F", 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 | valueTile("humidity", "device.humidity", inactiveLabel: false) { 42 | state "default", label:'${currentValue}%', unit:"Humidity" 43 | } 44 | valueTile("carbonDioxide", "device.carbonDioxide", inactiveLabel: false) { 45 | state "default", label:'${currentValue}ppm', unit:"CO2" 46 | } 47 | standardTile("refresh", "device.pressure", inactiveLabel: false, decoration: "flat") { 48 | state "default", action:"device.poll", icon:"st.secondary.refresh" 49 | } 50 | main "temperature" 51 | details(["temperature", "humidity", "carbonDioxide", "refresh"]) 52 | } 53 | } 54 | 55 | // parse events into attributes 56 | def parse(String description) { 57 | log.debug "Parsing '${description}'" 58 | 59 | } 60 | 61 | def poll() { 62 | parent.poll() 63 | } -------------------------------------------------------------------------------- /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 "Relative Humidity Measurement" 19 | capability "Temperature Measurement" 20 | } 21 | 22 | simulator { 23 | // TODO: define status and reply messages here 24 | } 25 | 26 | tiles { 27 | valueTile("temperature", "device.temperature", width: 2, height: 2) { 28 | state("temperature", label: '${currentValue}°', backgroundColors: [ 29 | [value: 31, color: "#153591"], 30 | [value: 44, color: "#1e9cbb"], 31 | [value: 59, color: "#90d2a7"], 32 | [value: 74, color: "#44b621"], 33 | [value: 84, color: "#f1d801"], 34 | [value: 95, color: "#d04e00"], 35 | [value: 96, color: "#bc2323"] 36 | ] 37 | ) 38 | } 39 | valueTile("humidity", "device.humidity", inactiveLabel: false) { 40 | state "humidity", label:'${currentValue}%', unit:"Humidity" 41 | } 42 | standardTile("refresh", "device.thermostatMode", inactiveLabel: false, decoration: "flat") { 43 | state "default", action:"device.poll", icon:"st.secondary.refresh" 44 | } 45 | main (["temperature", "humidity"]) 46 | details(["temperature", "humidity", "refresh"]) 47 | } 48 | } 49 | 50 | // parse events into attributes 51 | def parse(String description) { 52 | log.debug "Parsing '${description}'" 53 | // TODO: handle 'humidity' attribute 54 | // TODO: handle 'temperature' attribute 55 | // TODO: handle 'carbonDioxide' attribute 56 | // TODO: handle 'noise' attribute 57 | // TODO: handle 'pressure' attribute 58 | 59 | } 60 | 61 | def poll() { 62 | parent.poll() 63 | } 64 | 65 | -------------------------------------------------------------------------------- /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 | attribute "rain", "number" 19 | attribute "rainSumHour", "number" 20 | attribute "rainSumDay", "number" 21 | attribute "units", "string" 22 | 23 | command "poll" 24 | } 25 | 26 | simulator { 27 | // TODO: define status and reply messages here 28 | } 29 | 30 | tiles { 31 | valueTile("rain", "device.rain", width: 2, height: 2, inactiveLabel: false) { 32 | state "default", label:'${currentValue}' 33 | } 34 | valueTile("rainSumHour", "device.rainSumHour", inactiveLabel: false) { 35 | state "default", label:'${currentValue}\nhour' 36 | } 37 | valueTile("rainSumDay", "device.rainSumDay", inactiveLabel: false) { 38 | state "default", label:'${currentValue}\nday' 39 | } 40 | standardTile("refresh", "device.rain", inactiveLabel: false, decoration: "flat") { 41 | state "default", action:"refresh.poll", icon:"st.secondary.refresh" 42 | } 43 | main (["rain", "rainSumHour", "rainSumDay"]) 44 | details(["rain", "rainSumHour", "rainSumDay", "refresh"]) 45 | } 46 | } 47 | 48 | // parse events into attributes 49 | def parse(String description) { 50 | log.debug "Parsing '${description}'" 51 | } 52 | 53 | def poll() { 54 | parent.poll() 55 | } 56 | -------------------------------------------------------------------------------- /devicetypes/erocm123/aeon-multisensor-6-advanced.src/9 Multisensor 6 V1.07 - ES.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/devicetypes/erocm123/aeon-multisensor-6-advanced.src/9 Multisensor 6 V1.07 - ES.pdf -------------------------------------------------------------------------------- /devicetypes/erocm123/carbon-dioxide-detector-child-device.src/carbon-dioxide-detector-child-device.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Carbon Dioxide Detector Child Device 3 | * 4 | * Copyright 2017 Eric Maycock 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: "Carbon Dioxide Detector Child Device", namespace: "erocm123", author: "Eric Maycock", vid:"generic-carbon-monoxide") { 18 | capability "Carbon Dioxide Measurement" 19 | capability "Sensor" 20 | } 21 | 22 | tiles() { 23 | multiAttributeTile(name:"smoke", type: "generic", width: 6, height: 4){ 24 | tileAttribute ("device.alarmState", key: "PRIMARY_CONTROL") { 25 | attributeState("clear", label:"clear", icon:"st.alarm.smoke.clear", backgroundColor:"#ffffff") 26 | attributeState("carbonMonoxide", label:"dioxide", icon:"st.alarm.carbon-monoxide.carbon-monoxide", backgroundColor:"#e86d13") 27 | } 28 | } 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /devicetypes/erocm123/carbon-monoxide-detector-child-device.src/carbon-monoxide-detector-child-device.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Carbon Monoxide Detector Child Device 3 | * 4 | * Copyright 2017 Eric Maycock 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: "Carbon Monoxide Detector Child Device", namespace: "erocm123", author: "Eric Maycock", vid:"generic-carbon-monoxide") { 18 | capability "Carbon Monoxide Detector" 19 | capability "Sensor" 20 | } 21 | 22 | tiles() { 23 | multiAttributeTile(name:"carbonMonoxide", type: "generic", width: 6, height: 4){ 24 | tileAttribute ("device.carbonMonoxide", key: "PRIMARY_CONTROL") { 25 | attributeState("clear", label:"clear", icon:"st.alarm.smoke.clear", backgroundColor:"#ffffff") 26 | attributeState("detected", label:"monoxide", icon:"st.alarm.carbon-monoxide.carbon-monoxide", backgroundColor:"#e86d13") 27 | } 28 | } 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /devicetypes/erocm123/contact-sensor-child-device.src/contact-sensor-child-device.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Contact Sensor Child Device 3 | * 4 | * Copyright 2017 Eric Maycock 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: "Contact Sensor Child Device", namespace: "erocm123", author: "Eric Maycock", vid:"generic-contact") { 18 | capability "Contact Sensor" 19 | capability "Sensor" 20 | } 21 | 22 | tiles() { 23 | multiAttributeTile(name:"contact", type: "generic"){ 24 | tileAttribute ("device.contact", key: "PRIMARY_CONTROL") { 25 | attributeState "open", label:'${name}', icon:"st.contact.contact.open", backgroundColor:"#e86d13" 26 | attributeState "closed", label:'${name}', icon:"st.contact.contact.closed", backgroundColor:"#00a0dc" 27 | } 28 | } 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /devicetypes/erocm123/latest_commit.txt: -------------------------------------------------------------------------------- 1 | Latest commit 2 | 3 | 20181204 4 | -------------------------------------------------------------------------------- /devicetypes/erocm123/lock-child-device.src/lock-child-device.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Lock Child Device 3 | * 4 | * Copyright 2017 Eric Maycock 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: "Lock Child Device", namespace: "erocm123", author: "Eric Maycock", vid:"generic-lock") { 18 | capability "Lock" 19 | capability "Sensor" 20 | } 21 | 22 | tiles() { 23 | multiAttributeTile(name:"lock", type: "generic"){ 24 | tileAttribute ("device.lock", key: "PRIMARY_CONTROL") { 25 | attributeState "locked", label:'locked', icon:"st.locks.lock.locked", backgroundColor:"#00A0DC", nextState:"unlocking" 26 | attributeState "unlocked", label:'unlocked', icon:"st.locks.lock.unlocked", backgroundColor:"#ffffff", nextState:"locking" 27 | } 28 | } 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /devicetypes/erocm123/lockable-door-window-child-device.src/lockable-door-window-child-device.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Lockable Door/Window Child Device 3 | * 4 | * Copyright 2017 Eric Maycock 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: "Lockable Door/Window Child Device", namespace: "erocm123", author: "Eric Maycock", vid:"generic-lock") { 18 | capability "Contact Sensor" 19 | capability "Lock" 20 | capability "Sensor" 21 | } 22 | 23 | tiles() { 24 | tiles(scale: 2) { 25 | multiAttributeTile(name:"contact", type: "generic", width: 6, height: 4){ 26 | tileAttribute ("device.contact", key: "PRIMARY_CONTROL") { 27 | attributeState "closed", label:'${name}', icon:"st.contact.contact.closed", backgroundColor:"#00a0dc" 28 | attributeState "open", label:'${name}', icon:"st.contact.contact.open", backgroundColor:"#e86d13" 29 | } 30 | tileAttribute ("lock", key: "SECONDARY_CONTROL") { 31 | attributeState "locked", label:'locked', icon:"st.locks.lock.locked", backgroundColor:"#00A0DC", nextState:"unlocking" 32 | attributeState "unlocked", label:'unlocked', icon:"st.locks.lock.unlocked", backgroundColor:"#ffffff", nextState:"locking" 33 | } 34 | } 35 | 36 | 37 | main "contact" 38 | details(["contact", childDeviceTiles("all")]) 39 | } 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /devicetypes/erocm123/mipow-playbulb.src/find_handle.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | candle=$1 4 | 5 | for i in 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 6 | do 7 | result=$(gatttool -b "$candle" --char-read -a 0x00$i | sed 's_Characteristic value/descriptor: __g' | egrep '^[0-9a-fA-F][0-9a-fA-F]\s[0-9a-fA-F][0-9a-fA-F]\s[0-9a-fA-F][0-9a-fA-F]\s[0-9a-fA-F][0-9a-fA-F]\s$') 2>/dev/null 8 | if [ "$result" != "" ] 9 | then 10 | possible_color=$(echo -e "$possible_color\n0x00$i $result") 11 | fi 12 | result=$(gatttool -b "$candle" --char-read -a 0x00$i | sed 's_Characteristic value/descriptor: __g' | egrep '^[0-9a-fA-F][0-9a-fA-F]\s[0-9a-fA-F][0-9a-fA-F]\s[0-9a-fA-F][0-9a-fA-F]\s[0-9a-fA-F][0-9a-fA-F]\s[0-9a-fA-F][0-9a-fA-F]\s[0-9a-fA-F][0-9a-fA-F]\s[0-9a-fA-F][0-9a-fA-F]\s[0-9a-fA-F][0-9a-fA-F]\s$' 2>/dev/null) 13 | if [ "$result" != "" ] 14 | then 15 | possible_effect=$(echo -e "$possible_effect\n0x00$i $result") 16 | fi 17 | done 18 | 19 | echo "" 20 | echo "" 21 | echo "Possible color handles found" 22 | echo "$possible_color" 23 | echo "" 24 | echo "" 25 | echo "Possible effect handles found" 26 | echo "$possible_effect" 27 | -------------------------------------------------------------------------------- /devicetypes/erocm123/motion-sensor-child-device.src/motion-sensor-child-device.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Motion Sensor Child Device 3 | * 4 | * Copyright 2017 Eric Maycock 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: "Motion Sensor Child Device", namespace: "erocm123", author: "Eric Maycock", vid:"generic-motion") { 18 | capability "Motion Sensor" 19 | capability "Sensor" 20 | } 21 | 22 | tiles() { 23 | multiAttributeTile(name:"motion", type: "generic"){ 24 | tileAttribute ("device.motion", key: "PRIMARY_CONTROL") { 25 | attributeState "active", label:'${name}', icon:"st.motion.motion.active", backgroundColor:"#00A0DC" 26 | attributeState "inactive", label:'${name}', icon:"st.motion.motion.inactive", backgroundColor:"#cccccc" 27 | } 28 | } 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /devicetypes/erocm123/qubino-flush-1d-relay.src/configure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/devicetypes/erocm123/qubino-flush-1d-relay.src/configure.png -------------------------------------------------------------------------------- /devicetypes/erocm123/qubino-flush-1d-relay.src/configure@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/devicetypes/erocm123/qubino-flush-1d-relay.src/configure@2x.png -------------------------------------------------------------------------------- /devicetypes/erocm123/smartlife-rgbw-controller.src/SmartLifeRGBWController.ino.generic.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/devicetypes/erocm123/smartlife-rgbw-controller.src/SmartLifeRGBWController.ino.generic.bin -------------------------------------------------------------------------------- /devicetypes/erocm123/smoke-detector-child-device.src/smoke-detector-child-device.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Smoke Detector Child Device 3 | * 4 | * Copyright 2017 Eric Maycock 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: "Smoke Detector Child Device", namespace: "erocm123", author: "Eric Maycock", vid:"generic-smoke") { 18 | capability "Smoke Detector" 19 | capability "Sensor" 20 | } 21 | 22 | tiles() { 23 | multiAttributeTile(name:"smoke", type: "generic", width: 6, height: 4){ 24 | tileAttribute ("device.smoke", key: "PRIMARY_CONTROL") { 25 | attributeState("clear", label:"clear", icon:"st.alarm.smoke.clear", backgroundColor:"#ffffff") 26 | attributeState("detected", label:"smoke", icon:"st.alarm.smoke.smoke", backgroundColor:"#e86d13") 27 | } 28 | } 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /devicetypes/erocm123/sonoff-4ch-wifi-switch.src/Sonoff4CH.ino.generic.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/devicetypes/erocm123/sonoff-4ch-wifi-switch.src/Sonoff4CH.ino.generic.bin -------------------------------------------------------------------------------- /devicetypes/erocm123/sonoff-dual-wifi-switch.src/SonoffDual.ino.generic.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/devicetypes/erocm123/sonoff-dual-wifi-switch.src/SonoffDual.ino.generic.bin -------------------------------------------------------------------------------- /devicetypes/erocm123/sonoff-ifan02-wifi-controller.src/SonoffIFan02.ino.generic.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/devicetypes/erocm123/sonoff-ifan02-wifi-controller.src/SonoffIFan02.ino.generic.bin -------------------------------------------------------------------------------- /devicetypes/erocm123/sonoff-pow-wifi-switch.src/SonoffPOW.ino.generic.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/devicetypes/erocm123/sonoff-pow-wifi-switch.src/SonoffPOW.ino.generic.bin -------------------------------------------------------------------------------- /devicetypes/erocm123/sonoff-th-wifi-switch.src/SonoffTH.ino.generic.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/devicetypes/erocm123/sonoff-th-wifi-switch.src/SonoffTH.ino.generic.bin -------------------------------------------------------------------------------- /devicetypes/erocm123/sonoff-wifi-switch.src/ESPEasy_R120.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/devicetypes/erocm123/sonoff-wifi-switch.src/ESPEasy_R120.zip -------------------------------------------------------------------------------- /devicetypes/erocm123/sonoff-wifi-switch.src/Sonoff.ino.generic.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/devicetypes/erocm123/sonoff-wifi-switch.src/Sonoff.ino.generic.bin -------------------------------------------------------------------------------- /devicetypes/erocm123/sonoff-wifi-switch.src/SonoffS20.ino.generic.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/devicetypes/erocm123/sonoff-wifi-switch.src/SonoffS20.ino.generic.bin -------------------------------------------------------------------------------- /devicetypes/erocm123/sonoff-wifi-switch.src/SonoffShelly.ino.generic.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/devicetypes/erocm123/sonoff-wifi-switch.src/SonoffShelly.ino.generic.bin -------------------------------------------------------------------------------- /devicetypes/erocm123/sonoff-wifi-switch.src/SonoffTouch.ino.generic.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/devicetypes/erocm123/sonoff-wifi-switch.src/SonoffTouch.ino.generic.bin -------------------------------------------------------------------------------- /devicetypes/erocm123/sonoff-wifi-switch.src/firmware_flash.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/devicetypes/erocm123/sonoff-wifi-switch.src/firmware_flash.zip -------------------------------------------------------------------------------- /devicetypes/erocm123/switch-child-device.src/switch-child-device.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Switch Child Device 3 | * 4 | * Copyright 2017 Eric Maycock 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: "Switch Child Device", namespace: "erocm123", author: "Eric Maycock", vid: "generic-switch") { 18 | capability "Switch" 19 | capability "Actuator" 20 | capability "Sensor" 21 | capability "Refresh" 22 | } 23 | 24 | tiles { 25 | multiAttributeTile(name:"switch", type: "lighting", width: 3, height: 4, canChangeIcon: true){ 26 | tileAttribute ("device.switch", key: "PRIMARY_CONTROL") { 27 | attributeState "off", label: '${name}', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff", nextState:"turningOn" 28 | attributeState "on", label: '${name}', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#00A0DC", nextState:"turningOff" 29 | attributeState "turningOn", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#00A0DC", nextState:"turningOff" 30 | attributeState "turningOff", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn" 31 | } 32 | } 33 | standardTile("refresh", "device.switch", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { 34 | state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh" 35 | } 36 | } 37 | } 38 | 39 | void on() { 40 | parent.childOn(device.deviceNetworkId) 41 | } 42 | 43 | void off() { 44 | parent.childOff(device.deviceNetworkId) 45 | } 46 | 47 | void refresh() { 48 | parent.childRefresh(device.deviceNetworkId) 49 | } 50 | -------------------------------------------------------------------------------- /devicetypes/erocm123/switch-level-child-device.src/switch-level-child-device.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2018 Eric Maycock 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 Level Child Device", namespace: "erocm123", author: "Eric Maycock", vid: "generic-dimmer") { 16 | capability "Switch Level" 17 | capability "Actuator" 18 | capability "Switch" 19 | capability "Refresh" 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 "on", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#00a0dc", nextState:"turningOff" 26 | attributeState "off", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn" 27 | attributeState "turningOn", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#00a0dc", nextState:"turningOff" 28 | attributeState "turningOff", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn" 29 | } 30 | tileAttribute ("device.level", key: "SLIDER_CONTROL") { 31 | attributeState "level", action:"switch level.setLevel" 32 | } 33 | } 34 | valueTile("level", "device.level", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { 35 | state "level", label:'${currentValue} %', unit:"%", backgroundColor:"#ffffff" 36 | } 37 | standardTile("refresh", "device.switch", width: 2, height: 2, inactiveLabel: false, decoration: "flat") { 38 | state "default", label:'', action:"refresh.refresh", icon:"st.secondary.refresh" 39 | } 40 | 41 | 42 | 43 | } 44 | } 45 | 46 | 47 | void on() { 48 | parent.childOn(device.deviceNetworkId) 49 | } 50 | 51 | void off() { 52 | parent.childOff(device.deviceNetworkId) 53 | } 54 | 55 | void refresh() { 56 | parent.childRefresh(device.deviceNetworkId) 57 | } 58 | 59 | def setLevel(value) { 60 | parent.childSetLevel(device.deviceNetworkId, value) 61 | } -------------------------------------------------------------------------------- /devicetypes/erocm123/water-sensor-child-device.src/water-sensor-child-device.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Water Sensor Child Device 3 | * 4 | * Copyright 2017 Eric Maycock 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: "Water Sensor Child Device", namespace: "erocm123", author: "Eric Maycock", vid:"generic-leak") { 18 | capability "Water Sensor" 19 | capability "Sensor" 20 | } 21 | 22 | tiles() { 23 | multiAttributeTile(name:"water", type: "generic", width: 6, height: 4){ 24 | tileAttribute ("device.water", key: "PRIMARY_CONTROL") { 25 | attributeState("dry", icon:"st.alarm.water.dry", backgroundColor:"#ffffff") 26 | attributeState("wet", icon:"st.alarm.water.wet", backgroundColor:"#00a0dc") 27 | } 28 | } 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /devicetypes/smartthings/life360-user.src/life360-user.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 | * Life360-User 14 | * 15 | * Author: jeff 16 | * Date: 2013-08-15 17 | */ 18 | 19 | metadata { 20 | definition (name: "Life360 User", namespace: "smartthings", author: "SmartThings") { 21 | capability "Presence Sensor" 22 | capability "Sensor" 23 | } 24 | 25 | simulator { 26 | status "present": "presence: 1" 27 | status "not present": "presence: 0" 28 | } 29 | 30 | tiles { 31 | standardTile("presence", "device.presence", width: 2, height: 2, canChangeBackground: true) { 32 | state("present", labelIcon:"st.presence.tile.mobile-present", backgroundColor:"#53a7c0") 33 | state("not present", labelIcon:"st.presence.tile.mobile-not-present", backgroundColor:"#ffffff") 34 | } 35 | 36 | main "presence" 37 | details "presence" 38 | } 39 | } 40 | 41 | def generatePresenceEvent(boolean present) { 42 | log.debug "Here in generatePresenceEvent!" 43 | def value = formatValue(present) 44 | def linkText = getLinkText(device) 45 | def descriptionText = formatDescriptionText(linkText, present) 46 | def handlerName = getState(present) 47 | 48 | def results = [ 49 | name: "presence", 50 | value: value, 51 | unit: null, 52 | linkText: linkText, 53 | descriptionText: descriptionText, 54 | handlerName: handlerName 55 | ] 56 | log.debug "Generating Event: ${results}" 57 | sendEvent (results) 58 | } 59 | 60 | def setMemberId (String memberId) { 61 | log.debug "MemberId = ${memberId}" 62 | state.life360MemberId = memberId 63 | } 64 | 65 | def getMemberId () { 66 | 67 | log.debug "MemberId = ${state.life360MemberId}" 68 | 69 | return(state.life360MemberId) 70 | } 71 | 72 | private String formatValue(boolean present) { 73 | if (present) 74 | return "present" 75 | else 76 | return "not present" 77 | } 78 | 79 | private formatDescriptionText(String linkText, boolean present) { 80 | if (present) 81 | return "Life360 User $linkText has arrived" 82 | else 83 | return "Life360 User $linkText has left" 84 | } 85 | 86 | private getState(boolean present) { 87 | if (present) 88 | return "arrived" 89 | else 90 | return "left" 91 | } 92 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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/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/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/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/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: "0000,0003,0006", outClusters: "0019" 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 | 'zcl on-off on' 51 | } 52 | 53 | def off() { 54 | 'zcl on-off off' 55 | } 56 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /devicetypes/smartthings/testing/simulated-color-control.src/simulated-color-control.groovy: -------------------------------------------------------------------------------- 1 | metadata { 2 | definition (name: "Color Control Capability", namespace: "capabilities", author: "SmartThings") { 3 | capability "Color Control" 4 | } 5 | 6 | simulator { 7 | // TODO: define status and reply messages here 8 | } 9 | 10 | tiles { 11 | controlTile("rgbSelector", "device.color", "color", height: 3, width: 3, inactiveLabel: false) { 12 | state "color" 13 | } 14 | valueTile("saturation", "device.saturation", inactiveLabel: false, decoration: "flat") { 15 | state "saturation", label: 'Sat ${currentValue} ' 16 | } 17 | valueTile("hue", "device.hue", inactiveLabel: false, decoration: "flat") { 18 | state "hue", label: 'Hue ${currentValue} ' 19 | } 20 | main "rgbSelector" 21 | details(["rgbSelector", "saturation", "hue"]) 22 | } 23 | } 24 | 25 | // parse events into attributes 26 | def parse(String description) { 27 | log.debug "Parsing '${description}'" 28 | 29 | } 30 | 31 | def setSaturation(percent) { 32 | log.debug "Executing 'setSaturation'" 33 | sendEvent(name: "saturation", value: percent) 34 | } 35 | 36 | def setHue(percent) { 37 | log.debug "Executing 'setHue'" 38 | sendEvent(name: "hue", value: percent) 39 | } 40 | -------------------------------------------------------------------------------- /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 | 19 | command "open" 20 | command "close" 21 | } 22 | 23 | simulator { 24 | status "open": "contact:open" 25 | status "closed": "contact:closed" 26 | } 27 | 28 | tiles { 29 | standardTile("contact", "device.contact", width: 2, height: 2) { 30 | state("closed", label:'${name}', icon:"st.contact.contact.closed", backgroundColor:"#79b821", action: "open") 31 | state("open", label:'${name}', icon:"st.contact.contact.open", backgroundColor:"#ffa81e", action: "close") 32 | } 33 | main "contact" 34 | details "contact" 35 | } 36 | } 37 | 38 | def parse(String description) { 39 | def pair = description.split(":") 40 | createEvent(name: pair[0].trim(), value: pair[1].trim()) 41 | } 42 | 43 | def open() { 44 | log.trace "open()" 45 | sendEvent(name: "contact", value: "open") 46 | } 47 | 48 | def close() { 49 | log.trace "close()" 50 | sendEvent(name: "contact", value: "closed") 51 | } 52 | -------------------------------------------------------------------------------- /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 | } 19 | 20 | // Simulated lock 21 | tiles { 22 | standardTile("toggle", "device.lock", width: 2, height: 2) { 23 | state "unlocked", label:'unlocked', action:"lock.lock", icon:"st.locks.lock.unlocked", backgroundColor:"#ffffff" 24 | state "locked", label:'locked', action:"lock.unlock", icon:"st.locks.lock.locked", backgroundColor:"#79b821" 25 | } 26 | standardTile("lock", "device.lock", inactiveLabel: false, decoration: "flat") { 27 | state "default", label:'lock', action:"lock.lock", icon:"st.locks.lock.locked" 28 | } 29 | standardTile("unlock", "device.lock", inactiveLabel: false, decoration: "flat") { 30 | state "default", label:'unlock', action:"lock.unlock", icon:"st.locks.lock.unlocked" 31 | } 32 | 33 | main "toggle" 34 | details(["toggle", "lock", "unlock"]) 35 | } 36 | } 37 | 38 | def parse(String description) { 39 | log.trace "parse $description" 40 | def pair = description.split(":") 41 | createEvent(name: pair[0].trim(), value: pair[1].trim()) 42 | } 43 | 44 | def lock() { 45 | log.trace "lock()" 46 | sendEvent(name: "lock", value: "locked") 47 | } 48 | 49 | def unlock() { 50 | log.trace "unlock()" 51 | sendEvent(name: "lock", value: "unlocked") 52 | } 53 | -------------------------------------------------------------------------------- /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 | 19 | command "active" 20 | command "inactive" 21 | } 22 | 23 | simulator { 24 | status "active": "motion:active" 25 | status "inactive": "motion:inactive" 26 | } 27 | 28 | tiles { 29 | standardTile("motion", "device.motion", width: 2, height: 2) { 30 | state("inactive", label:'no motion', icon:"st.motion.motion.inactive", backgroundColor:"#ffffff", action: "active") 31 | state("active", label:'motion', icon:"st.motion.motion.active", backgroundColor:"#53a7c0", action: "inactive") 32 | } 33 | main "motion" 34 | details "motion" 35 | } 36 | } 37 | 38 | def parse(String description) { 39 | def pair = description.split(":") 40 | createEvent(name: pair[0].trim(), value: pair[1].trim()) 41 | } 42 | 43 | def active() { 44 | log.trace "active()" 45 | sendEvent(name: "motion", value: "active") 46 | } 47 | 48 | def inactive() { 49 | log.trace "inactive()" 50 | sendEvent(name: "motion", value: "inactive") 51 | } 52 | -------------------------------------------------------------------------------- /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 | 19 | command "arrived" 20 | command "departed" 21 | } 22 | 23 | simulator { 24 | status "present": "presence: present" 25 | status "not present": "presence: not present" 26 | } 27 | 28 | tiles { 29 | standardTile("presence", "device.presence", width: 2, height: 2, canChangeBackground: true) { 30 | state("not present", label:'not present', icon:"st.presence.tile.not-present", backgroundColor:"#ffffff", action:"arrived") 31 | state("present", label:'present', icon:"st.presence.tile.present", backgroundColor:"#53a7c0", action:"departed") 32 | } 33 | main "presence" 34 | details "presence" 35 | } 36 | } 37 | 38 | def parse(String description) { 39 | def pair = description.split(":") 40 | createEvent(name: pair[0].trim(), value: pair[1].trim()) 41 | } 42 | 43 | // handle commands 44 | def arrived() { 45 | log.trace "Executing 'arrived'" 46 | sendEvent(name: "presence", value: "present") 47 | } 48 | 49 | 50 | def departed() { 51 | log.trace "Executing 'arrived'" 52 | sendEvent(name: "presence", value: "not present") 53 | } 54 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | 20 | command "onPhysical" 21 | command "offPhysical" 22 | } 23 | 24 | tiles { 25 | standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true) { 26 | state "off", label: '${currentValue}', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff" 27 | state "on", label: '${currentValue}', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#79b821" 28 | } 29 | standardTile("on", "device.switch", decoration: "flat") { 30 | state "default", label: 'On', action: "onPhysical", backgroundColor: "#ffffff" 31 | } 32 | standardTile("off", "device.switch", decoration: "flat") { 33 | state "default", label: 'Off', action: "offPhysical", backgroundColor: "#ffffff" 34 | } 35 | main "switch" 36 | details(["switch","on","off"]) 37 | } 38 | } 39 | 40 | def parse(String description) { 41 | def pair = description.split(":") 42 | createEvent(name: pair[0].trim(), value: pair[1].trim()) 43 | } 44 | 45 | def on() { 46 | log.debug "$version on()" 47 | sendEvent(name: "switch", value: "on") 48 | } 49 | 50 | def off() { 51 | log.debug "$version off()" 52 | sendEvent(name: "switch", value: "off") 53 | } 54 | 55 | def onPhysical() { 56 | log.debug "$version onPhysical()" 57 | sendEvent(name: "switch", value: "on", type: "physical") 58 | } 59 | 60 | def offPhysical() { 61 | log.debug "$version offPhysical()" 62 | sendEvent(name: "switch", value: "off", type: "physical") 63 | } 64 | 65 | private getVersion() { 66 | "PUBLISHED" 67 | } 68 | -------------------------------------------------------------------------------- /devicetypes/smartthings/testing/simulated-temperature-sensor.src/simulated-temperature-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 Temperature Sensor", namespace: "smartthings/testing", author: "SmartThings") { 17 | capability "Temperature Measurement" 18 | capability "Switch Level" 19 | 20 | command "up" 21 | command "down" 22 | command "setTemperature", ["number"] 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 | standardTile("up", "device.temperature", inactiveLabel: false, decoration: "flat") { 42 | state "default", label:'up', action:"up" 43 | } 44 | standardTile("down", "device.temperature", inactiveLabel: false, decoration: "flat") { 45 | state "default", label:'down', action:"down" 46 | } 47 | main "temperature" 48 | details("temperature","up","down") 49 | } 50 | } 51 | 52 | // Parse incoming device messages to generate events 53 | def parse(String description) { 54 | def pair = description.split(":") 55 | createEvent(name: pair[0].trim(), value: pair[1].trim(), unit:"F") 56 | } 57 | 58 | def setLevel(value) { 59 | sendEvent(name:"temperature", value: value) 60 | } 61 | 62 | def up() { 63 | def ts = device.currentState("temperature") 64 | def value = ts ? ts.integerValue + 1 : 72 65 | sendEvent(name:"temperature", value: value) 66 | } 67 | 68 | def down() { 69 | def ts = device.currentState("temperature") 70 | def value = ts ? ts.integerValue - 1 : 72 71 | sendEvent(name:"temperature", value: value) 72 | } 73 | 74 | def setTemperature(value) { 75 | sendEvent(name:"temperature", value: value) 76 | } 77 | -------------------------------------------------------------------------------- /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 | 19 | command "wet" 20 | command "dry" 21 | } 22 | 23 | simulator { 24 | status "wet": "water:wet" 25 | status "dry": "water:dry" 26 | } 27 | 28 | tiles { 29 | standardTile("water", "device.water", width: 2, height: 2) { 30 | state "dry", icon:"st.alarm.water.dry", backgroundColor:"#ffffff", action: "wet" 31 | state "wet", icon:"st.alarm.water.wet", backgroundColor:"#53a7c0", action: "dry" 32 | } 33 | standardTile("wet", "device.water", inactiveLabel: false, decoration: "flat") { 34 | state "default", label:'Wet', action:"wet", icon: "st.alarm.water.wet" 35 | } 36 | standardTile("dry", "device.water", inactiveLabel: false, decoration: "flat") { 37 | state "default", label:'Dry', action:"dry", icon: "st.alarm.water.dry" 38 | } 39 | main "water" 40 | details(["water","wet","dry"]) 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 wet() { 50 | log.trace "wet()" 51 | sendEvent(name: "water", value: "wet") 52 | } 53 | 54 | def dry() { 55 | log.trace "dry()" 56 | sendEvent(name: "water", value: "dry") 57 | } 58 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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/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/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/superuser/switch-too.src/switch-too.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Switch Too 3 | * 4 | * Copyright 2015 Bob Florian 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: "Switch Too", author: "Bob Florian") { 18 | capability "Switch" 19 | } 20 | 21 | simulator { 22 | // TODO: define status and reply messages here 23 | } 24 | 25 | tiles { 26 | // TODO: define your main and details tiles here 27 | } 28 | } 29 | 30 | // parse events into attributes 31 | def parse(String description) { 32 | log.debug "Parsing '${description}'" 33 | // TODO: handle 'switch' attribute 34 | 35 | } 36 | 37 | // handle commands 38 | def on() { 39 | log.debug "Executing 'on'" 40 | // TODO: handle 'on' command 41 | } 42 | 43 | def off() { 44 | log.debug "Executing 'off'" 45 | // TODO: handle 'off' command 46 | } 47 | 48 | 49 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /smartapps/curb/curb-control.src/curb-control.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Curb Control 3 | * 4 | * Author: Curb 5 | */ 6 | 7 | definition( 8 | name: "Curb Control", 9 | namespace: "Curb", 10 | author: "Curb", 11 | description: "This SmartApp allows you to interact with the switches in your physical graph through Curb.", 12 | category: "Convenience", 13 | iconUrl: "http://energycurb.com/images/logo.png", 14 | iconX2Url: "http://energycurb.com/images/logo.png", 15 | oauth: [displayName: "SmartThings Curb Control", displayLink: "energycurb.com"] 16 | ) 17 | 18 | preferences { 19 | section("Allow Curb to Control These Things...") { 20 | input "switches", "capability.switch", title: "Which Switches?", multiple: true, required: false 21 | } 22 | } 23 | 24 | mappings { 25 | path("/") { 26 | action: [ 27 | GET: "index" 28 | ] 29 | } 30 | path("/switches") { 31 | action: [ 32 | GET: "listSwitches", 33 | PUT: "updateSwitches" 34 | ] 35 | } 36 | path("/switches/:id") { 37 | action: [ 38 | GET: "showSwitch", 39 | PUT: "updateSwitch" 40 | ] 41 | } 42 | } 43 | 44 | def installed() {} 45 | 46 | def updated() {} 47 | 48 | def index(){ 49 | [[url: "/switches"]] 50 | } 51 | 52 | def listSwitches() { 53 | switches.collect { device(it,"switch") } 54 | } 55 | void updateSwitches() { 56 | updateAll(switches) 57 | } 58 | def showSwitch() { 59 | show(switches, "switch") 60 | } 61 | void updateSwitch() { 62 | update(switches) 63 | } 64 | 65 | private void updateAll(devices) { 66 | def command = request.JSON?.command 67 | if (command) { 68 | devices."$command"() 69 | } 70 | } 71 | 72 | private void update(devices) { 73 | log.debug "update, request: ${request.JSON}, params: ${params}, devices: $devices.id" 74 | def command = request.JSON?.command 75 | if (command) { 76 | def device = devices.find { it.id == params.id } 77 | if (!device) { 78 | httpError(404, "Device not found") 79 | } else { 80 | device."$command"() 81 | } 82 | } 83 | } 84 | 85 | private show(devices, name) { 86 | def d = devices.find { it.id == params.id } 87 | if (!d) { 88 | httpError(404, "Device not found") 89 | } 90 | else { 91 | device(d, name) 92 | } 93 | } 94 | 95 | private device(it, name){ 96 | if(it) { 97 | def s = it.currentState(name) 98 | [id: it.id, label: it.displayName, name: it.displayName, state: s] 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /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 | subscribe(switch1, "switch.on", switchOnHandler) 29 | subscribe(switch1, "switch.off", switchOffHandler) 30 | } 31 | 32 | def updated() { 33 | unsubscribe() 34 | subscribe(contact1, "contact", contactHandler) 35 | subscribe(switch1, "switch.on", switchOnHandler) 36 | subscribe(switch1, "switch.off", switchOffHandler) 37 | } 38 | 39 | def contactHandler(evt) { 40 | log.debug "$evt.value" 41 | if (evt.value == "open") { 42 | state.wasOn = switch1.currentValue("switch") == "on" 43 | switch1.off() 44 | } 45 | 46 | if (evt.value == "closed") { 47 | if(state.wasOn)switch1.on() 48 | } 49 | } -------------------------------------------------------------------------------- /smartapps/erocm123/button-controller-enhanced-lighting.src/button-controller-enhanced-lighting-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/smartapps/erocm123/button-controller-enhanced-lighting.src/button-controller-enhanced-lighting-2x.png -------------------------------------------------------------------------------- /smartapps/erocm123/button-controller-enhanced-lighting.src/button-controller-enhanced-lighting-3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/smartapps/erocm123/button-controller-enhanced-lighting.src/button-controller-enhanced-lighting-3x.png -------------------------------------------------------------------------------- /smartapps/erocm123/button-controller-enhanced-lighting.src/button-controller-enhanced-lighting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/smartapps/erocm123/button-controller-enhanced-lighting.src/button-controller-enhanced-lighting.png -------------------------------------------------------------------------------- /smartapps/erocm123/device-monitor.src/device-monitor-icon-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/smartapps/erocm123/device-monitor.src/device-monitor-icon-2x.png -------------------------------------------------------------------------------- /smartapps/erocm123/device-monitor.src/device-monitor-icon-3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/smartapps/erocm123/device-monitor.src/device-monitor-icon-3x.png -------------------------------------------------------------------------------- /smartapps/erocm123/device-monitor.src/device-monitor-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/smartapps/erocm123/device-monitor.src/device-monitor-icon.png -------------------------------------------------------------------------------- /smartapps/erocm123/left-in-the-dark.src/left-in-the-dark-icon-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/smartapps/erocm123/left-in-the-dark.src/left-in-the-dark-icon-2x.png -------------------------------------------------------------------------------- /smartapps/erocm123/left-in-the-dark.src/left-in-the-dark-icon-3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/smartapps/erocm123/left-in-the-dark.src/left-in-the-dark-icon-3x.png -------------------------------------------------------------------------------- /smartapps/erocm123/left-in-the-dark.src/left-in-the-dark-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/smartapps/erocm123/left-in-the-dark.src/left-in-the-dark-icon.png -------------------------------------------------------------------------------- /smartapps/erocm123/meantemp/mean-temperature-sensor-manager.src/mean-temperature-sensor-manager.groovy: -------------------------------------------------------------------------------- 1 | definition( 2 | name: "Mean Temperature Sensor Manager", 3 | namespace: "erocm123/MeanTemp", 4 | author: "Eric Maycock", 5 | description: "Combine multiple temperature sensors into a single virtual sensor", 6 | category: "My Apps", 7 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png", 8 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png", 9 | iconX3Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png") 10 | 11 | 12 | preferences { 13 | page(name: "mainPage", title: "Temperature Sensors", install: true, uninstall: true,submitOnChange: true) { 14 | section { 15 | app(name: "meanTempSensor", appName: "Mean Temperature Sensor", namespace: "erocm123/MeanTemp", title: "Create New Sensor", multiple: true) 16 | } 17 | } 18 | } 19 | 20 | def installed() { 21 | log.debug "Installed with settings: ${settings}" 22 | initialize() 23 | } 24 | 25 | def updated() { 26 | log.debug "Updated with settings: ${settings}" 27 | unsubscribe() 28 | initialize() 29 | } 30 | 31 | def initialize() { 32 | log.debug "there are ${childApps.size()} child smartapps" 33 | childApps.each {child -> 34 | log.debug "child app: ${child.label}" 35 | } 36 | } -------------------------------------------------------------------------------- /smartapps/erocm123/smartlife-rgbw-light-connect.src/smartlife-rgbw-icon-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/smartapps/erocm123/smartlife-rgbw-light-connect.src/smartlife-rgbw-icon-2x.png -------------------------------------------------------------------------------- /smartapps/erocm123/smartlife-rgbw-light-connect.src/smartlife-rgbw-icon-3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/smartapps/erocm123/smartlife-rgbw-light-connect.src/smartlife-rgbw-icon-3x.png -------------------------------------------------------------------------------- /smartapps/erocm123/smartlife-rgbw-light-connect.src/smartlife-rgbw-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/smartapps/erocm123/smartlife-rgbw-light-connect.src/smartlife-rgbw-icon.png -------------------------------------------------------------------------------- /smartapps/erocm123/sonoff-connect.src/sonoff-connect-icon-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/smartapps/erocm123/sonoff-connect.src/sonoff-connect-icon-2x.png -------------------------------------------------------------------------------- /smartapps/erocm123/sonoff-connect.src/sonoff-connect-icon-3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/smartapps/erocm123/sonoff-connect.src/sonoff-connect-icon-3x.png -------------------------------------------------------------------------------- /smartapps/erocm123/sonoff-connect.src/sonoff-connect-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/smartapps/erocm123/sonoff-connect.src/sonoff-connect-icon.png -------------------------------------------------------------------------------- /smartapps/erocm123/virtual-device-sync.src/virtual-device-sync-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/smartapps/erocm123/virtual-device-sync.src/virtual-device-sync-2x.png -------------------------------------------------------------------------------- /smartapps/erocm123/virtual-device-sync.src/virtual-device-sync-3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/smartapps/erocm123/virtual-device-sync.src/virtual-device-sync-3x.png -------------------------------------------------------------------------------- /smartapps/erocm123/virtual-device-sync.src/virtual-device-sync.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erocm123/SmartThingsPublic/a0b32a7b3139e74eb6a52ede4b221102128cff8f/smartapps/erocm123/virtual-device-sync.src/virtual-device-sync.png -------------------------------------------------------------------------------- /smartapps/erocm123/z-waveat/README.md: -------------------------------------------------------------------------------- 1 | # Z-Wave Association Tool 2 | 3 | This is the future home of documentation on how this tool works. 4 | -------------------------------------------------------------------------------- /smartapps/erocm123/z-waveat/zwave-association-tool.src/zwave-association-tool.groovy: -------------------------------------------------------------------------------- 1 | definition( 2 | name: "Z-Wave Association Tool", 3 | namespace: "erocm123/Z-WaveAT", 4 | author: "Eric Maycock", 5 | description: "Create direct associations from one Z-Wave device to another", 6 | category: "My Apps", 7 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png", 8 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png", 9 | iconX3Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png") 10 | 11 | preferences { 12 | page(name: "mainPage", title: "Associations", install: true, uninstall: true,submitOnChange: true) { 13 | section { 14 | app(name: "association", appName: "Z-Wave Association", namespace: "erocm123/Z-WaveAT", title: "Create New Association", multiple: true) 15 | } 16 | section { 17 | paragraph "This tool allows you to create direct associations between multiple Z-Wave devices. In order for it to create the association, the source device handler needs to have support for this tool added to it. Some examples of handlers that have support are the Inovelli Plug handlers, Inovelli Dimmer & Switch handlers, and the Inovelli Door/Window Sensor handler. The destination does not need anything added to it's handler, but does need to be a Z-Wave device.\n\nFor more information on how this SmartApp works click the link below." 18 | href(name: "hrefNotRequired", 19 | title: "Z-Wave Association Tool on Github", 20 | required: false, 21 | style: "external", 22 | url: "https://github.com/erocm123/SmartThingsPublic/tree/master/smartapps/erocm123/z-waveat", 23 | description: "Tap to view information about this SmartApp") 24 | } 25 | } 26 | } 27 | 28 | def installed() { 29 | log.debug "Installed with settings: ${settings}" 30 | initialize() 31 | } 32 | 33 | def updated() { 34 | log.debug "Updated with settings: ${settings}" 35 | unsubscribe() 36 | initialize() 37 | } 38 | 39 | def initialize() { 40 | log.debug "there are ${childApps.size()} child smartapps" 41 | childApps.each {child -> 42 | log.debug "child app: ${child.label}" 43 | } 44 | } -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /smartapps/jls/my-light-toggle.src/my-light-toggle.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * My Light Toggle 3 | * 4 | * Copyright 2015 Jesse Silverberg 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: "My Light Toggle", 18 | namespace: "JLS", 19 | author: "Jesse Silverberg", 20 | description: "Toggle lights on/off with a motion sensor", 21 | category: "Convenience", 22 | iconUrl: "https://www.dropbox.com/s/6kxtd2v5reggonq/lightswitch.gif?raw=1", 23 | iconX2Url: "https://www.dropbox.com/s/6kxtd2v5reggonq/lightswitch.gif?raw=1", 24 | iconX3Url: "https://www.dropbox.com/s/6kxtd2v5reggonq/lightswitch.gif?raw=1") 25 | 26 | 27 | preferences { 28 | section("When this sensor detects motion...") { 29 | input "motionToggler", "capability.motionSensor", title: "Motion Here", required: true, multiple: false 30 | } 31 | 32 | section("Master switch for the toggle reference...") { 33 | input "masterToggle", "capability.switch", title: "Reference switch", required: true, multiple: false 34 | } 35 | 36 | section("Toggle lights...") { 37 | input "switchesToToggle", "capability.switch", title: "These go on/off", required: true, multiple: true 38 | } 39 | } 40 | 41 | def installed() { 42 | log.debug "Installed with settings: ${settings}" 43 | 44 | initialize() 45 | } 46 | 47 | def updated() { 48 | log.debug "Updated with settings: ${settings}" 49 | 50 | unsubscribe() 51 | initialize() 52 | } 53 | 54 | def initialize() { 55 | subscribe(motionToggler, "motion", toggleSwitches) 56 | } 57 | 58 | 59 | def toggleSwitches(evt) { 60 | log.debug "$evt.value" 61 | 62 | if (evt.value == "active" && masterToggle.currentSwitch == "off") { 63 | // for (thisSwitch in switchesToToggle) { 64 | // log.debug "$thisSwitch.label" 65 | // thisSwitch.on() 66 | switchesToToggle.on() 67 | masterToggle.on() 68 | } else if (evt.value == "active" && masterToggle.currentSwitch == "on") { 69 | // for (thisSwitch in switchesToToggle) { 70 | // log.debug "$thisSwitch.label" 71 | // thisSwitch.off() 72 | switchesToToggle.off() 73 | masterToggle.off() 74 | } 75 | 76 | } -------------------------------------------------------------------------------- /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/macstainless/lights-on-when-door-opens-after-sundown.src/lights-on-when-door-opens-after-sundown.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Lights On When Door Open After Sundown 4 | * 5 | * Based on "Turn It On When It Opens" by SmartThings 6 | * 7 | * Author: Aaron Crocco 8 | */ 9 | preferences { 10 | section("When the door opens..."){ 11 | input "contact1", "capability.contactSensor", title: "Where?" 12 | } 13 | section("Turn on these lights..."){ 14 | input "switches", "capability.switch", multiple: true 15 | } 16 | section("and change mode to...") { 17 | input "HomeAfterDarkMode", "mode", title: "Mode?" 18 | } 19 | } 20 | 21 | 22 | def installed() 23 | { 24 | subscribe(contact1, "contact.open", contactOpenHandler) 25 | } 26 | 27 | def updated() 28 | { 29 | unsubscribe() 30 | subscribe(contact1, "contact.open", contactOpenHandler) 31 | } 32 | 33 | def contactOpenHandler(evt) { 34 | log.debug "$evt.value: $evt, $settings" 35 | 36 | //Check current time to see if it's after sundown. 37 | def s = getSunriseAndSunset(zipCode: zipCode, sunriseOffset: sunriseOffset, sunsetOffset: sunsetOffset) 38 | def now = new Date() 39 | def setTime = s.sunset 40 | log.debug "Sunset is at $setTime. Current time is $now" 41 | 42 | 43 | if (setTime.before(now)) { //Executes only if it's after sundown. 44 | 45 | log.trace "Turning on switches: $switches" 46 | switches.on() 47 | log.trace "Changing house mode to $HomeAfterDarkMode" 48 | setLocationMode(HomeAfterDarkMode) 49 | sendPush("Welcome home! Changing mode to $HomeAfterDarkMode.") 50 | 51 | } 52 | } 53 | 54 | -------------------------------------------------------------------------------- /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 Monitor 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 the keyboard is used...") { 29 | input "accelerationSensor", "capability.accelerationSensor", title: "Which Sensor?" 30 | } 31 | section("Turn on/off a light...") { 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 | 51 | 52 | -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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/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/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/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/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/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 to $phone within the last $deltaSeconds seconds" 58 | } else { 59 | def msg = "${alarm.displayName} is wet!" 60 | log.debug "$alarm is wet, texting $phone" 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 | -------------------------------------------------------------------------------- /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/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: ($message) to contacts:${recipients?.size()}" 61 | sendNotificationToContacts(message, recipients) 62 | } 63 | else { 64 | 65 | log.debug "Texting reminder: ($message) to $phone1" 66 | sendSms(phone1, message) 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /smartapps/smartthings/hub-ip-notifier.src/hub-ip-notifier.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 | * Hub IP Notifier 14 | * 15 | * Author: luke 16 | * Date: 2014-01-28 17 | */ 18 | definition( 19 | name: "Hub IP Notifier", 20 | namespace: "smartthings", 21 | author: "SmartThings", 22 | description: "Listen for local IP changes when your hub registers.", 23 | category: "SmartThings Internal", 24 | iconUrl: "https://s3.amazonaws.com/smartapp-icons/MyApps/Cat-MyApps.png", 25 | iconX2Url: "https://s3.amazonaws.com/smartapp-icons/MyApps/Cat-MyApps@2x.png" 26 | ) 27 | 28 | preferences { 29 | page(name: "pageWithIp", title: "Hub IP Notifier", install: true) 30 | 31 | } 32 | 33 | def pageWithIp() { 34 | def currentIp = state.localip ?: 'unknown' 35 | def registerDate = state.lastRegister ?: null 36 | dynamicPage(name: "pageWithIp", title: "Hub IP Notifier", install: true, uninstall: true) { 37 | section("When Hub Comes Online") { 38 | input "hub", "hub", title: "Select a hub" 39 | } 40 | section("Last Registration Details") { 41 | if(hub && registerDate) { 42 | paragraph """Your hub last registered with IP: 43 | $currentIp 44 | on: 45 | $registerDate""" 46 | } else if (hub && !registerDate) { 47 | paragraph "Your hub has not (re)registered since you installed this app" 48 | } else { 49 | paragraph "Check back here after installing to see the current IP of your hub" 50 | } 51 | } 52 | } 53 | } 54 | 55 | def installed() { 56 | log.debug "Installed with settings: ${settings}" 57 | 58 | initialize() 59 | } 60 | 61 | def updated() { 62 | log.debug "Updated with settings: ${settings}" 63 | 64 | unsubscribe() 65 | initialize() 66 | } 67 | 68 | def initialize() { 69 | subscribe(hub, "hubInfo", registrationHandler, [filterEvents: false]) 70 | } 71 | 72 | def registrationHandler(evt) { 73 | def hubInfo = evt.description.split(',').inject([:]) { map, token -> 74 | token.split(':').with { map[it[0].trim()] = it[1] } 75 | map 76 | } 77 | state.localip = hubInfo.localip 78 | state.lastRegister = new Date() 79 | sendNotificationEvent("${hub.name} registered in prod with IP: ${hubInfo.localip}") 80 | } 81 | -------------------------------------------------------------------------------- /smartapps/smartthings/it-moved.src/it-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 | * It Moved 14 | * 15 | * Author: SmartThings 16 | */ 17 | definition( 18 | name: "It Moved", 19 | namespace: "smartthings", 20 | author: "SmartThings", 21 | description: "Send a text when movement is detected", 22 | category: "Fun & Social", 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 movement is detected...") { 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 $phone1 within the last $deltaSeconds seconds" 57 | } else { 58 | if (location.contactBookEnabled) { 59 | log.debug "$accelerationSensor has moved, texting contacts: ${recipients?.size()}" 60 | sendNotificationToContacts("${accelerationSensor.label ?: accelerationSensor.name} moved", recipients) 61 | } 62 | else { 63 | log.debug "$accelerationSensor has moved, texting $phone1" 64 | sendSms(phone1, "${accelerationSensor.label ?: accelerationSensor.name} moved") 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /smartapps/smartthings/presence-change-text.src/presence-change-text.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 Text 14 | * 15 | * Author: SmartThings 16 | */ 17 | definition( 18 | name: "Presence Change Text", 19 | namespace: "smartthings", 20 | author: "SmartThings", 21 | description: "Send me a text message when my presence status changes.", 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 | section("Send a text message to...") { 32 | input("recipients", "contact", title: "Send notifications to") { 33 | input "phone1", "phone", title: "Phone number?" 34 | } 35 | } 36 | } 37 | 38 | 39 | def installed() { 40 | subscribe(presence, "presence", presenceHandler) 41 | } 42 | 43 | def updated() { 44 | unsubscribe() 45 | subscribe(presence, "presence", presenceHandler) 46 | } 47 | 48 | def presenceHandler(evt) { 49 | if (evt.value == "present") { 50 | log.debug "${presence.label ?: presence.name} has arrived at the ${location}" 51 | 52 | if (location.contactBookEnabled) { 53 | sendNotificationToContacts("${presence.label ?: presence.name} has arrived at the ${location}", recipients) 54 | } 55 | else { 56 | sendSms(phone1, "${presence.label ?: presence.name} has arrived at the ${location}") 57 | } 58 | } else if (evt.value == "not present") { 59 | log.debug "${presence.label ?: presence.name} has left the ${location}" 60 | 61 | if (location.contactBookEnabled) { 62 | sendNotificationToContacts("${presence.label ?: presence.name} has left the ${location}", recipients) 63 | } 64 | else { 65 | sendSms(phone1, "${presence.label ?: presence.name} has left the ${location}") 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /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/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, texting $phone1" 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/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 $phone1 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 $phone1" 63 | sendSms(phone1, "Gun case has moved!") 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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/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 | --------------------------------------------------------------------------------