Jump to content
View in the app

A better way to browse. Learn more.

Universal Devices Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

iOS shortcut support to trigger a program

Featured Replies

Posted

After reading a similar thread, I've become interested in using the iOS Shortcuts support to trigger a REST command and run a program (or a Then or Else).

I was able to trigger the program from a Chrome tab using the simple command

http://192.168.160.31:8080/rest/programs/0009/runThen

But making a shortcut for Get contents of and using the same command as above (and with a GET method), nothing happens.

Possibly it's because the first time I ran this in Chrome I was prompted for a username and password, but on the iPhone I didn't get challenged.

Probably a simple answer to this, but hard to find a solution online.  Any help would be appreciated!

Solved by Guy Lavoie

Go to solution

You can encode the username and password into the http GET string, like this:

http://admin:<password>@192.168.160.31:8080/rest/programs/0009/runThen

replace <password> with the actual password

  • Solution

If you can construct multiline URLs, the better way is to encode the username and password as a base 64 value, and include it as a parameter. Browsers do this internally. It looks like this:

GET /rest/programs/0009/runThen HTTP/1.0
Host: 192.168.160.31:8080
Authorization: YWRtaW46YWRtaW4=

 

That authorization value is the result of encoding "admin:admin"

You can encode your own userid:password here

https://www.base64encode.net/

See the screenshot. This updates the value of a variable.  Slightly different than the "run" command you want, but the principles are the same. The last bit is the trickiest. Add a header, type "Authorization" and then type "Basic" and then add your encoded password by inserting the variable.

Screenshot 2024-10-04 at 8.12.57 PM_001.jpg

 

@maxnorth  Many thanks for providing this shortcut; something I'd really like to get it to work for me.

I've implemented the shortcut on my iPhone as shown in your screenshot.  It seems that I have the Authorization set correctly, since if I change my portal username or password by 1 character in the Userpw key, the shortcut returns: "user authorization not valid."  With the correct portal username and password the shortcut returns: "Requested ISY not found in the user's domain." 

I've compared the BaseURL encoded value generated by the shortcut and it is identical to that provided by https://www.base64encode.net/  using the format myportalusername:myportalpassword

I do have two devices configured in the portal, an eisy and a Polisy.  How do I specify the desired device in the shortcut BaseURL dictionary key?   My entry for that key is:  https://my.isy.io/isy/  

Figured it out.  The BaseURL to specify the device is:

BaseURL https://my.isy.io/isy/longkeyfromtheportal/   

Shortcut works after adding the long portal key for the specific device to the BaseURL.  Thanks again @maxnorth for the shortcut.

 

I’m glad it is working for you.

  • Author

Thanks for the help, got it working!

Edited by peterathans

Guest
This topic is now closed to further replies.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.