# \[OBSOLETE\] Virtual HTTP Switch/Button Creator

**URL:** <https://community.smartthings.com/t/obsolete-virtual-http-switch-button-creator/54383>\
**Category:** Community Created SmartApps\
**Tags:** dth\_virtual, smartapp\_misc\
**Created:** [August 6, 2016, 11:52am UTC](https://community.smartthings.com/t/obsolete-virtual-http-switch-button-creator/54383 "2016-08-06T11:52:41Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![CSC](https://avatars.discourse-cdn.com/v4/letter/c/f1d935/32.png) [@CSC](https://community.smartthings.com/u/CSC)\
**Post date:** [August 6, 2016, 11:52am UTC](https://community.smartthings.com/t/obsolete-virtual-http-switch-button-creator/54383/1 "2016-08-06T11:52:41Z")

</div>

As I need to create multiple virtual switch manually for my DIY universal IR project & link them to SmartThings & Echo.

I decided to follow the earlier examples below & come out with a version of HTTP Switch Creator.  
tguerena and surge919 - URI Switch  
Eric Roberts (baldeagle072) - Virtual switch creator  
JZ - TVDevice

You need to install both device handler & smart app. Once install, you can create virtual http switch/button on the fly 😉

HTTP Button handler (v1.1 - corrected the button behavior and more like momentary switch):

> <https://github.com/chancsc/SmartThings-SC/blob/master/IR-Remote/device-handler/HTTP_Button.groovy>

HTTP Button Creator:

> <https://github.com/chancsc/SmartThings-SC/blob/master/IR-Remote/smartapps/HTTP_Button_Creator.groovy>

---

<div class="post-metadata">

**Author:** ![bridaus](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/bridaus/32/94511_2.png) [@bridaus](https://community.smartthings.com/u/bridaus)\
**Post date:** [August 6, 2016, 12:49pm UTC](https://community.smartthings.com/t/obsolete-virtual-http-switch-button-creator/54383/2 "2016-08-06T12:49:00Z")

</div>

Looks like it uses hubaction, so I’m guessing this works locally and not through cloud? Which is pretty awesome if so.

---

<div class="post-metadata">

**Author:** ![CSC](https://avatars.discourse-cdn.com/v4/letter/c/f1d935/32.png) [@CSC](https://community.smartthings.com/u/CSC)\
**Post date:** [August 6, 2016, 1:51pm UTC](https://community.smartthings.com/t/obsolete-virtual-http-switch-button-creator/54383/3 "2016-08-06T13:51:14Z")

</div>

Yes, for local devices, like the Nodemcu, Rasp Pi & LAN devices with http endpoint.

It also work with cloud IP.

---

<div class="post-metadata">

**Author:** ![CSC](https://avatars.discourse-cdn.com/v4/letter/c/f1d935/32.png) [@CSC](https://community.smartthings.com/u/CSC)\
**Post date:** [August 18, 2016, 1:40pm UTC](https://community.smartthings.com/t/obsolete-virtual-http-switch-button-creator/54383/4 "2016-08-18T13:40:45Z")

</div>

Updated to make it a button instead of a switch, to better represent the state status of http device when sending IR.

---

<div class="post-metadata">

**Author:** ![foggy](https://avatars.discourse-cdn.com/v4/letter/f/f17d59/32.png) [@foggy](https://community.smartthings.com/u/foggy)\
**Post date:** [October 8, 2016, 4:47pm UTC](https://community.smartthings.com/t/obsolete-virtual-http-switch-button-creator/54383/5 "2016-10-08T16:47:26Z")

</div>

Thank you for this. Is it / would it be possible to have multiple http calls with small waits in between linked to one button?

Best wishes.

---

<div class="post-metadata">

**Author:** ![Mark\_deVane](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@Mark\_deVane](https://community.smartthings.com/u/Mark_deVane)\
**Post date:** [November 18, 2016, 4:37am UTC](https://community.smartthings.com/t/obsolete-virtual-http-switch-button-creator/54383/6 "2016-11-18T04:37:10Z")

</div>

So… I have been spending way too much time trying to get Virtual URI Switch working, and I stumbled upon this SmartApp and decided to give it a try.

Unfortunately, the results are the same – your app does not appear to work for me either. What is weird is that when I send a POST command via Postman (Mac app), the command works like a champ and devices turn on and off appropriately, and more importantly, thru Wireshark, I can see all the IP/HTTP traffic to and from my IP device and the REST client. All is good.

But neither your app and URI Virtual Switch will work, and more importantly I see absolutely no IP/HTTP traffic in Wireshark. Digging into forum, I found several threads that imply that ST is blacklisting local devices and stopping all non-whitelisted IP traffic. My tests tend to agree with those comments, so I am rapidly coming to the conclusion that I will not be able to control my IP devices with ST.

Any thoughts from your end why Wireshark sees no traffic on the LAN? In your app’s case, more work would need to be done for it to work, since I have no way to include the body payload command currently, but I still would expect to see traffic, even if that command is invalid or not structured properly. I am confused on this one.

---

<div class="post-metadata">

**Author:** ![JDRoberts](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/jdroberts/32/56577_2.png) [@JDRoberts](https://community.smartthings.com/u/JDRoberts)\
**Post date:** [November 18, 2016, 4:55am UTC](https://community.smartthings.com/t/obsolete-virtual-http-switch-button-creator/54383/7 "2016-11-18T04:55:46Z")

</div>

I would ask your question in the developer section of the forum. People there should know the most about it.

[https://community.smartthings.com/c/developers/writing-device-types](https://community.smartthings.com/c/developers/writing-device-types)

---

<div class="post-metadata">

**Author:** ![CSC](https://avatars.discourse-cdn.com/v4/letter/c/f1d935/32.png) [@CSC](https://community.smartthings.com/u/CSC)\
**Post date:** [November 18, 2016, 10:39am UTC](https://community.smartthings.com/t/obsolete-virtual-http-switch-button-creator/54383/8 "2016-11-18T10:39:58Z")

</div>

Is your sever on local network and in the same network as Smartthings hub?

---

<div class="post-metadata">

**Author:** ![Mark\_deVane](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@Mark\_deVane](https://community.smartthings.com/u/Mark_deVane)\
**Post date:** [November 18, 2016, 1:13pm UTC](https://community.smartthings.com/t/obsolete-virtual-http-switch-button-creator/54383/9 "2016-11-18T13:13:41Z")

</div>

Yes - that’s what so weird. I am struggling to understand how you and others are communicating between your ST hubs and other devices internal to the lan segment. If so, how/why is there no IP traffic emanating from the ST hub using either SmartApp?

But to confirm, you are having no problem with you app working and communicating with non-registered devices. Is that correct? If so, then I have a different issue I need to run down.

Thanks for your response.

---

<div class="post-metadata">

**Author:** ![CSC](https://avatars.discourse-cdn.com/v4/letter/c/f1d935/32.png) [@CSC](https://community.smartthings.com/u/CSC)\
**Post date:** [November 18, 2016, 1:40pm UTC](https://community.smartthings.com/t/obsolete-virtual-http-switch-button-creator/54383/10 "2016-11-18T13:40:23Z")

</div>

Just tested by pressing my virtual button to turn on my tv via nodemcu 😉

Take noted that I am using GET command and never tested the POST

---

<div class="post-metadata">

**Author:** ![Mark\_deVane](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@Mark\_deVane](https://community.smartthings.com/u/Mark_deVane)\
**Post date:** [November 18, 2016, 7:11pm UTC](https://community.smartthings.com/t/obsolete-virtual-http-switch-button-creator/54383/11 "2016-11-18T19:11:48Z")

</div>

Thanks for the feedback. the fact that it works, gives me some comfort that it is possible to get this working. Unfortunately the UPB gateway I use only supports HTTP/POST and direct IP packets, not GET, so that is making the integration a little more difficult. Both you and Troy have operational GET solutions, but no love for POST in anything of the apps/device handlers that I have found so far.

I am not a developer, so I will ask you - how difficult would it be to add code to support BODY key-pairs, which are used by POST command?

I am also looking into a gateway from a different manufacturer, but no word from their developers re: API details. At this point, though, I am stumped unless you can think of anything else.

---

<div class="post-metadata">

**Author:** ![PaulChampagne](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/paulchampagne/32/53953_2.png) [@PaulChampagne](https://community.smartthings.com/u/PaulChampagne)\
**Post date:** [December 11, 2016, 5:46pm UTC](https://community.smartthings.com/t/obsolete-virtual-http-switch-button-creator/54383/12 "2016-12-11T17:46:57Z")

</div>

Thank you for this CSC.

It works well for me.

Any chance this could be expanded to create a dimmer?

I saw your posts in the automated blind topic and while this works really well to open/close the blinds, it would be even better to be able to stop them at any point in between.

---

<div class="post-metadata">

**Author:** ![CSC](https://avatars.discourse-cdn.com/v4/letter/c/f1d935/32.png) [@CSC](https://community.smartthings.com/u/CSC)\
**Post date:** [December 11, 2016, 11:54pm UTC](https://community.smartthings.com/t/obsolete-virtual-http-switch-button-creator/54383/13 "2016-12-11T23:54:08Z")

</div>

> [@Mark\_deVane](#):
>
> how difficult would it be to add code to support BODY key-pairs, which are used by POST command?

Let me find a time to test out the post, it should work. If you have a local web server, try to post to it and and check the http header to see if it receive any parameter

---

<div class="post-metadata">

**Author:** ![vbhoj74](https://avatars.discourse-cdn.com/v4/letter/v/8c91f0/32.png) [@vbhoj74](https://community.smartthings.com/u/vbhoj74)\
**Post date:** [February 10, 2017, 12:40pm UTC](https://community.smartthings.com/t/obsolete-virtual-http-switch-button-creator/54383/14 "2017-02-10T12:40:32Z")

</div>

Need some help, I’ve a NodeMCU ESP8266 setup to control some IR devices using example here:

> **[mdhiggins/ESP8266-HTTP-IR-Blaster](https://github.com/mdhiggins/ESP8266-HTTP-IR-Blaster)**
>
> ESP8266-HTTP-IR-Blaster - ESP8266 Compatible IR Blaster that accepts HTTP commands for use with services like Amazon Echo

The code works for me (incl raw data) when using normal web browser. Tried the Virtual switch method, and simple URL works, but not able to add raw data URL to the smartapp which is giving error.

Example of simple URL that works:

[http://192.168.1.20:8081/msg?code=80C:RC5:12&pulse=2&repeat=2&pass=pass](http://192.168.1.20:8081/msg?code=80C:RC5:12&pulse=2&repeat=2&pass=pass)  
80C:RC5:

Example of Raw data URL which is still not working for me:

[http://192.168.1.20:8081/json?pass=pass&plain=[{“type”:“raw”,“data”:[897,874,900,868,1780,867,899,868,898,869,897,870,897,868,898,868,899,1750,897,870,1779,868,898,89578,918,867,898,869,1781,868,898,867,898,868,898,870,895,871,897,869,896,1751,899,869,1779,869,896],“khz”:38,"pulse](http://192.168.1.20:8081/json?pass=pass&plain=%5B%7B%22type%22:%22raw%22,%22data%22:%5B897,874,900,868,1780,867,899,868,898,869,897,870,897,868,898,868,899,1750,897,870,1779,868,898,89578,918,867,898,869,1781,868,898,867,898,868,898,870,895,871,897,869,896,1751,899,869,1779,869,896%5D,%22khz%22:38,%22pulse)":2}]

The above is for the TV power, the AC one is even longer.

---

<div class="post-metadata">

**Author:** ![CSC](https://avatars.discourse-cdn.com/v4/letter/c/f1d935/32.png) [@CSC](https://community.smartthings.com/u/CSC)\
**Post date:** [February 10, 2017, 1:05pm UTC](https://community.smartthings.com/t/obsolete-virtual-http-switch-button-creator/54383/15 "2017-02-10T13:05:05Z")

</div>

You should code the raw file in the nodemcu (I presume that), and trigger using simple URL parameter, check out the nodemcu sample thread

---

<div class="post-metadata">

**Author:** ![RoadRebel](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/roadrebel/32/129117_2.png) [@RoadRebel](https://community.smartthings.com/u/RoadRebel)\
**Post date:** [March 21, 2017, 11:35pm UTC](https://community.smartthings.com/t/obsolete-virtual-http-switch-button-creator/54383/16 "2017-03-21T23:35:58Z")

</div>

@CSC  
CSC,

I stumbled onto this while searching for a long wanted solution and hope you can help. I am pretty sure I can use/repurpose it for my use but for the life of me I can not get it to function. I am going to guess its something I am not setting up correctly.  
Some background, I am attempting use this to integrate an Eyezon Envisalink 3 that’s commonly connected to DSC and other alarm panels. It has a local built in server that accepts local http commands to arm/disarm etc  
Currently I can use a web browser (or tasker get) and enter “[http://192.168.5.174/2?A=3&p=1&X=0952](http://192.168.5.174/2?A=3&p=1&X=0952)” and the system will arm.  
I have currently setup entered  
Device IP address  
192.168.5.174  
Device port  
80  
URL Path for ON  
/2?A=3&p=1&X=0952  
URL Path for off  
(I have not entered anything)  
Post or Get  
Get  
Requires user auth? Set to off.

This is what is logged  
a3059725-dc8d-42eb-8a70-304ec57fafb3 ‎7‎:‎32‎:‎42‎ ‎PM: debug GET /2?A=3&p=1&X=0952 HTTP/1.1  
Accept: _/_  
User-Agent: Linux UPnP/1.0 SmartThings  
HOST: 192.168.5.174:80  
Content-Type: application/x-www-form-urlencoded

a3059725-dc8d-42eb-8a70-304ec57fafb3 ‎7‎:‎32‎:‎42‎ ‎PM: debug The method is GET

a3059725-dc8d-42eb-8a70-304ec57fafb3 ‎7‎:‎32‎:‎42‎ ‎PM: debug The Header is [HOST:192.168.5.174:80, Content-Type:application/x-www-form-urlencoded]

a3059725-dc8d-42eb-8a70-304ec57fafb3 ‎7‎:‎32‎:‎42‎ ‎PM: debug path is: /2?A=3&p=1&X=0952

a3059725-dc8d-42eb-8a70-304ec57fafb3 ‎7‎:‎32‎:‎42‎ ‎PM: debug The device id configured is: ea5583db-eb51-42fe-a460-351b6c207c63

a3059725-dc8d-42eb-8a70-304ec57fafb3 ‎7‎:‎32‎:‎42‎ ‎PM: debug —ON COMMAND— /2?A=3&p=1&X=0952

Any help/insight for a total noob would greatly be appreciated!!

Phil

---

<div class="post-metadata">

**Author:** ![CSC](https://avatars.discourse-cdn.com/v4/letter/c/f1d935/32.png) [@CSC](https://community.smartthings.com/u/CSC)\
**Post date:** [March 22, 2017, 1:35pm UTC](https://community.smartthings.com/t/obsolete-virtual-http-switch-button-creator/54383/17 "2017-03-22T13:35:30Z")

</div>

This is my setup, fyr

![](https://global.discourse-cdn.com/smartthings/original/3X/7/d/7d8fcac827c786db101c283248b5b1e9ed2a9351.PNG)

---

<div class="post-metadata">

**Author:** ![RoadRebel](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/roadrebel/32/129117_2.png) [@RoadRebel](https://community.smartthings.com/u/RoadRebel)\
**Post date:** [March 23, 2017, 1:04am UTC](https://community.smartthings.com/t/obsolete-virtual-http-switch-button-creator/54383/18 "2017-03-23T01:04:03Z")

</div>

Thanks CSC,  
I was able to get it running and it works like a champ for this integration without modifications.  
I did have to enable authentication and enter the server info instead of the system code.

Hopefully others trying to do this can find it as I did.

Thanks again

Phil

---

<div class="post-metadata">

**Author:** ![Mpovolo](https://avatars.discourse-cdn.com/v4/letter/m/858c86/32.png) [@Mpovolo](https://community.smartthings.com/u/Mpovolo)\
**Post date:** [April 23, 2017, 11:07am UTC](https://community.smartthings.com/t/obsolete-virtual-http-switch-button-creator/54383/19 "2017-04-23T11:07:14Z")

</div>

Hi, I also have this working now with DSC alarm, thanks for all the notes here.  
Does anyone know the url code for arm away mode. The disarm one works, the arm one however arms only in stay. I cannot figure out how to arm away mode. The ones below are the url I am using where xxxx is DSC passcode

URL Path for ON  
/2?A=3&p=1&X=xxxx

URL Path for ON  
/2?A=4&p=1&X=xxxx

thanks

---

<div class="post-metadata">

**Author:** ![RoadRebel](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/roadrebel/32/129117_2.png) [@RoadRebel](https://community.smartthings.com/u/RoadRebel)\
**Post date:** [April 25, 2017, 11:56pm UTC](https://community.smartthings.com/t/obsolete-virtual-http-switch-button-creator/54383/20 "2017-04-25T23:56:40Z")

</div>

Mark,  
More than likely its actually going into away mode but you did not trigger an exit sensor,If you just trigger it and do not exit it will arm in stay mode Its the way DSC panels behave… As a test, Arm it and open one of your exit doors and let it arm. Then trigger the exit/disarm and it should show it was it away mode was disarmed.

Phil

[Next page](https://community.smartthings.com/t/obsolete-virtual-http-switch-button-creator/54383.md?page=2)
