Success stories using Shortcuts and Indigo?

Posted on
Mon Apr 25, 2022 3:35 pm
mundmc offline
User avatar
Posts: 908
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: 638
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 2021.1.1 : macOS Big Sur 11.6.5 : MacBook Retina 2014 : 2 .6 GHz Dual Core i5. : 8 GB. : Samsung 970 1TB EVO 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
Posts: 50
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
Posts: 50
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: 720
Joined: Oct 08, 2011

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
Posts: 50
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: 720
Joined: Oct 08, 2011

Re: Success stories using Shortcuts and Indigo?

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

Who is online

Users browsing this forum: No registered users and 1 guest