Need help with a send hub command

I have a send hub command that send out an IR command to raise and lower my shades and would like to create a button that would send that command. Any ideas? The goal is to add it to my Web Dashboard.

Thanks

Can you explain a little bit how it’s working right now? Is the IR blaster a device on SmartThings or is if more like a command sent from ST to the IR setup?

My initial thought would be to add a virtual momentary push button tile in ST. Then write a simple mobile app that when that button is pushed, send the command.

I am using global cache’s itach to perform the IR blast and ST as the timer. I had to get the IR commands using some globe cache’s utility.

That is ideally what I want is a tile that would perform the certain send hub command and have the ability to add it to a web dashboard.

Okay, so the “send hub” command… what is that? Is that like a http request?

so you define your network and your ir command then use the following

sendHubCommand(new physicalgraph.device.HubAction("""$theCom\r\n""", physicalgraph.device.Protocol.LAN, “0A000114:1386”))

Okay, that’s the command that would appear in a SmartApp? If so, then I’d just create a virtual momentary push button tile (do this in the IDE -> My Devices -> New Device (upper right hand side)).

Then we just need a simple SmartApp that when it sees this device turn on, it sends the command you listed above:

preferences {
	section("When this switch is turned on, send the command.") {
		input "trigger", "capability.switch", title: "Which switch?", required: true
        }
}

def installed() {
	log.debug "Installed with settings: ${settings}"
   	initialize()
}

def updated() {
	log.debug "Updated with settings: ${settings}"
	unsubscribe()
	initialize()
}

def initialize() {
	subscribe(trigger, "switch.on", switchOnHandler)
}

def switchOnHandler(evt) {
	sendHubCommand(new physicalgraph.device.HubAction("""$theCom\r\n""", physicalgraph.device.Protocol.LAN, "0A000114:1386"))
}

Thanks for all the help.

I am getting an error in the app itself, I keep getting unexpected error.

I created a new device with switch capability and then created a new smart app with the code you provided.

Not sure what to try.

preferences {
section(“When this switch is turned on, send the command.”) {
input “trigger”, “capability.switch”, title: “Which switch?”, required: true
}
}

def installed() {
log.debug "Installed with settings: ${settings}"
initialize()
}

def updated() {
log.debug "Updated with settings: ${settings}"
unsubscribe()
initialize()
}

def initialize() {
subscribe(trigger, “switch.on”, switchOnHandler)
}

def switchOnHandler(evt) {
def deviceNetworkId = “0A000114:1386"
def theCom = “sendir,1:2,1,38109,1,1,20,18,20,18,20,18,20,18,20,18,20,18,20,18,20,18,20,18,20,18,20,685,6,280,6,185,6,185,6,185,6,185,6,185,6,185,6,185,6,185,6,185,6,280,6,3810\r"
sendHubCommand(new physicalgraph.device.HubAction(””"$theCom\r\n""", physicalgraph.device.Protocol.LAN, “0A000114:1386”))

}

I figured it out, had the wrong device type.

thanks again