[OBSOLETE] Virtual HTTP Switch/Button Creator

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.

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.

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

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

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
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":2}]

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

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

@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” 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

This is my setup, fyr

1 Like

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

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

1 Like

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

Thanks, I found that out today. Arming is one command, if you open an exit door it triggers motions in zone 5, if you don’t open the exit door, it arms in stay.

Actually pretty cool

The one thing I haven’t been able to figure out is how to do a force arm stay via url. Right now I get the sound count down, and I want to eliminate that by simulating the force stay like the key pad panel has

Thanks for this, it’s great. I’m using it to create SmartThings switches to control LightwaveRF lights by calling a local LWRF command server I’ve written running on a local RPi. However it only ever appears to call the triggeron url, am I missing a trick? How do I get it it to call triggeroff? Thanks :slight_smile:

This is a pretty awesome! Thanks for coming up with this! I was having to use the maker IFTTT channel to make http calls, but now I can skip that. Using IFTTT’s maker channel had a lot of delays :frowning:

1 Like

You should also define the off url

Thanks - I have defined the off url. If I swap them then the off command works fine, so I know my urls are fine (and I use them all over the place in my network). If I look in the SmartThings app the history of the device only ever shows calling the “triggeron” command, as if it isn’t changing state internally to “on”. I’m using GET as per previous comments in this thread.

Are you using the http switch? Can you show me your configuration screen:

This app & handler looks like it will do exactly what I want; to arm and disarm motion capture on my security cameras, but I’m having an issue.

When I push the button it sends the “On” command and the cameras arm.

Pressing the button again sends the “On” command again, not “Off”. It’s not toggling as I expected.

I’m sure I’m missing something simple, any thoughts?

Mike W
XM381.com

Button is for IR devices, pls use the http switch

I am thinking of getting one of the light switches from GE/Jasco that allows for a double click. Would this handler be able to work with the light switches?