Calling web page URL and use return data

I was told that the Rules API is not what I would need and I should use the SmartThings API (ST API). There are a lot of pages about this API that are from years ago. I don’t think they are relevant. This new API should have been renamed.

I am looking to convert my WebCore scripts that allowed this functionality. I do not want to create a smartapp or something other than create a routine that calls a URL and returns some data that I can parse.

Does someone have a simple tutorial link for this task?

Thanks

What are you exactly wanting to do. I’m in the same process. I have it worked out to Get device info (name and state(on/off, open/closed)) and the Post command to turn things on and off. All using a http post/get commands. If that’s what you want to do.

Posts and Gets? Take a look at the Web Requestor.

Parsing the return data may be a challenge, as you are pretty limited in what you can do with Rules. My driver has an option to specify a particular key that will be looked for in the response data and the key value is put in a separate field you can test. Don’t know if this will be sufficient for your needs.

Also be aware that you’ll need some kind of proxy to reach beyond your local LAN.

My edgebridge app might be of interest.

This is a simple example:

Make a GET request to http://api.openweathermap.org/data/2.5/forecast

Then I get the return as JSON and parse it to see the temperature or something else

Then I make a GET request to VoiceMonkey to say a message on my Alexa Echo.

So I do not use any device in this example.

I was told by @nayelyz that I could use the ST API to make external calls. Your bridge is interesting however I do not understand why this would not be a core feature that could be called by the Rules API. WebCore has existed for years and they had Adrian there until he bolted (I think I see why). @TAustin your bridge info says that I can request a key. The JSON I get back is hierarchical. Can I choose the exact key in that hierarchy? Can I choose 2+ keys?

Maybe SmartThings should’ve just told everyone to use HASSIO and the SmartThings hardware?

:confused:

I’m not sure what that even means. Unless there is some new API I’m not aware (possible!)

Here is the official API reference.

Not sure you can achieve your goals without implementing a SmartApp. I don’t know how you are going to use the Rules engine to make use of the response data, then create a dynamic get request that you send to VoiceMonkey. Webrequestor is a tool to send your http requests, but the platform is quite limited in terms of using the returned data. I support just one key right now and its just a rudimentary search, so if there is an array, it will probably just return the first value found.

I think if I were you I wouldn’t even try to do this within SmartThings. Just write your own script on your computer. It would be much simpler but I don’t know why you were looking for SmartThings integration.

FYI, I have a weather driver and I’m just starting to add support for openweathermap, so you could have some use for that, which would already parse the data for you and make it available in a SmartThings device. From which you could create automations based on the data elements, but you still want to build something and send to VoiceMonkey. You could have an Edge driver send it to an app on your own computer, format it and send ahead to VoiceMonkey.

1 Like

You can do this with SharpTools.io

@Damianeq is using this concept in one of his SharpTools rules: