Simple way to make http GET request?

Hello! Newbie here who just found Hubitat. I am trying to get a Hubitat device event to hit a local URL. What I actually want is to get data into MQTT but I'm still new to this and the docker bridge thing is a little above my comfort level just yet. Seems there's no native MQTT happening but hopefully a simple http GET is possible somehow. The maker API seems to only accept requests (not make them) so that's probably out.

The purpose of this is to control other devices with button presses and motion events. All I can find in the apps right now is the ability to query device status with the maker API, but I really want the opposite. I want a button event to trigger a URL call.

Is it possible to have Hubitat call a URL when a button event is triggered? I figured maybe a virtual device or something but I can't find anything in there that looks right. Any tips are welcome! Hopefully there's green pastures ahead :slight_smile:

I use this hhtp switch for many things.
Sends one for on, and off.

2 Likes

@Royski That is a very clean way to do it!

Also you can easily issue a HTTP Get from within Rule Machine which can be used in simple or complex rules. This is built in and does not require anything additional.

Typically this is accomplished by making a virtual switch. Create a device on the devices screen and then set the type to "Virtual Switch" then you can use this switch in rules when it is turned on/off, etc.

1 Like

You sir are a wonderful person. Thank you! Deep inside I figured this was possible, but... err it just seemed so basic. So I just kept looking for a simple little event option or whatever to toss in a URL and get it done. Apparently it requires a little DIY driver but it'll do the trick! Thank you again!

1 Like

Oh this functionality also may hide in Rule Machine? I'll have to explore that some more. Thanks for the tip @jrfarrar !

example of a rule to do this

2 Likes

There is native MQTT (added very recently) if you wanted to use that instead :slight_smile:

1 Like

This just keeps getting better!! Although it sounds like I'll need to get in a little deeper for this one, but that's okay (eventually). I'm going to explore this native MQTT idea more. I wish there was some way to accept more than 1 solution as you've all provided me with very helpful ways of going about it.

Thank you!

1 Like