[ST Edge] Web Requestor: a driver to issue local POST and GET HTTP requests

Is there any way to use the Web Requestor to control a device locally on the ST Hub?
I was able to use Automation Studio to create a simple http trigger to control a switch, but that only executes through the web.
Is it currently possible to use an html uri link to trigger a device on the ST Hub locally, without additional hardware or software running in the background?

Do you mean control a SmartThings Edge device or control some other LAN-based device?

I have 2 other drivers that allow you to control a SmartThings Edge device locally: one does it with HTTP requests, the other does it with MQTT messages.

1 Like

Hello Austin,
I mean to control another Zwave device on the ST Hub using a simple html request that can triggered by any local web browser on the same LAN.

It depends on if you want everything to be running locally. If that’s not a requirement, you could accomplish what you want via a browser by using the RESTful API to control your Zwave device.

But if you want it all to run local, then that is doable, but will require a combination of things. Without getting into TMI, you need to have an intermediate application to manage the messages into the SmartThings hub. That can be done with my edgebridge app or using MQTT. Then you can have a SmartThings device that can receive your browser-initiated request and trigger a SmartThings momentary button, for example. Then you’d have an automation that gets triggered by that and then does what it needs to do with your Zwave device.

I just did a quick experiment were I used a triggering device created by my LAN Trigger driver and I used a browser to send it a trigger through edgebridge. There’s some configuration involved.

Net: it’s doable but a bit convoluted.

1 Like

Yes, I need the http trigger to run even when there is no internet connection.
Could you please elaborate on how this would be done? By “can be done with my edgebridge app” do you mean Web Requestor or the LAN Trigger?
As I understand, the LAN Trigger app requires a Forwarding Bridge Server to be running elsewhere. If that’s the case, is there no way to do this without complicating the setup and adding additional dependencies?

Just to clarify, here is the basic desired behavior:

a. On my PC browser, I open a URL (GET Method), something like this: http://{STHub-IP}:{PORT}?SwitchA=on
b. ST Hub parses the request and turns ON SwitchA locally

I appreciate wanting something uncomplicated and with no dependencies, but unfortunately if you want to do this you need something like my edgebridge app (same thing as ‘Forwarding bridge Server’) and LAN Trigger driver. Webrequestor does not help with what you want to do: it is for sending requests OUT of the hub.

The reason you need this extra bit of complexity is this: Edge drivers do not have fixed port numbers. So if you were using a browser, you would not know what port number to send the request to at your hub’s IP address. Even if you did figure out what port number the driver was using, it can change whenever your hub is rebooted.

See the edgebridge link above, and/or this community topic:

Thank you for the clarification. So there is no way to run something like the edgebridge app directly on the ST hub? Would Automation Studio be unable to do this as well?
It does not necessary need to have a specific URL format scheme, as long as one URL link can turn ON and another turn OFF.

No

Any application that allows you to specify the full URL, including HTTP method, can work.

Any application that allows you to specify the full URL, including HTTP method, can work.

With Automation Studio, using “HTTP In” node, the generated URL is prefaced with “https://as-{ID}.app.scf.use2.devground.io”
This works, but it does require cloud access. Are you saying this can be modified to direct the http GET request directly to ST Hub on LAN?

No that won’t work then.

Hi TAustin,
I was trying to use it with voice monkey but it did not work.
The GET endpoint is https://api.voicemonkey.io/trigger?access_token={token}&secret_token={another_token}&monkey=my-monkey&announcement=Hello%20monkey

I tried it in #2 request, but got Not configured.

Have tried to create a rule with it but also not doing anything.

{“name”:“Test Web Requestor”,“actions”:[{“if”:{“equals”:{“left”:{“device”:{“devices”:[“my_device_id”],“component”:“main”,“capability”:“switch”,“attribute”:“switch”}},“right”:{“string”:“on”}},“then”:[{“command”:{“devices”:[“webrequestor_id”],“commands”:[{“component”:“main”,“capability”:“partyvoice23922.webrequest”,“command”:“GET”,“arguments”:[{“string”:“https://api.voicemonkey.io/trigger?access_token=my_access_token&secret_token=my_secret_token&monkey=hallway-monkey&announcement=This is a Test”}]}]}}]}}],“id”:“a05139bb-a1c8-4514-8ba7-a740b682842d”,“status”:“Enabled”,“executionLocation”:“Local”,“ownerType”:“Location”,“ownerId”:“my_ownerId”,“creator”:“SMARTTHINGS”,“dateCreated”:“2022-12-01T20:58:40Z”,“dateUpdated”:“2022-12-01T21:07:45Z”}

I also tried to change the domain to a IP address.

Do I miss anything or it just does not support voice monkey GET request?
Thank you very much

You cannot use a domain name as there are no domain services on the hub. You’ll have to replace ‘api.voicemonkey.io’ with an IP address.

1 Like

Thank you. It seems voicemonkey can not be used with IP address.

I didn’t realize this wasn’t on your LAN. In any case you can’t reach internet addresses from Edge without something like my edgebridge app or some other proxy server.

1 Like

I see thank you.

I just got time to try the edgebridge which works!.
I run the windows version with windows 11. Should I use the python version instead?
Thanks again!

I’ve not tested with Windows 11, but if it works it works!

Now you can use webrequestor to send html requests to internet addresses. Follow the format specified in the documentation:

[GET | POST] http://<edgebridge IP:port>/api/forward?url=<URL string>

Yep that’s what I did and it did work. Thank you.

1 Like

I have been slammed but this is awesome, and I will test this out soon!

Using http:///cm?cmnd=status%201 as the webrequest to a Tasmota device, is it possible possible just to see / extract the Uptime value from the response?

I wish to use this in a routine to trigger if the device restarts?

Update: Found the link to the help, I needed to use “StatusPRM.Uptime” as the response key - works great thanks @TAustin

{“StatusPRM”:{“Baudrate”:115200,“SerialConfig”:“8N1”,“GroupTopic”:“tasmotas”,“OtaUrl”:“http://ota.tasmota.com/tasmota/release/tasmota.bin.gz",“RestartReason”:"Software/System restart”,“Uptime”:“0T08:33:10”,“StartupUTC”:“2022-12-17T05:56:58”,“Sleep”:50,“CfgHolder”:4617,“BootCount”:19,“BCResetTime”:“2022-12-11T11:13:02”,“SaveCount”:303,“SaveAddress”:“F7000”}}

Thanks,
Sam.

1 Like