URI Switch

The Unofficial SmartThings Blog
Jump to: navigation, search

Product: URI Switch

Type: Device Handler

Device Type Author: SmartThings/guerent/surge919

Summary

URI Switch is a Device Handler that when attached to a Virtual Switch, kicks off a URI (External or Internal) when an On/Off command is sent


Installation

Create the new Device Handler

Copy the contents from:

   https://raw.githubusercontent.com/tguerena/SmartThings/master/devicetypes/tguerena/uriswitch.src/uriswitch.groovy


To here: Click the From Code tab

   https://graph.api.smartthings.com/ide/device/create#from-code

Click Create

Save

Publish: For Me

Edit your Virtual Device and add this as the Type

Preferences

External calls triggered with On and Off commands

External On URI --- ie: http://www.externalaccess.com/turn_lightOn

External Off URI --- ie: http://www.externalaccess.com/turn_lightOff

Internal calls triggered with On and Off commands

Internal IP --- 192.168.1.1

Internal Port (if not 80)

Internal On Path (/blah?q=this) --- /api/HomeAutomation.X10/o1/Control.Off

Internal Off Path (/blah?q=this) --- /api/HomeAutomation.X10/o1/Control.On

Screenshots

URI switch main screen.png

URI switch settings a.png

URI switch settings b.png

Link to Discussion

https://community.smartthings.com/t/beta-release-uri-switch-device-handler-for-controlling-items-via-http-calls/