Success stories using Shortcuts and Indigo?

Posted on
Mon Apr 25, 2022 3:35 pm
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Re: Success stories using Shortcuts and Indigo?

Nice anyone!

Posted on
Tue Apr 26, 2022 8:04 am
CliveS offline
Posts: 771
Joined: Jan 10, 2016
Location: Medomsley, County Durham, UK

Re: Success stories using Shortcuts and Indigo?

anyone wrote:

The iOS shortcuts make GET requests, passing my API keys. For the garage, I wanted to examine the response, so I set the result to a variable.

The way I wrote this, any response with "denied" or "not authorized"within it is treated as a successful attempt. Indigo returns a HTTP code of 401 = "You are not authorized to access that resource" when it should be returning a 200 = "Ok". See my post here about that https://forums.indigodomo.com/viewtopic.php?f=10&t=25782
I believe I added the "denied" because on occasion for a non-isolated reason, I was getting that response as well.


Thank you, that works great on my iPhone and Apple Watch, I take it that the response part will need to be modified when HTTP code 401 is rectified to 200.

Is their a way in shortcuts to first try the local url and if that fails then use xxx.indigodomo.net?

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

Posted on
Wed Apr 27, 2022 6:41 am
anyone offline
User avatar
Posts: 125
Joined: Apr 03, 2011
Location: Norfolk, VA

Re: Success stories using Shortcuts and Indigo?

CliveS wrote:
Thank you, that works great on my iPhone and Apple Watch, I take it that the response part will need to be modified when HTTP code 401 is rectified to 200.


Correct, you would have to tweak all of the shortcuts that make GET requests to your Indigo server in this manner, at some point for them to continue to work.

As an alternative to the Shortcut I shared, you could create Shortcuts that only define the URL, then passes that URL to a separate 'handler' Shortcut with the "Run Shortcuts" action and an input. In testing, this appears to work without any issues.

This design would require an update to only the 'handler' when the HTTP codes change.

CliveS wrote:
Is their a way in shortcuts to first try the local url and if that fails then use xxx.indigodomo.net?


Yes but not without problems. The timeout on the GET request does not appear to be configureable and in my testing was at least 30+ seconds.

As you likely know, using the reflector and API key is more secure because it allows you not to have to pass your username as well as password, in the clear. to perform the GET request.

Another way you might approach this is use the "Get current IP address" and/or "Get Wi-Fi network's Network Name" actions to determine which method to use.

Get current IP should return a value if you are connected to the internet. Get Wi-Fi network name should allow you to determine if you're connected to your network. You could then do IF/THENs to define which URL (local or reflector) to use to perform the GET request.

Posted on
Thu May 12, 2022 7:22 am
anyone offline
User avatar
Posts: 125
Joined: Apr 03, 2011
Location: Norfolk, VA

Re: Success stories using Shortcuts and Indigo?

I started using NFC Tags this week after seeing some tutorials on how to set them up with Shortcuts and Home kit.

What stood out to me was how cumbersome the scripting on the iOS device was to do simple things like Toggle a light or add time conditions.

To set it up in Indigo, I followed the process to configure a Personal Automation to detect when a Tag is scanned. Once a tag is scanned, my iPhone vibrates to let me know it saw the tag, then a iOS Shortcut runs, which changes a variable in Indigo.

A Indigo trigger executes when it sees that variable change, and launches an Action Group to do whatever I want.

A huge advantage in incorporating Indigo in the use of NFC Tags is you only need to modify the Trigger and/or Action Group to change what happens when the Tag is scanned.

I am currently using tags on all of my doors with smart locks to simply unlock the door. Another tag I have in my office, is time based and performs certain actions in the morning when scanned and different actions in the afternoon.

Honestly...I'm still trying to wrap my head around what I could or want to do.

Posted on
Sun May 15, 2022 8:19 am
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Success stories using Shortcuts and Indigo?

anyone wrote:
I started using NFC Tags this week after seeing some tutorials on how to set them up with Shortcuts and Home kit.

What stood out to me was how cumbersome the scripting on the iOS device was to do simple things like Toggle a light or add time conditions.

To set it up in Indigo, I followed the process to configure a Personal Automation to detect when a Tag is scanned. Once a tag is scanned, my iPhone vibrates to let me know it saw the tag, then a iOS Shortcut runs, which changes a variable in Indigo.

A Indigo trigger executes when it sees that variable change, and launches an Action Group to do whatever I want.

A huge advantage in incorporating Indigo in the use of NFC Tags is you only need to modify the Trigger and/or Action Group to change what happens when the Tag is scanned.

I am currently using tags on all of my doors with smart locks to simply unlock the door. Another tag I have in my office, is time based and performs certain actions in the morning when scanned and different actions in the afternoon.

Honestly...I'm still trying to wrap my head around what I could or want to do.


would you mind sharing links to the hardware you're using for this solution?

Posted on
Sun May 15, 2022 10:43 am
anyone offline
User avatar
Posts: 125
Joined: Apr 03, 2011
Location: Norfolk, VA

Re: Success stories using Shortcuts and Indigo?

I do not mind at all because it gives me the perfect opportunity to share a little more about the solution. Sorry in advance if this is TMI.

These are the tags I bought: https://www.amazon.com/dp/B075CFXY8V?ref=ppx_yo2ov_dt_b_product_details&th=1

All you need are the NFC tags, no additional hardware is needed other than an iOS device. As I type this, these tags are $8.99 for 10 with one day delivery. You will be able to read and write to these tags which is a plus, but the automation I described does not require writing to them.


What I discovered since my initial post is when the Personal Automation is created on the individual iPhones to learn the Tag, you can specific an "Input" value. I now use that to pass the name of the tag. (i.e. FrontDoor, FamilyRoom, NightStand, etc.) to the iOS Shortcut.

So the iOS shortcut I use, now reads the name of device which scanned the tag; "Anyone's iPhone 13", converting that to an alphanumeric value with RegEx so it can be used within Indigo as a variable name. (i.e. "AnyonesiPhone13"). It then updates that variable in Indigo with the Input value passed to it, which is the name of the Tag.

Code: Select all
2022-05-10 21:19:59.528   Web Server   request to set variable "AnyonesiPhone13" value to "FrontDoor" from  ###.#.##.####


Doing it this way allows you too easily know who scanned the tag, and create automations based on that. You just need to set triggers to monitor the different device name variables you setup and look for changes to them.

As an example, when the "SpousesiPhoneSE" variable changes, I perform the automation my spouse wants for that NFC Tag which may or may not be different from the automation I want.


Here is an example of the shortcut I use: https://www.icloud.com/shortcuts/38d9659127e141ae8f741a3d3e9b6fd2

Unfortunately you can't share Automations associated with the Tags, but mine are simple, its Vibrate Device, Text and Run Shortcut (with Input of Text)
You can share the shortcut just as I've done above between iOS devices, so you don't have to recreate it for each device. The shortcut is reusable so this only needs to be done once. After that's done, you just need to create Automation for each tag you want to use.

Here is a tutorial, if needed, on how to setup NFC Tags: https://9to5mac.com/2022/02/04/homekit-weekly-how-to-create-nfc-automations-for-homekit-using-shortcuts-and-1-tags/

Posted on
Sun May 15, 2022 10:51 am
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Success stories using Shortcuts and Indigo?

This is brilliant. Now I just have to figure out what I'd use them for.

Posted on
Wed Aug 31, 2022 10:04 am
Different Computers offline
User avatar
Posts: 2541
Joined: Jan 02, 2016
Location: East Coast

Re: Success stories using Shortcuts and Indigo?

Anyone working on, or have working, a way for Indigo to trigger a Shortcut?

I made the mistake of buying a Feit light that "works with Siri Shortcuts" before I knew that meant "doesn't work with HomeKit" and I would love for one of my Indigo contact sensors to turn it on and off.

This article https://linkdhome.com/articles/Shortcuts-in-homekit suggests there might be some possibility of this using HomeKitLink, but I thought I'd ask here prior to messing about myself. From what little investigation I've done so far, it seems Apple is keeping Home out of AppleScript. Unfortunately.

Hmmm.... seems if I can make a shortcut a standalone file or app, I can trigger that with Indigo. Investigating!

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Wed Aug 31, 2022 10:24 am
anyone offline
User avatar
Posts: 125
Joined: Apr 03, 2011
Location: Norfolk, VA

Re: Success stories using Shortcuts and Indigo?

Different Computers wrote:
Anyone working on, or have working, a way for Indigo to trigger a Shortcut?!


Here is a link to the Apple Shortcut Users Guide: "Run shortcuts from the command line"

https://support.apple.com/en-by/guide/shortcuts-mac/apd455c82f02/mac

Code: Select all
% shortcuts -h
OVERVIEW: Command-line utility for running shortcuts.

USAGE: shortcuts <subcommand>

OPTIONS:
  -h, --help              Show help information.

SUBCOMMANDS:
  run                     Run a shortcut.
  list                    List your shortcuts.
  view                    View a shortcut in Shortcuts.
  sign                    Sign a shortcut file.

  See 'shortcuts help <subcommand>' for detailed help.


This will allow you to fairly easily trigger a iOS shortcut from Indigo.

Posted on
Wed Aug 31, 2022 11:35 am
Different Computers offline
User avatar
Posts: 2541
Joined: Jan 02, 2016
Location: East Coast

Re: Success stories using Shortcuts and Indigo?

Oh awesome! Thanks much.

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Sun Sep 04, 2022 11:00 am
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Re: Success stories using Shortcuts and Indigo?

Different Computers wrote:
Oh awesome! Thanks much.
Very curious what kind of implementation you are working on…

Posted on
Mon Sep 05, 2022 11:57 am
Different Computers offline
User avatar
Posts: 2541
Joined: Jan 02, 2016
Location: East Coast

Re: Success stories using Shortcuts and Indigo?

mundmc wrote:
Very curious what kind of implementation you are working on…


I have some Nanoleaf bulbs that are not as yet supported by the plugin (and the Nanoleaf plugin itself needs upgrading to python 3--that's in process). Since Indigo can't control those bulbs directly, I have a script that kicks off a shortcut that controls the bulbs inside of the Home app.

I could easily imagine that if someone had gone heavy into Home/HomeKit before getting Indigo, they might need to make lots of use of Shortcuts.

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Mon Sep 05, 2022 11:59 am
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Re: Success stories using Shortcuts and Indigo?

Thanks for filling me in. I got really into Shortcuts a few years ago, and I need to get back to them as I’m sure there’s some homeautomation magic that can happen by launching them from a shell script.

Posted on
Wed Jan 31, 2024 10:06 am
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Success stories using Shortcuts and Indigo?

With the change to HTTP API, the shortcut examples are deprecated?

Can someone help me with an example shortcut that updates a variable? If possible, using a variable name rather than ID?

Posted on
Wed Jan 31, 2024 10:32 am
DaveL17 offline
User avatar
Posts: 6753
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Success stories using Shortcuts and Indigo?

ryanbuckner wrote:
With the change to HTTP API, the shortcut examples are deprecated?

Can someone help me with an example shortcut that updates a variable? If possible, using a variable name rather than ID?


The Shortcuts examples should work. I just created one from scratch and it worked as expected. In the below example, change MY-REFLECTOR-NAME and MY-API-KEY to your actual values. Note that you can only use HTTPS:// if you're going through the Indigo reflector.

You can't use a variable name with the API as far as I know; the objectId payload key is expecting a number. I'd have to dive into the code to confirm that, but I'm pretty confident.

Screenshot 2024-01-31 at 10.28.05 AM.png
Screenshot 2024-01-31 at 10.28.05 AM.png (82.57 KiB) Viewed 285 times

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Who is online

Users browsing this forum: No registered users and 1 guest