RM HTTP Request

I've been looking a round for a while now, but cant seem to find what I am looking for.

I am trying to pass off device information like you do when sending a text message, but cant seem to figure it out.

Any advice?

x.x.x.x/hubitat/zwebhook.php?device=%device%&devicestatus=%value%&time=5

I'm not sure what you are asking but my guess is the Maker Api app will do what you need. Install and try it. If that's not what you need post more details as to what you are trying to accomplish with as many specifics as you are comfortable sharing.

I want to use the send http request to send a request to a php page and then send me an email/text. I have the php stuff running on a raspberry pi and working.

I'm just trying to figure out how to send variables to the http request string then send it to the php page.

I want to bypass the 10 text max with my own solution. (I am emailing to cell phone number)

The image shows "Send or speak a message" i want to use the %device%

I don't believe the device and value variables are available to the http request action. @bravenel can confirm or deny this.

The RM docs seems to say this should be available. There is no mention of whether they need to be delimited or escaped in some fashion.

"Send http request

Sends asyncGET to URL; allows %device% and/or %value% in URL for last event device and/or value"

Yep...I didn't realize all this was documented now. @mitchell.kelly93 are you able to capture what is being received by the rpi server?

You should probably consider using the pushover driver to get around the 10 SMS limit. It's an awesome notification app that is very customizable. A lot of the community have been using this for some time.

See the post below for setup details. The app would need to be purchased but it is well worth the cost. Also, the driver is now built in to HE so you do NOT need to install the code linked to in the post. The HE driver is exactly the same in terms of features.

1 Like

Probably, I'll have to see what the rpi is getting.

Thank you @stephack for the recommendation. I'll look at that too!

Pushover is fantastic if you're just wanting some kind of notification on your phone. You can create different pushover devices that send messages to different groups of phones with different priorities, mix and match. Couple bucks to buy it initially but the flexibility makes it well worth it IMO.

You can also use any of the global variables in the HTTP action as well. You just have to put the name inside of curly brackets. For example: {variable}

1 Like

That's the detail I didn't know. That detail should be added to the documentation. Thanks!

2 Likes

Just an update. The http request is working. I think rebooted the hub worked, sample url below. I also bought the pushover app, pretty neat suff.

This one is for a door being open longer than 5 minutes.

192.168.1.250/hubitat/zwebhook.php?device=%device%&devicestatus=%value%&time=longer+than+5+minutes

On the php page I have variables set to pick apart after the '?'

Thank you all again for your help.

2 Likes

Maybe you can help me with a post request. (@bravenel)

always struggling with my venstar thermostat...
I discovered that I can send a url post with RM

The venstar api tell me this:
https://developer.venstar.com/restcalls.html

I created a RM4 (button pushed) to increase the value of my temperature setting:
but sadly, no results (I don't have screenlock enabled).
I can http access the thermostat to obtain info.
Any idea ?

Pretty sure you want JSON encoding, and wrap your body text in curly braces.

Hmmm, unfortunately, no positive results. with or without braces, Json or form encoded.
And of course, no replies from Venstar :frowning_face:

I think you need to do some debugging with an HTTP tool. Try Postman or ptsv2.com.

I am at a total loss and quite frustrated. I fully admit that I do not understand most of what I am trying to do. I have read.....read....read and tried every possible example I can devise.
I want to send this text : EVENT C[1].Z[5]!ZoneOn to this local address : 192.168.0.39:9621
Per the device instructions, All RIO commands must be terminated with a (0x0D hex).

I can put the above text into Putty with the above IP address and port, using RAW, and it works perfectly.
I have been trying to make my own actions and am monitoring the above IP with Wireshark. My device needs TCP/IP, not UDP. Every action that I have written seems to be sending the command with UDP (at least per Wireshark), which does not work.

How to I put this in RM as an action?

It sounds to me like your device is not using http, and thus RM is probably not going to be able help in this situation (at least not without the assistance of a device driver that knows how to send a properly formatted raw TCP packet.)

https://docs.hubitat.com/index.php?title=Raw_Socket_Interface

Pardon my ignorance, but if my device is not using http, what could it be using? And why would Putty work?

"The RIO Command Set is available as ASCII text via IP (using port 9621) and RS232 interfaces."

PuTTY does not send http formatted packets. You mentioned you used the RAW mode of PuTTY, which is just creating a TCP socket connection on the specific IP address and Port of your network device, and then transmitting the exact string you specify.

http has a lot more overhead which is not needed in this situation. Unless your device supports a more modern RESTful API (which is http-based), you need to use the Raw Socket Interface I linked above.

Hmmm, a quick Google search turns up a similar question and response... :wink:

Thanks for the assist. Now to read through the Raw Socket information.

Yes, orangebucket responded to my post. Great guy, super smart. And his response went right over my head. :smile:

1 Like