Siriproxy is back!!! (um, functionally)

Posted on
Tue Nov 06, 2018 6:27 pm
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Re: Siriproxy is back!!! (um, functionally)

Wow- Weird that today was the day I was experimenting with running Indigo scripts from Shortcuts over SSH!

There are definitely some lags that are difficult:
“Hey Siri Broadcast”
BLEEP BLEEP
<<pause>>
“All of your base are belong to us.”
<<more pause>>
“ALL OF YOUR BASE ARE BELONG TO US>>

I guess SSH isn’t any quicker?


Sent from my iPhone using Tapatalk

Posted on
Tue Nov 06, 2018 11:21 pm
MarcoGT offline
Posts: 1091
Joined: Sep 11, 2014
Location: Germany

Re: Siriproxy is back!!! (um, functionally)

BrianAz wrote:
I have crafted a simple python script that executes a single Indigo action ("GoToSleep" which turns off all the house lights, TVs, etc).
Thanks


Could you please share the script?

Thanks

Posted on
Wed Nov 07, 2018 1:26 am
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

Re: Siriproxy is back!!! (um, functionally)

anyone wrote:

I don't own Pythonista's so can someone confirm the functionality is similar to what can be accomplished with SSH?



The biggest difference is that with pythonista the script runs on the phone, not the computer you are connecting to. May work faster that way?

Posted on
Wed Nov 07, 2018 2:15 am
BrianAz offline
Posts: 5
Joined: Jul 26, 2015

Re: Siriproxy is back!!! (um, functionally)

MarcoGT wrote:
BrianAz wrote:
I have crafted a simple python script that executes a single Indigo action ("GoToSleep" which turns off all the house lights, TVs, etc).
Thanks


Could you please share the script?

Thanks


Hope this comes through ok... posting from my phone.

Code: Select all
#!   /usr/bin/env   python2.7
#   -*-   coding: utf-8 -*-

from sys import argv
import requests
from requests.auth import HTTPDigestAuth

#for x in argv:
#   print("Argument: ", x)
#print(argv[1])

#url = 'http://192.168.30.91:8176/variables/API_Test?_method=put&value='+argv[1]

url = 'http://192.168.30.91:8176/actions/SiriGoToSleep?_method=execute'

try:
   requests.get(url, auth=HTTPDigestAuth('myusernamehere', 'mypasswordhere'))

except KeyError, error:
   indigo.server.log(u"restful_api_example.py KeyError: %s" % error, isError=True)

except TypeError, error:
   indigo.server.log(u"restful_api_example.py TypeError: %s" % error, isError=True)

except ValueError, error:
   indigo.server.log(u"restful_api_example.py ValueError: %s" % error, isError=True)

except Exception, error:
   indigo.server.log(u"restful_api_example.py Error: %s" % error, isError=True)

Posted on
Wed Nov 07, 2018 12:06 pm
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Re: Siriproxy is back!!! (um, functionally)

siclark wrote:
The biggest difference is that with pythonista the script runs on the phone, not the computer you are connecting to. May work faster that way?


That’s what I’m trying to figure out as well

Posted on
Wed Nov 07, 2018 12:17 pm
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

Re: Siriproxy is back!!! (um, functionally)

Guess it comes down to speed of program on phone and web updating of variable with simple web call Vs SSH Auth to the remote computer

Posted on
Wed Nov 07, 2018 2:37 pm
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

Re: Siriproxy is back!!! (um, functionally)

The advantage of pythonista is that if you have your python scripts in your iCloud folder on your indigo Mac, you can make changes on the go.
For instance to get my shortcut working I did everything whilst on the train.
That was getting the python script on phone working that set the variable on indigo, and bug fixing the script on my Mac that was triggered by the change in variable.

Posted on
Wed Nov 07, 2018 2:40 pm
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Re: Siriproxy is back!!! (um, functionally)

siclark wrote:
The advantage of pythonista is that if you have your python scripts in your iCloud folder on your indigo Mac, you can make changes on the go.
For instance to get my shortcut working I did everything whilst on the train.
That was getting the python script on phone working that set the variable on indigo, and bug fixing the script on my Mac that was triggered by the change in variable.


I also do 95% of my coding and planning on a train :)
If there is no speed advantage, Pythonista will remain my default.

PS- I started a thread under “ General Home Auto nation” asking if either people were interested in sharing iOS shortcuts, particularly as they relate to Indogo. Hope there is mutual interest!

Posted on
Wed Nov 07, 2018 9:25 pm
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Re: Siriproxy is back!!! (um, functionally)

Update on timing:
Shortcuts(for dictation)-> Pythonista(requests to REST interface)-> Indigo
... under 2 seconds with Pythonista open

Shortcuts(for dictation AND ssh with a command)
... under 1 second

Bottleneck is on iPhone switching to Pythonista.

Posted on
Thu Nov 08, 2018 12:08 pm
jay (support) offline
Site Admin
User avatar
Posts: 18219
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Siriproxy is back!!! (um, functionally)

Note, we've added a new iOS Shortcuts forum to the User Contributions section for sharing shortcuts.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Nov 08, 2018 1:15 pm
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Re: Siriproxy is back!!! (um, functionally)

Thanks Jay! Let’s see who winds up there. Hopefully no tumbleweeds.

Posted on
Sun Dec 09, 2018 4:25 pm
crofford offline
Posts: 34
Joined: Jan 26, 2006

Re: Siriproxy is back!!! (um, functionally)

Well, I discovered a slight issue with using the Pythonista script on your phone. I set up a script/shortcut so that I could open my garage door just by speaking as I approached my house. Everything was working fine while I was outside testing, but when I went in the house nothing would happen...no error, just nothing. During my head scratching my wife turned on some Christmas music. When I tested again...DOH! The HomePod was processing the Siri command and she asked me why her music kept cutting out, LOL.

Posted on
Sun Dec 09, 2018 9:24 pm
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Re: Siriproxy is back!!! (um, functionally)

crofford wrote:
Well, I discovered a slight issue with using the Pythonista script on your phone. I set up a script/shortcut so that I could open my garage door just by speaking as I approached my house. Everything was working fine while I was outside testing, but when I went in the house nothing would happen...no error, just nothing. During my head scratching my wife turned on some Christmas music. When I tested again...DOH! The HomePod was processing the Siri command and she asked me why her music kept cutting out, LOL.


That’s a freaking amazing bug! One my wife would kill me for, but amazing no less! I thought HomePod automatically shared Shortcuts or something, but I don’t have one. There really should be a thread for complex HA bugs like this.

Posted on
Sun Dec 23, 2018 11:51 pm
CliveS offline
Posts: 770
Joined: Jan 10, 2016
Location: Medomsley, County Durham, UK

Re: Siriproxy is back!!! (um, functionally)

Just noticed that Pythonista 3 is half price over Christmas down to $4.99/£4.99, dates from now to December 26th so the question, is it worth buying?

CliveS

Indigo 2023.2.0 : macOS Ventura 13.6.3 : Mac Mini M2 : 8‑core CPU and 10‑core GPU : 8 GB : 256GB 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
Mon Dec 24, 2018 12:23 am
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

Re: Siriproxy is back!!! (um, functionally)

Only if you like coding on the go. Been shown to be quicker to use SSH to run the code locally.


Sent from my iPhone using Tapatalk

Who is online

Users browsing this forum: No registered users and 4 guests