POST url


#1

Is there a way to send a POST URL from/in HE ?


#2

Here is one way that I created a while ago...

Ignore the stuff about the Logitech Harmony Hub. Just focus on the http switch driver.


#3

Nice... I just need a simple POST...

Swicth On sends -> http://192.168.0.43/relay/0?turn=on
Switch Off sends -> http://192.168.0.43/relay/0?turn=off

It's a shelly 1 relay if you have heard of them.


#4

You should be able to easily modify the driver to achieve your goals. I believe some other community members may have also done the same.


#5

Perhaps a simpler driver to modify is an example from Hubitat itself.

Just change the Get to a Post and you should be in good shape.


#6

def params = [
uri: "http://" + ipAddress + "/relay/0?turn=on"
]

  try {
  	httpPost(params){response ->
  	}
  } catch (Exception e) {
  	log.error "${e}"
  }

#7

LOL I just ported a shelly device from ST


#8

Thanks @ogiewon and @ritchierich !