[OBSOLETE] URI Switch -- Device Handler for controlling items via HTTP calls

Check out youtube.com/watch?v=fzedfmbouyu at 11:00. Thanks about sending http command to turn off and on. Thought it might help.

Unfortunately the YouTube video link you sent is unplayable, do you have another resource or what the topic is about?

Could this be used for a different type of script other than a PHP script? Perhaps a shell or python script?

I don’t think I quite understand your question. This Device Handler actually has nothing to do with PHP, shell, or Python. It is a groovy script that executes calls to a web based api. Could you elaborate?

I was under the impression these bottom two lines called for the path of a script on the pi. I’m wondering if I can specify a path of a shel script.

Ah I see the misunderstanding now. It doesn’t call a script, it calls a url. For instance, how you have it configured it would call http://10.0.0.242/api/HomeAutomation.X10/o1/Control.On. You cannot use this to login to a server and run a script, unless you host that script behind an apache or some other webserver.

Thanks for this - very useful! I’ve used this it to trigger a local web server (Python) as part of Smartthings automation which then casts audio to Google Home (using pyChromecast etc…). In my case, casting sounds/voice to Google Home when motion is detected in certain locations. Cheers.

I have been using this device handler for a while and I have some devices which use it attached as “then” actions on a few automations. Recently, I noticed that some of these devices were being turned on a little early, which seemed strange. I removed the offending device from the automation, but now, when I try to add it back, I no longer see it in a list of devices which can be added. In addition to this, the remaining device, still attached to the automation and which uses this device handler, shows the action as “unknown action”.

Maybe something changed recently which makes this driver not work for automations anymore?

The “unknown action” and missing device thing has been plaguing me for weeks. I’m about 6 tickets deep with Customer Service to no avail. They keep sending me the same “send us your logs” reply. Totally frustrating. Presume something has changed re Device handlers for Zwave devices?

Hey friend ,
I’m trying to use your code to define a shelly component
The command is an HTTP command that I want to send through a virtual button I created in smartthings.
The command I send is http://10.100.102.67/settings/relay/0?btn_type=detached (note that the command works outside of smartthings)
I think I set the parameters correctly, but for some reason nothing happens.
I would love to know if you have any insights on the subject.
Thanks
mor

@TAustin has created a great, easy to use Edge Driver that works with many but not all Shelly devices.

The following link should get you started.

Hi - Not sure exactly what you are needing to do, but as @Paul_Oliver pointed out above, there is now a Shelly driver that runs on Edge. If you are looking to do something a bit more custom, there is an alternative Edge driver you can try called Web Requestor if local execution is important to you.

Basically, I’m trying to send an HTTP command that is not necessarily related to shelly and yet it does not work properly so on second thought maybe I’m not setting anything right. I would love to hear if you have setup instructions or a video with an explanation. Thanks again

I don’t know anything about this DTH you are using, but maybe there are still some folks around that are familiar with it. Be forewarned, though, that DTH’s and all things Groovy will be sunset from the platform at some point.

If you have a SmartThings hub and you want to try an Edge driver (Web Requestor) that provides a similar function, I can help you with that. I’d invite you to check out the topic I linked previously which includes a nice writeup of a case study just recently posted.

Did you get any driver to make https call rquests?