Success stories using Shortcuts and Indigo? Post a reply

This question is a means of identifying and preventing automated submissions.



:D :) :( :o :shock: :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen:
BBCode is ON, [img] is ON, [flash] is OFF, [url] is ON, Smilies are ON

Post options


   

Expand view Topic review: Success stories using Shortcuts and Indigo?

Re: Success stories using Shortcuts and Indigo?

Post by ryanbuckner » Wed Jan 31, 2024 11:37 am

Thanks Dave. I'm trying to think of a Indigomic way of using the NFC tags and shortcuts to unlock my front door. I'm leaning towards having to write a short script:

I wound up sending the device name to a variable as well as a timestamp to another variable from a shortcut on NFC tap. If the timestamp changes (trigger) then I check to see if the device name is stored in a list of authorized devices (stored in another variable). If it's there then I unlock the door.

Re: Success stories using Shortcuts and Indigo?

Post by DaveL17 » Wed Jan 31, 2024 10:58 am

I looked at the code and confirmed that an integer is the only acceptable value for objectId.

Re: Success stories using Shortcuts and Indigo?

Post by DaveL17 » Wed Jan 31, 2024 10:32 am

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 282 times

Re: Success stories using Shortcuts and Indigo?

Post by ryanbuckner » Wed Jan 31, 2024 10:06 am

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?

Re: Success stories using Shortcuts and Indigo?

Post by mundmc » Mon Sep 05, 2022 11:59 am

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.

Re: Success stories using Shortcuts and Indigo?

Post by Different Computers » Mon Sep 05, 2022 11:57 am

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.

Re: Success stories using Shortcuts and Indigo?

Post by mundmc » Sun Sep 04, 2022 11:00 am

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

Re: Success stories using Shortcuts and Indigo?

Post by Different Computers » Wed Aug 31, 2022 11:35 am

Oh awesome! Thanks much.

Re: Success stories using Shortcuts and Indigo?

Post by anyone » Wed Aug 31, 2022 10:24 am

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.

Re: Success stories using Shortcuts and Indigo?

Post by Different Computers » Wed Aug 31, 2022 10:04 am

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!

Re: Success stories using Shortcuts and Indigo?

Post by ryanbuckner » Sun May 15, 2022 10:51 am

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

Re: Success stories using Shortcuts and Indigo?

Post by anyone » Sun May 15, 2022 10:43 am

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/

Re: Success stories using Shortcuts and Indigo?

Post by ryanbuckner » Sun May 15, 2022 8:19 am

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?

Re: Success stories using Shortcuts and Indigo?

Post by anyone » Thu May 12, 2022 7:22 am

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.

Re: Success stories using Shortcuts and Indigo?

Post by anyone » Wed Apr 27, 2022 6:41 am

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.

Top