Page 1 of 2

Embedding links to Indigo Actions ?

PostPosted: Fri May 19, 2023 12:55 pm
by SearchCz
Hi,

I'm looking for a way to send notifications of problems / concerns in the smarthome along with links to involve the likely corrective action that should be taken.

For example, if a light has been left on for *too long*, I'd like to send a notification with options to either turn the light off, or to extend the timer for another predetermined time period. I thought perhaps I could link to *something* that would trigger the correct corresponding action, but I'm not sure what that *something* would be. Any thoughts or ideas on how I can make that happen?

Re: Embedding links to Indigo Actions ?

PostPosted: Fri May 19, 2023 1:52 pm
by DaveL17
I'm not aware of a way to fire a notification with options (that doesn't mean there isn't one). You could use a Shortcut to fire various Indigo actions based on the content of a text message (for example)--and then the shortcut would present you with the various actions to take. In theory, anyway.

Re: Embedding links to Indigo Actions ?

PostPosted: Fri May 19, 2023 8:06 pm
by mundmc
Shortcuts definitely can work for that.

I use Pushover for that as it allows me to respond. Let me walk you through it.

Requirements:
1. Pushover
2. Pushover plugin
3. A control page
4. A trigger for each event you are monitoring

Pushover is out of this scope, but it's pretty straightforward to set up.

Example Flow:
1. Trigger: All adults in my house are not home (that's another topic how i monitor that)
Image

2. Action: Use Pushover to send an http link to a Control Page
Image


Make a page (the control page in this picture sucks because I am revamping it)
Image
I am happy to say it has been incredibly bulletproof.

Re: Embedding links to Indigo Actions ?

PostPosted: Sun May 21, 2023 9:31 am
by SearchCz
mundmc wrote:
Shortcuts definitely can work for that.

I use Pushover for that as it allows me to respond. Let me walk you through it.

Requirements:
1. Pushover
2. Pushover plugin
3. A control page
4. A trigger for each event you are monitoring

Pushover is out of this scope, but it's pretty straightforward to set up.

Example Flow:
1. Trigger: All adults in my house are not home (that's another topic how i monitor that)

2. Action: Use Pushover to send an http link to a Control Page


Make a page (the control page in this picture sucks because I am revamping it)
I am happy to say it has been incredibly bulletproof.


This is almost exactly what I was looking for, but I was hoping to have the embedded link trigger the desired action rather than producing a control page full of options. I'm already using pushover so this shouldn't be a huge leap for me. I'll give it a try!

Re: Embedding links to Indigo Actions ?

PostPosted: Sun May 21, 2023 11:16 am
by ryanbuckner
Here's an idea, unproven but worth a shot:

1) Create a google sheets document with buttons that call the Indigo Action Groups through the API - here's an example::

2) Embed your sheet directly into the email contents (this is the part I'm not sure will work). Directions here

Honestly not sure if this will work. But this could be what you're looking for.

Re: Embedding links to Indigo Actions ?

PostPosted: Sun May 21, 2023 11:17 am
by jay (support)
If the action URL points to a shortcut, then I think when you tap the notification in pushover it should launch the shortcut (which would do whatever it is you want it to do - see the Shortcuts forum for more information).

Re: Embedding links to Indigo Actions ?

PostPosted: Sun May 21, 2023 12:07 pm
by ryanbuckner
jay (support) wrote:
If the action URL points to a shortcut, then I think when you tap the notification in pushover it should launch the shortcut (which would do whatever it is you want it to do - see the Shortcuts forum for more information).


This would only work from an iPhone or Mac and the person receiving the message would need the shortcuts locally. Is that correct?

Re: Embedding links to Indigo Actions ?

PostPosted: Sun May 21, 2023 2:50 pm
by jay (support)
ryanbuckner wrote:
This would only work from an iPhone or Mac and the person receiving the message would need the shortcuts locally. Is that correct?


Well, yes, since Shortcuts only run on Apple devices... ;)

Shortcuts can be shared automatically to all devices signed into the same iCloud account. You can also specifically share shortcuts with others, though you have to be careful with whom because they will need an API Key stored in the shortcut to execute actions via the API. You could create a new key in your Indigo Account for each user outside of your iCloud account and have them use those separate keys (so you could turn it off if is somehow got compromised).

For other systems, then you'd need to use a URL that points to something where you can log in (like a control page, etc).

Re: Embedding links to Indigo Actions ?

PostPosted: Mon May 22, 2023 8:05 pm
by mundmc
Sorry if I'm being thick, but instead of sending a link to a control page, why not just send a link to an action group that causes the appropriate shortcut to run on the host Mac?

Re: Embedding links to Indigo Actions ?

PostPosted: Tue May 23, 2023 7:09 am
by ryanbuckner
mundmc wrote:
Sorry if I'm being thick, but instead of sending a link to a control page, why not just send a link to an action group that causes the appropriate shortcut to run on the host Mac?


How do you construct a link that fires an action group?

Re: Embedding links to Indigo Actions ?

PostPosted: Tue May 23, 2023 8:45 am
by ryanbuckner
ryanbuckner wrote:
Here's an idea, unproven but worth a shot:

1) Create a google sheets document with buttons that call the Indigo Action Groups through the API - here's an example::


Here's a way to run Apps Script functions from a URL. https://www.labnol.org/code/19871-get-p ... gle-script

So you could send the Action Group ID as a parameter in the URL you generate in the email. And boom! I just tested this and it worked. You can also set permissions so only you and your wife can run them.

So the workflow would be : Email is generated -> Email URL clicked -> Apps Script doGet fires -> Indigo API Executes Action Group -> Response is generated -> User sees a google web page with success or failure.

Re: Embedding links to Indigo Actions ?

PostPosted: Tue May 23, 2023 12:53 pm
by mundmc
ryanbuckner wrote:
mundmc wrote:
Sorry if I'm being thick, but instead of sending a link to a control page, why not just send a link to an action group that causes the appropriate shortcut to run on the host Mac?


How do you construct a link that fires an action group?
Image

Re: Embedding links to Indigo Actions ?

PostPosted: Tue May 23, 2023 1:56 pm
by jay (support)
That is the old REST API, which was discontinued in 2022.2.

Re: Embedding links to Indigo Actions ?

PostPosted: Wed May 24, 2023 8:03 am
by mundmc
My bad- what's the way to do this now?

Re: Embedding links to Indigo Actions ?

PostPosted: Wed May 24, 2023 9:10 am
by jay (support)
There is no GET URL that will control a device (only POSTs).