Custom mini-client-apps

Posted on
Tue Jul 16, 2019 4:19 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Custom mini-client-apps

I'm not sure if this has been requested before, but if it has, then just make this a +1

I would like to be able to have single function mini apps for use on iOS. I am assuming these would be created in the Indigo-Touch client app, but how they are created is not really an issue.

The function of the mini-app would be to transmit a message to the Indigo server, presumably to be used to fire a trigger. As such, the functioning would be similar to a widget on a control page. The main difference is this would be a stand-alone app on the iOS desktop. It "would be nice" to be able to select icons from a small group of included icons and also to set the name. Whether the app's message would be configurable, or simply identifiable in Indigo (I.e. numbered) is less important than the functionality itself. Or, possible the mini-app would simply be an instance of an Indigo device and the icon could have two states (on and off).

Example, I could create a dedicated app to operate the garage door. While this basic functionality is already available through control pages, actions and devices in Indigo-Touch, navigating to them, especially while driving, walking, etc. can take time, and is a distraction. Having a dedicated app would make it much easier.

Posted on
Tue Jul 16, 2019 8:58 am
jay (support) offline
Site Admin
User avatar
Posts: 18221
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Custom mini-client-apps

We do have a feature request on the list to enable direct Shortcut integration, which I think would allow the user to create a shortcut that could be added to the home screen which would basically do what you're talking about.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Jul 16, 2019 11:17 am
Dual offline
Posts: 259
Joined: Feb 05, 2019

Re: Custom mini-client-apps

+1 for the concept


Sent from my iPhone using Tapatalk

Posted on
Wed Jul 17, 2019 10:24 am
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Custom mini-client-apps

+1 as well!
FWIW- my kludge for doing this is via a Shortcut with it’s own icon.

The shortcut is:
Image
It runs locally so i don’t need to port forward my ssh port to the internet, and I just vpn to my lan. It could easily be adjusted to run via a reflector address, using Indigo’s RESTful interface.

I make icons for the shortcuts on the main iphone screen using the Home Screen Icon Generator: https://www.icloud.com/shortcuts/c20522 ... 3ab2ae734a

It’s really helpful for commonly used commands.

Posted on
Wed Jul 17, 2019 10:34 am
jltnol offline
Posts: 994
Joined: Oct 15, 2013

Re: Custom mini-client-apps

Would it be possible to create a web page in Indigo to do what you need, and then stick that webpage to your home screen in iOS?

Posted on
Wed Jul 17, 2019 10:58 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Custom mini-client-apps

mundmc wrote:
...FWIW- my kludge for doing this is via a Shortcut with it’s own icon....

You are having quite a week. First the post on linear actuators and now this. Great ideas, Thanks.

jltnol wrote:
Would it be possible to create a web page in Indigo to do what you need, and then stick that webpage to your home screen in iOS?

That would still require the web page actually loading and then pressing some widget on the page. So, it wouldn't really be what I wanted. However, it should be possible to save a web shortcut to a RESTFul API call and that, like @mundmc's suggestion would meet my needs. I will try that and post back.

Thanks to you both.

Posted on
Wed Jul 17, 2019 12:02 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Custom mini-client-apps

berkinet wrote:
... I will try that and post back.....

Well, RESTFul API calls do not seem to work the same on iOS as on MacOS. Even with the user_name and password included in the URL, like:
Code: Select all
http://berkinet:secret@192.168.1.10:8176/actions/toggleDeskLight?_method=execute
This works on desktop safari. But, on iOS it still opens up a dialog box to enter the authentication credentials. There may be some way to make this work. I'll look around.

Now, about the Ssh run action group. Yes, that works. However, it is a little less clean than I would like... The Shortcuts app stays open after executing the command. There is a kludge to fix that on Reddit that is a bit ugly (several screen flashes) but it does work. I will continue to look into the Shortcut to see if I can improve what I now have.

Thanks to all who have gone before me.

Posted on
Wed Jul 17, 2019 3:55 pm
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Custom mini-client-apps

I forgot about the passing of credentials in ios browsers. Maybe try the ios schema:
indigodomo://

I use THAT to open control pages via the aforementioned shortcut creator, and it uses credentials stored in the Indigo ios app. I’m unsure if it works for anything other than control pages, but i have a hunch it might.

(And thanks for your kind words)

Posted on
Thu Jul 18, 2019 2:25 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

So, on a whim...

mundmc wrote:
I forgot about the passing of credentials in ios browsers. Maybe try the ios schema:
indigodomo://
... I’m unsure if it works for anything other than control pages, but i have a hunch it might.

Progress.

First I tried just entering an Indigo RESTFul API URL with credentials in the url (user:pass@...) and that worked. Actually, much snappier than the SSH method.

Inspired, I then searched for a way to do digest authentication in a Shortcut and found this page. Coincidentally (or not) this was from @alphaman - an Indigo user. The Shortcut more-or-less worked, but hung while waiting for a response. I changed the Request Body to json and that solved the problem. Well, mostly, the call still logs an error in Indigo
Code: Select all
 WebServer                       request to execute action group "toggleDeskLight" from 192.168.5.109
   Action Group                    toggleDeskLight
   Z-Wave                          sent "Computer Desk Light" on
   WebServer                       access denied "http://192.168.5.10:8176/actions/toggleDeskLight" from berkinetfr @ 192.168.5.109
But, that appears to be because of how the authentication is done (as noted in the link above).

As for indigodomo:// No joy. While Indigo-Touch will accept indigodomo://actiongrourp/foo without error, it doesn't actually do anything. Maybe soon :wink:

Posted on
Thu Jul 18, 2019 4:20 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: So, on a whim...

berkinet wrote:
...]Progress...

And, perhaps, a better solution. It seems if you have Pythonista (Available in the app store for USD10) installed you can run Python scripts in Shortcuts. So, this simple script (which works on MacOS) should do the trick (after I spend the $10).
Code: Select all
import requests
from requests.auth import HTTPDigestAuth
url = 'http://192.168.1.10:8176/actions/toggleDeskLight?_method=execute'
requests.get(url, auth=HTTPDigestAuth('berkinet', 'xxxxxxxx'))

Posted on
Thu Jul 18, 2019 5:18 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: So, on a whim...

berkinet wrote:
...And, perhaps, a better solution. It seems if you have Pythonista (Available in the app store for USD10) installed you can run Python scripts in Shortcuts. So, this simple script (which works on MacOS) should do the trick (after I spend the $10)...

Which, as I now see from this post @mundmc is more than aware of. Once again, following in great footsteps.

Posted on
Thu Jul 18, 2019 6:12 am
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Custom mini-client-apps

berkinet wrote:
Once again, following in great footsteps.


Ha- be careful though, you’ll note at least one of my foot steps has dog poop remnants in it, and observe how they easily and frequently veer off towards shiny objects.

It occurred to me Pythonista might help, but I swear-to-god i was trying to keep it simple. Glad you got digest working.

Posted on
Thu Jul 18, 2019 6:19 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Custom mini-client-apps

mundmc wrote:
berkinet wrote:
Once again, following in great footsteps.


Ha- be careful though, you’ll note at least one of my foot steps has dog poop remnants in it, and observe how they easily and frequently veer off towards shiny objects.

It occurred to me Pythonista might help, but I swear-to-god i was trying to keep it simple. Glad you got digest working.

:shock: One issue with Pythonista and Run Script. Pythonista wants to stay open and the trick about using launcher://homescreen doesn't work, because the shortcut never gets past Pythonista.

Posted on
Thu Jul 18, 2019 6:36 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Custom mini-client-apps

berkinet wrote:
...One issue with Pythonista and Run Script. Pythonista wants to stay open and the trick about using launcher://homescreen doesn't work, because the shortcut never gets past Pythonista.

Ok, solved.
Code: Select all
import webbrowser
...
...
webbrowser.open('launcher://crash')
Crude, but it works.

Posted on
Thu Jul 18, 2019 10:56 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Custom mini-client-apps

And, after a little playing around, I realized I can write a generic RESTFul API interface and pass arguments to it from Shortcuts to do whatever I need.
For example:
    var1 = devices|actions|variables
    var2 = the name of the device, action or variable
    var3 = the action (on|off|toggle|setpoint|etc.)
    var4 = any required value for var3

I'll post the script and instructions when I have it cleaned up.

Who is online

Users browsing this forum: No registered users and 25 guests

cron