Can't figure out hub to device over http


I need help trying to get a devicetype to make a call to a local http server. Using an Arduino Nano and the cc3000 wifi breakout, I automated my blinds. I want to use the smartthing tiles to control them using the slider control. I have tried to use HTTPGet, HubAction and I cannot get a call to work.

I have in the past created a device type for my dlink camera, but I opened up a port on my firewall to get that to work. I can definitely do that, but I thought that I could do a hub to lan device call.

I used these posts to try to make the connection:

I am not using the SmartShield with my Arduino. Any help is appreciated.
Thanks in advance

The local hubaction works fine - you should be using an ip address on your local network for it to work. Maybe post a code snippit of the code that’s not working?

Sorry, I had tried so many options that I didn’t keep track of. Here is the last bit that I tried from someone elses post.
def on()

def send()
def host = ""
def hosthex = "C0A801EA"
def porthex = "0050"
def deviceNetworkId = “$hosthex:$porthex”

log.debug "The device id configured is: $device.deviceNetworkId"

def headers = [:] 
headers.put("HOST", "")

log.debug "The Header is $headers"

def method = "GET"

log.debug "The method is $method"

try {
def hubAction = new physicalgraph.device.HubAction(
	method: method,
	path: "/",
	headers: headers
hubAction.options = [outputMsgToS3:true]
log.debug hubAction
catch (Exception e) {
	log.debug "Hit Exception $e on $hubAction"


You should give the docs another read here

Off the top of my head I see:
HOST isn’t using the HEX values for ip address, nor is it including the port. That’s likely the first problem.

Also, hubaction isn’t executed when you put it on a line by itself, it’s executed “when it’s returned” from a function. So you should just be returning hubAction, no need to wrap it in a try/catch (it’s not going to throw anything…)

You need to look for the response inside your parse() method. Again, the doc page above is pretty reasonable .

Thanks John. It was the hex address that was missing
def myCommand() {
def result = new physicalgraph.device.HubAction(
method: “GET”,
path: “/?servo=1&degree=90”,
headers: [
HOST: “C0A801EA:0050”
log.debug (result)

return result


1 Like

How do you convert IP to hex address?

Did you convert e.g 192168001005 to hex for host ip

I cheated and used this website:

On this page there is some sample code to do the same thing: