iOS widget solution needed

Hi all,

The iOS widget functionality for Smartthings is sub-par. I need quick-access widgets from the lock screen to allow my family (and me) the ability to arm/disarm the home monitoring system, as well as to access a few key devices. Navigating to the right places through the app is more challenging to do this, particularly for those members of the family who are not as tech savvy.

I’m currently using the existing widget functionality in the app, but the following are a few of the problems I experience:

  • Need for widgets to be scenes. Widgets cannot access devices directly. Not a terrible issue to set up a scene to turn a switch on or off, but also not terribly efficient, as the scene becomes redundant to the device itself.
  • Limited to 4 widgets, which essentially gets me only arm/disarm functionality for the home monitor.
  • Since the “new app” was released a couple of years back, widgets function differently. It used to be that the widget would run the scene right from the lock screen without opening the app. It was quick and reliable. Now it’s clumsy in that it opens the Smartthings app (meaning phone needs to unlock w/ Face ID too), navigates to the automation screen, scrolls up to the scenes, and then runs the respective scene. Sometimes it’s unreliable depending on what specific page you already have (or last had) the app open to, and the scene doesn’t run.

Does anyone have any unique solutions for quicker, more reliable widgets for Smartthings device access on their iOS devices?

Thanks!

1 Like

I am hesitant to recommend Ifttt for anything since I think they may be on a trajectory that will take them out of business relatively soon. But if you only need a couple, you could set up a free account. They are one of the few services that offers iOS widgets and works with smartthings. And as of iOS 16, they even offer lock screen widgets. And of course there is at the time of this writing still a smartthings Ifttt channel.

So I think it will do what you want, I just don’t know how long it’s going to be around.

How to use new widgets on iOS - IFTTT
.

Lock screen widgets for iOS 16 - IFTTT

1 Like

Thanks, I will take a look. Not a huge fan of IFTTT, I’ve been moving any routines away primarily because I was a free user and they recently limited free access significantly. So I don’t know that it will be useful enough without a paid account.

Was hoping I could do something with the Shortcuts app, or some other simple app on the phone that would give it a clean integration without going though multiple cloud applications.

Thanks for the suggestion.

You could use the Device API with a Shortcut to arm/disarm the home monitoring system either directly or through virtual switch. I created the following shortcut several months ago that seems to work (ST responses with “status”:“ACCEPTED”’, though I really don’t remember what it controls any longer

Note that the cut offed url is:
https://api.smartthings.com/v1/devices/195c09f0-c74a-442d-bff9-3d673014b661/commands’ and the id is the device id

1 Like

This is intriguing, but could I have you expand upon the syntax above? I’ve never really used Shortcuts in this way before, and I’m trying to follow.

I’m unclear on a few things:

The first three lines, what do they do?

I’m guessing your-api-key is my personal access token that I’ve created to access the API? And that long string beginning with 195c09f… is the device id?

What happens with the variable “API System”?

When the shortcut accesses the API link “API URL” - that is a variable that I don’t know how you select.

Thanks!

These lines create the body json command that will be sent to the device api endpoint. The Text item is the actual command in json format that gets sent to preform the action

Yes that is your PAT, I should have been more clear

Actually I’m not sure what happens with that variable or how it is used. As I said, I played around with this several months ago and really haven’t had a need to use Shortcuts for anything yet. So it’s possible these are extra lines that aren’t necessary

Below are a couple of extra pics with two of the steps expanded, it give a little more info on how to set up the url.

I’m not great with Shortcuts either so I’m guessing I found a similar Shortcut to some api that I adapted to ST, so I’m not real sure how some of these steps work or if they are all necessary

In the next few days I’ll see if there is a way to post Shortcuts to GitHub so you can get this Shortcut directly


Thanks. I’m not sure if there are any nuances in your “Text” (critical spaces, for example) or in your expansion on the POST command (like critical spaces between Authorization and Bearer), which may be throwing it off for me. The expansion helped, but I can’t get it to turn a specific switch off…

Any chance you can count the spaces between Authorization and Bearer since there does seem to be a number there?

Shortcut actions are all pre-formatted so there isn’t any spaces between Authorization and Bearer. That is how the Get contents of URL action is formatted when you expand it.

You do need to set the parameters for the url action. When you add that action to the shortcut, tap the placeholder apple.com value, set the variable to API System, scroll down and set the last entry to API URL which is from the API System dictionary. See screen shot below

It’s the header section of “Get contents from URL” that I can’t duplicate… I can only type in “Authorization Bearer” in the “Key” field and set the “Text” field to be API Key. There is nothing pre-populated that seems to be selected here.

Figured it out with @rambo350z ’s help. This is the solution I was looking for! Fast execution, does not open the app, and reliable. Thanks!!!

1 Like