No Joy From My First SmartApp

Hey all,

Seems pretty simple, but when I install it, and then tap “Configure SmartApp”, the SmartThings app immediately crashes (Nexus 7 / Android 4.4.2). Any ideas what I may have done wrong:

    name: "Server Command Button",
    namespace: "smrtthings",
    author: "Scottin Pollock",
    description: "Send a server command when app is touched or activated",
    category: "My Apps",
    iconUrl: "",
    iconX2Url: ""

preferences {
	section("When I touch the app, Send to server...") {
		input "server", "string", title: "Server IP", description: "Your HTTP Server IP", required: true
		input "command", "string", title: "Parameters", description: "Command to Send", required: true

def installed()
	subscribe(app, appTouch)

def updated()
	subscribe(app, appTouch)

def appTouch(evt) {
	log.debug "appTouch: $evt"

def sendHttp() {
def ip = "${settings.server}:8080"
def deviceNetworkId = "100012"
sendHubCommand(new physicalgraph.device.HubAction("""GET /?${settings.command} HTTP/1.1\r\nHOST: $ip\r\n\r\n""", physicalgraph.device.Protocol.LAN, "${deviceNetworkId}"))

@Dianoga, @bflorian, @rappleg, @juano2310, @imbrian, @megapixel, @wackware any of you guys have some advice for a first time SmartApp author, here?

Unfortunately, I haven’t done anything with hub commands. Sorry.

Looks like you need to make deviceNetworkId equal the IP address of the device, and i think HOST needs to be the Hub IP.

try changing the input type from string to text



Thank you for this! I would have never discovered this on my own.

@scottinpollock I’m just more surprised I was right :horse: