iOS Shortcuts and the HTTPd plugin

Posted on
Sat Apr 18, 2020 6:43 pm
FlyingDiver offline
User avatar
Posts: 7210
Joined: Jun 07, 2014
Location: Southwest Florida, USA

iOS Shortcuts and the HTTPd plugin

This thread was discussing a way to use a Shelly device to enable using iOS Shortcuts to run action groups. That was a really clever thing to do, but I think it's easier to do with the HTTPd plugin. And no Shelly device is required. It goes something like this:

First, you need the HTTPd plugin installed. These instructions are for the Version 2 plugin, but the same thing can be done with the original. You'll need the IP address of the Indigo server and the port number you assigned to the HTTP port in the plugin. It should look like this, with your IP address and port.
PNG image.png
PNG image.png (212.22 KiB) Viewed 1850 times

The group number should be the Indigo ID for the action group you want to run with this command.

Then you need to set up a trigger:
Screen Shot 2020-04-18 at 8.33.36 PM.png
Screen Shot 2020-04-18 at 8.33.36 PM.png (517.58 KiB) Viewed 1850 times

With this action:
Screen Shot 2020-04-18 at 8.33.54 PM.png
Screen Shot 2020-04-18 at 8.33.54 PM.png (560.99 KiB) Viewed 1850 times

Here's the code to make it easier to copy:
Code: Select all
groupID = int(indigo.devices[1794473612].states["group"]) # State "group" of "HTTP"
try:
    actionGroup = indigo.actionGroups[groupID]
except:
    indigo.server.log("Error unknown action group - {}".format(groupID))
else:
    indigo.actionGroup.execute(actionGroup)


That's it. Duplicate the shortcut, Change the name and edit the group number to use for multiple actions.

If you're using the V1 plugin, you'll use Indigo variables instead of device states for the trigger and action script.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sun Apr 19, 2020 1:01 am
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: iOS Shortcuts and the HTTPd plugin

Ooooh....!


Sent from my iPhone using Tapatalk Pro

Posted on
Sun Apr 19, 2020 6:59 am
CliveS offline
Posts: 770
Joined: Jan 10, 2016
Location: Medomsley, County Durham, UK

Re: iOS Shortcuts and the HTTPd plugin

FlyingDiver wrote:
This thread was discussing a way to use a Shelly device to enable using iOS Shortcuts to run action groups. That was a really clever thing to do, but I think it's easier to do with the HTTPd plugin. And no Shelly device is required.

I have just moved all my Shortcuts over to your method and is so easy compared to my 'method', I used the V2 HTTPd.

I did ask that if anyone could improve my Python code to let me know but I did not expect you to annihilate it completely :lol:

But glad you did!

CliveS

Indigo 2023.2.0 : macOS Ventura 13.6.3 : Mac Mini M2 : 8‑core CPU and 10‑core GPU : 8 GB : 256GB SSD
----------------------------------------------------------------------------------
The best way to get the right answer on the Internet is not to ask a question, it's to post the wrong answer

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest