Send HTTP request using a button

Hi!
I’m new here after having to switch away from NetIO. There, it was dead simple to set up a button that sends an HTTP request. I understand that HTTP Client has been deprecated and that I should be using the plugin architecture.
I’ve tried the HTTPExample, but am stuck (I think) on the device binding when attributing the ‘clicked’ trigger. I’ve watched several tutorials and looked at templates, and have tried some, but I still don’t get how to do this. Does anyone have a .hrp to share? A tutorial video?
Thanks!

I can upload my hrp if allowed.

Attached is an example showing how to send HTTP requests.
HTTPExample.hrp (7.9 KB)

This uses the sample code from here.

Here is another example of creating buttons:

In the Bills example Switch capability is used so values “On” and “Off” need to be checked. By using custom capability any value can be used.

1 Like

Many thanks, Bill, for the prompt reply, I got my hrp working thanks to you. I’m now trying to address other issues, should rather be making a new post I guess.

Thanks VPow, the thread is insightful and the custom capability very helpful.

Hi Moarteen,

Welcome to the Home Remote. I used NetIO for a little while when moving from iRule. It was very limited so im sure you`ll enjoy the huge opportunities THR has :slight_smile:

I didnt think irule could be replaced… I was wrong.

Hi John,
I have no doubt that THR is very powerful. Just have to adapt to the learning curve :wink:

Indeed it is, but while it’s lacking in documentation, this forum is very active and Bill answers most questions and provides examples. Start with the videos if you haven’t already and go from there.

If your thinking about plug-ins you need a little JavaScript which I learned from the freenodecamp videos on YouTube.

Hello guys,
I also come from iRule and NetIO and I am fed up with cloud based software.
John is still known to me from the iRule forum and if I remember correctly he was very active there.
My name is Kalle and I am trying to recreate my NetIO configuration with TheHomeRemote.
TheHomeRemote looks for me first more extensive than iRule or NetIO. It has infinite possibilities and I’m trying to find a start.
I use my own device for sending IR and RF commands, which I built myself based on an ESP chip.
The codes are sent with simple HTTP requests. Here is an example to turn on a RF switch:
http://192.168.68.208/sendRF?code=4117&bits=24&n=1

192.168.68.208 is my ESP device
/sendRF?code=4117&bits=24&n=1 is the RF code to switch on.
You can also send IR codes in iTach / Pronto and IR- Raw format or as short HEX codes - so many possibilities.

This works so far with the HTTP example plugin above.
But unfortunately I am not a programmer, but I would like to know how to define a device in TheHomeRemote (only with the IP-address), so that I can execute commands with the created buttons.
I hope I have described my problem reasonably well and would be happy if someone could give me an example.

I think once I have a start I will find my way around, but all beginnings are hard.

Kalle

Attached is another example I tailored for your use that should be a little easier to configure. All you need to do is update the commands variable to include all of your requests. I’ve configured your PowerOn command so that should work. You can fill in the rest.

  • The 1st column is the command name. This can be whatever you wish to call it.
  • The 2nd column is the URL minus the http://192.168.68.208.

Here is the project:
Netio.hrp (105.0 KB)

Here is the plugin separately in case you wish to import it into an existing project
netio.plugin (1.3 KB)

Hi Bill,
big thanks for the quick help.

Kalle