Siriproxy is back!!! (um, functionally)

Posted on
Fri Oct 12, 2018 11:18 am
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

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

Downloading Pythonista now. Looking forward to seeing what this puppy can do.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Fri Oct 12, 2018 11:22 am
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

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

Just downloaded it too. At 9.99 they should be making some good money off us all this week!


Sent from my iPhone using Tapatalk

Posted on
Fri Oct 12, 2018 11:38 am
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

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

I will add, while the Pythonista folder was visible in Finder (with the COMMAND+SHIFT+DOT shortcut), I was also unable to get it to show up in either PyCharm or BBEdit. My workaround was to open a Terminal window at the Pythonista folder and issue the following command:

Code: Select all
touch hello_world.py

After that, it showed up. GUESS: I am guessing that the folder is not showing up because it's empty--at least on Mojave. Once there was a file in the folder, it was visible.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Fri Oct 12, 2018 2:25 pm
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

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

DaveL17 wrote:
Downloading Pythonista now. Looking forward to seeing what this puppy can do.


As a grateful user of your plugins, I’m giddy over the thought of what may be in store.


Sent from my iPhone using Tapatalk

Posted on
Fri Oct 12, 2018 4:56 pm
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

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

Awesome. Got a test script working.

Notes for others trying. I got script errors entering the samples code from the initial screenshots and needed brackets on the print commands, as this.

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

Also use internal IP address unless you have port forwarding on. I used my external (again following the example) and it didn't work initially.

And for newbies to Shortcuts, you create the shortcut with dictation which, when you run the shortcut , prompts for voice which becomes the variable.
It's only when you"Add to Siri" that you record the trigger phrase. Took me a few moments to figure that out.







Sent from my iPhone using Tapatalk

Posted on
Sun Oct 14, 2018 10:50 am
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

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

So, got all excited at being able to set custom timers by using Siri to change a variable value to say 30 or 55 as the number of minutes for a timer. However I stumbled at the indigo implementation. Is it possible to have a timer reference a variable for the time to run? I've tried doing %%v:varid%% but it seems to only want a value.




Sent from my iPhone using Tapatalk

Posted on
Sun Oct 14, 2018 11:12 am
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

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

siclark wrote:
So, got all excited at being able to set custom timers by using Siri to change a variable value to say 30 or 55 as the number of minutes for a timer. However I stumbled at the indigo implementation. Is it possible to have a timer reference a variable for the time to run? I've tried doing %%v:varid%% but it seems to only want a


I’m not in front of my machine, but under the plugin page for Timers and Pesters, https://wiki.indigodomo.com/doku.php?id=indigo_7_documentation:plugins:timersandpesters there is scripting info.

You have to have a timer device, but you can modify the time:

Code: Select all
 tId = "com.perceptiveautomation.indigoplugin.timersandpesters"
timerPlugin = indigo.server.getPlugin(tId)
if timerPlugin.isEnabled():
   timerPlugin.executeAction("setTimerStartValue", deviceId=1604521627, props={'amount':'30', 'amountType':'minutes'})

Posted on
Sun Oct 14, 2018 5:13 pm
BrianAz offline
Posts: 5
Joined: Jul 26, 2015

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

This is very nice, thanks for the tip!

I have crafted a simple python script that executes a single Indigo action ("GoToSleep" which turns off all the house lights, TVs, etc). The only issue I've run into so far is iOS/Siri doesn't want to let Pythonista run my script when my phone is locked. My intention was to set this up so I could say "Hey Siri, GoToSleep" as I was drifting off to sleep each night and have that launch the Indigo action.

As it stands right now, I need to unlock my phone before it will run the python script. I'd much prefer it if I did not need to unlock my phone as I am usually drifting off to sleep and don't want to grab my phone from the table. Has anyone found a workaround for that? I realize that this is a Pythonista limitation.

Side question for Jay/Indigo.. With iOS 12 introducing Siri Shortcuts for apps directly, is this on the radar for the Indigo iOS app? While the python option is nice, I think a direct integration would be the ideal solution. With Pandora for example, I am able to setup Siri Shortcuts such as "Play Classic Rock Radio" and Siri will execute it while my phone is locked. Same with Remote for Tautulli for Plex.

Thanks
Last edited by BrianAz on Sun Oct 14, 2018 7:20 pm, edited 3 times in total.

Posted on
Sun Oct 14, 2018 6:34 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

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

BrianAz wrote:
is this on the radar for the Indigo iOS app?

Definitely something we'll be investigating.

Image

Posted on
Mon Oct 15, 2018 3:31 pm
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

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

mundmc wrote:
siclark wrote:
You have to have a timer device, but you can modify the time:

Code: Select all
 tId = "com.perceptiveautomation.indigoplugin.timersandpesters"
timerPlugin = indigo.server.getPlugin(tId)
if timerPlugin.isEnabled():
   timerPlugin.executeAction("setTimerStartValue", deviceId=1604521627, props={'amount':'30', 'amountType':'minutes'})


Cheers. I gave this a go but can't replace the 30 with a variable. Shows up my lack of python

Trying to do this, but get an error

napMin = (indigo.variables[1773146389]) # "NapTime"

timerPlugin.executeAction("setTimerStartValue", deviceId=36400889, props={'amount': newMin), 'amountType': 'minutes'})



Sent from my iPhone using Tapatalk

Posted on
Mon Oct 15, 2018 3:39 pm
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

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

siclark wrote:
mundmc wrote:
siclark wrote:
You have to have a timer device, but you can modify the time:

Code: Select all
 tId = "com.perceptiveautomation.indigoplugin.timersandpesters"
timerPlugin = indigo.server.getPlugin(tId)
if timerPlugin.isEnabled():
   timerPlugin.executeAction("setTimerStartValue", deviceId=1604521627, props={'amount':'30', 'amountType':'minutes'})


Cheers. I gave this a go but can't replace the 30 with a variable. Shows up my lack of python

Trying to do this, but get an error

napMin = (indigo.variables[1773146389]) # "NapTime"

timerPlugin.executeAction("setTimerStartValue", deviceId=36400889, props={'amount': newMin), 'amountType': 'minutes'})


Try this (sorry I’m on Tapatalk and can’t put it in code). :

napMin = indigo.variables[1773146389].value # "NapTime" Note I added “.value”

timerPlugin.executeAction("setTimerStartValue", deviceId=36400889, props={'amount': newMin, 'amountType': 'minutes'})
#note your parens weren’t balanced there.

Good attempt! This was me about 6 months ago trying to script Hue lights.

Also, when in doubt, use a bunch of log statements:
indigo.server.log(str(napMin))



Sent from my iPhone using Tapatalk

Posted on
Tue Oct 16, 2018 1:50 pm
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

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

Perfect that did it.

And for anyone else wondering how to close the pythonista app after the script runs.

import os
os.abort()

Posted on
Tue Oct 16, 2018 1:51 pm
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

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

And now we just need a way to do the same with Alexa


Sent from my iPhone using Tapatalk

Posted on
Tue Oct 16, 2018 2:13 pm
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

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

Closest i’ve come to similar with Alexa involves using a web scraper and python browser to grab the most recent item in Alexa’s history.

Posted on
Tue Nov 06, 2018 9:53 am
anyone offline
User avatar
Posts: 125
Joined: Apr 03, 2011
Location: Norfolk, VA

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

I was getting frustrated with the Run Script Over SSH action available in Siri Shortcuts, trying to overcome a handful of glitches, preventing me from getting it to work and I came across this discussion. I should've started here. :lol:

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

Me: "Hey Siri broadcast" <--I'm still trying to come up with something that sounds right.
Siri: Running your shortcut.
iPhone: Chime
Me: "I hope the forum finds this post useful"

A script very similar to the one in this thread, runs on the Mac at 192.168.1.2 and updates an Indigo variable with the results of the dictation.

Only problems encountered in my couple of days playing with are your iPhone has to be unlocked.
The top action “Continue Shortcut in App” , is required and is likely do to a minor bug in the App.
Attachments
IMG_3008.png
IMG_3008.png (115.08 KiB) Viewed 3281 times

Who is online

Users browsing this forum: No registered users and 3 guests