Jump to content

How to get an iOS notification and an actionable button in notification


BamBamF16

Recommended Posts

The title kind of says it all.  I want to receive a notification and in that notification have actionable (via press) items.  Say for example, when my geo fence is tripped and the ISY variable for away is set but the house isn't put into away mode, I would like a notification that has a button or hyperlink I can click to put the house into away mode (turn on a lighting scene for example).  I don't want to have to go open mobilinc to execute the scene on command but rather do it from the message.  Is this even possible?

 

Bam2

Link to comment
  • 2 weeks later...
I've gotten the pushover part working fine, but I can't seem to find the info for creating and external URL link to do something on the ISY.  Honestly, I am not sure what to even look up.
 
Jeff


If you have ISY Portal, look at the IFTTT connectivity. It allows you to create tokenized inbound URLs that map to ISY actions (running programs, turning devices and scenes on and off etc...)
Link to comment
On 3/17/2019 at 7:16 PM, bambamf16 said:

I've gotten the pushover part working fine, but I can't seem to find the info for creating and external URL link to do something on the ISY.  Honestly, I am not sure what to even look up.

If I understand what you're looking to do correctly (without IFTTT) you effectively want to use the REST API.  That's where you would find the info on how to build http commands that will execute a program, change a variable, etc.

Link to comment
On 3/3/2019 at 6:54 PM, bambamf16 said:

The title kind of says it all.  I want to receive a notification and in that notification have actionable (via press) items.  Say for example, when my geo fence is tripped and the ISY variable for away is set but the house isn't put into away mode, I would like a notification that has a button or hyperlink I can click to put the house into away mode (turn on a lighting scene for example).  I don't want to have to go open mobilinc to execute the scene on command but rather do it from the message.  Is this even possible?

This has been stuck in my noggin.  I wanted to have a similar function to what you're looking for, without using any 3rd party products to do so.

Create an e-mail notification message with the text, including the quotation marks:
   "http://x.x.x.x:yy/rest/nodes/${sys.node.#.addr}/cmd/DON/255"     
    x.x.x.x. = your ISY ip address  yy = your ISY port (if not 80) These must be entered manually into the email subject or body as there is no easy substitution to get the systems address.

If you put the above in to a e-mail notification you would be able to click the resulting link and your default browser should take you there.  In this case the link would turn on whatever device tripped the notification.  As I did not include authorization information in the link you should be prompted for your id/password.  Once the command is entered you will receive a result code message from the ISY to let you know if the command succeeded or failed.  You could pretty up the link any way you want using standard html code in the email.

In my case I created a quick program that looked for an OFF command to this Lamplinc, address 14 52 18.  The "Then" command was to Notify and send me an email, using the above substitution, with the resulting link "http://192.168.1.155:82/rest/nodes/14 52 18 1/cmd/DON/255".

The basic commands would be

On = "http://x.x.x.x:yy/rest/nodes/${sys.node.#.addr}/cmd/DON/255"  
Off = "http://x.x.x.x:yy/rest/nodes/${sys.node.#.addr}/cmd/DOFF/0""
Set a Variable = "http://x.x.x.x:yy/rest/vars/set/1/88/zz"                          In this example, 1 = Integer variable  (2= State Variables),  88 = Integer Variable Number,  zz = set value.  zz can only be a decimal numeric.  Any chars other than 0-9 will cause the command to fail.
Run program = ""http://x.x.x.x:yy/rest/programs/pppp/runThen"   pppp=Program #  :Options = run, runThen, runElse, stop, enable, disable, enableRunAtStartup, disableRunAtStartup

https://wiki.universal-devices.com/index.php?title=ISY_Developers:API:REST_Interface has the complete set of commands available.

P.S.  Remember to take a backup before you start messing around with the REST (or any) API.

Link to comment
Is there any way to package the UID/PWD not in plain text within the URL?

 

Jeff

 

Not as far as I know with IOS.

 

Just another reason I prefer Android/Tasker/Autoremote and Autonotification. There is no equivalent feature available under IOS due to the Apple AppStore policies.

 

If you use ISY Portal you could create ‘IFTTT’ rules (these provide inbound webhooks that can be configured to trigger actions on ISY) - and this means it’s a long security token instead of a username and password. Better, but still not perfect.

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...