Coder Social home page Coder Social logo

siriapi8's Introduction

#SiriAPI8 Does not work on iOS 9 SiriAPI8

SiriAPI8 opens Siri for your own purposes. You can use it to redirect any Siri command to any computer (Windows, Linux and Mac OS) without a Jailbreak. This is the only API that works with iOS8. In opposite to previous implementations you don't even need to be in your homes network! When your server is running, you can use SiriAPI8. I use SiriAPI8 for my home automation system to control the lights. Since I also developed the original SiriAPI (https://github.com/HcDevel/Siri-API) which was compatible with iOS 7, I have a lot of experience in this matter and the basic algorithms were already tested by a big community. The use and installation of SiriAPI8 became much easier. You are not forced to use a Linux computer as a server anymore since Squid proxy is no longer required. Any operating system which is able to run the Python 3 interpreter will support this tool.

How does it work?

Basically you just create notes with a defineable keyword. By default you say "Create a note iPhone ...". In this case iPhone is the keyword. SiriAPI8 which runs on your own computer and doesn't send any information to other servers than Apple's your data keeps safe, scans your iCloud notes for this keyword. When the keyword is found, anything what you said after the keyword can be checked for predefined sentences and trigger your own Python scripts. The easy to use API helps you to concentrate on your plans and not the software. Also wildcards are supported. When you haven't blocked Siri access from the lock screen you can also use "Hey Siri" without unlocking your phone! In the original SiriAPI you always had to unlock your phone. You can watch a demo video on YouTube (TODO: Add link). I tested and developed SiriAPI8 on an iPhone 5s with iOS8 but it should be compatible with any other iPhone which supports Siri. Users of iOS <=7 have the choice between SiriAPI8 and the original implementation.

Installation

The installation instructions can be found in the wiki. In comparision to the original SiriAPI they decreased to a few commands. If you have any problem or found bugs, please report them in the Issue tracker.

Instructions: https://github.com/HcDevel/SiriAPI8/wiki/Installation

Issues: https://github.com/HcDevel/SiriAPI8/issues

siriapi8's People

Contributors

robinmeis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

siriapi8's Issues

Clarification needed

Hello. I am new to GitHub and I'm not sure if I am posting this in the correct location. I apologize if this is not the correct place for this post.

I really have a question instead of an issue. I am trying to understand the use case of your program compared to what I am looking to accomplish. My ask is pretty basic. I wish to use Siri for home automation but specifically have keywords in Siri open url's to my home automation system. The URL will contain the function that needs to be performed.

For example, if I were to ask Siri to turn on the master bedroom lights it would open a URL such as "http://myautomationsystrm.com/siricommand=turn&on&master&bedroom$lights". I have written a function in my home automation system that looks for keywords anywhere in the string so I don't need to perform that outside of my existing program.

I realize Apple is very restrictive and I'm not new to the challenges of having IOS work outside of what Apple wants. I used to use Siriproxy for this and all of my old code still exists. I'm just trying to figure out how your program can help me with this use case. I have read your documentation but something isn't clicking for me. You mention a link to a video in your readme but the link wasn't listed.

I thank you in advance for your time.

How to connect

How can i connect my iPhone to my server which is running this API?

iOS 9 compatibility

I have iOS9 installed i get this response from the example:
SiriAPI8 error: No action defined for < html>< head>< /head>< body>< div>iPhone hallo Carsten< /div> < /body>< /html>

Are there some changes needed for the search engine?

Migration from SiriAPI

First of all -- Thank You! I can't wait to try it out this weekend!

Second -- are there any instructions on migrating from the older SiriAPI to SiriAPI8? I invested a lot into the old version and still use it via Voice Commands. Can't wait to get back to using with Siri!

Thanks

two factor

Will this work if you have two-factor authentication turned on? I guessing that is why it comes back to me saying,

Exception: Login to iCloud failed. Check user credentials

even though I have entered the correct userrname/password into example.py.

imap error

I am getting this error on running the example.py. Any ideas how to resolve this?

Traceback (most recent call last):
File "example.py", line 11, in
SiriAPI.connect() #Connect to iCloud
File "/Users/jbhambhwani/Documents/SiriAPI8/SiriAPI8/SiriAPI.py", line 43, in connect
typ, data = self.connection.search(None, 'ALL', 'SUBJECT "' + self.keyword + '"') #Delete unhandled commands with keyword (TODO: deal with alternative execution in future)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/imaplib.py", line 660, in search
typ, dat = self._simple_command(name, *criteria)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/imaplib.py", line 1133, in _simple_command
return self._command_complete(name, self._command(name, *args))
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/imaplib.py", line 881, in _command
', '.join(Commands[name])))
imaplib.error: command SEARCH illegal in state AUTH, only allowed in states SELECTED

How do I use GET in this implementation

Hello!

In previous SiriAPI, you have used a file called command.py . In this file, we could use html.request and put the URL where the smarthome server would be using.

Now, I am unable to use it in the example.py file.

How to I open a page, or send a GET in this implementation?

Example:
def hello(q, wildcards): #Answer function
html.request('10.1.1.3:8082/TurnMyLightsON'
print ("You said Hello to " + wildcards[0])

Thanks a lot!

Compatibility raspberry ?

Hello , I wanted to know if this version is compatible with raspberry . I have installed and starts but does not detect my voice.
No I have to configure anything on my phone? siriApi8 according to the tutorial is not necessary .
Thank you very much .

Problem with calling functions

Hi,

I mostly managed to make it working - siri is creating notes and after calling example script notes are being deleted. this gives me knowledge that there are connections established and script can find correct keyword.

Problem is that I do not see output from called command - even if my test functions should only print some text in console I gets nothing. Is there any debug option to check it? When I call function manually it works fine - only calling via SiriAPI.action.add gives no result at all.

Mehrere Befehle & Dauerschleife

Hey eine kleine frage.
bei mir hat die example alles gut geklappt wie bekomme ich es aber hin das ich verschiedene dinge sagen kann und das es es dauernt abfrägt.
mfg

get_version is not defined

Installed setuptools per your issue response and installed successfully. Thanks!

Try to run examply.py and receive the following error:

~/SiriAPI8 $ sudo python3 example.py
Traceback (most recent call last):
File "example.py", line 7, in
print(get_version())
NameError: name 'get_version' is not defined

If I comment out line 7, it runs fine and I am able to execute the hello world example.

Redirect to browser

First -- Great job on the program! I was able to use my iPhone 6 to send commands to my home automation system!

Second, with SiriAPI I also used the document class to do things like open netflix.com with a search on a wildcard. How would I do this with SiriAPI8? Here is what I used in SiriAPI:

def addmovietonetflix(self, q, wildcards):
html = document(self.connection)
html.title("SiriAPI")
html.outgoing(q)
html.redirect("http://dvd.netflix.com/Search?v1=" + wildcards[0])
html.send()

Sorry, but the example.py seems doesn't work...

Change your Email address to your iCloud Mail address and the password
// I used my iCloud Mail and the password of my Apple ID, is it right?

Now you can run example.py as described in the installation instructions
// Output:
// ~/SiriAPI8 $ sudo python3 example.py
// 8.0.0
// Press any key...

Open Siri and say create note iphone hello anybody. Also try to say other names than anybody
// I used Siri and the note was created, but the Terminal has no change...

Need your help, thanks!

Error when running example.py

Hi

I have correctly installed SiriAPI through the zip download on my MacBook, and could compile everything. Now when i'm running "sudo python example.py" i get the following error after about 5 Seconds:

MacBook-Pro:SiriAPI8-master username$ sudo python example.py
8.0.1
Traceback (most recent call last):
  File "example.py", line 11, in <module>
    SiriAPI.connect() #Connect to iCloud
  File "/Users/teemoe/Downloads/SiriAPI8-master/SiriAPI8/SiriAPI.py", line 43, in connect
    typ, data = self.connection.search(None, 'ALL', 'SUBJECT "' + self.keyword + '"') #Delete unhandled commands with keyword (TODO: deal with alternative execution in future)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/imaplib.py", line 627, in search
    typ, dat = self._simple_command(name, *criteria)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/imaplib.py", line 1070, in _simple_command
    return self._command_complete(name, self._command(name, *args))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/imaplib.py", line 905, in _command_complete
    raise self.error('%s command error: %s %s' % (name, typ, data))
imaplib.error: SEARCH command error: BAD ['Invalid Search criteria']

What am i doing wrong? If i try to make an error on purpose in my icloud login, it gives me a different error message, so that's not the issue. I tried editing notes and adding and deleting on my iphone and it's synced nearly in realtime. Do i need to have the Notes.app on OSX open and running all the time?

Thanks!

Verbindungsabbruch bei telnet

Hallo,

super Programm hast du geschrieben, habe ein Problem hoffe du kannst mir helfen.
Möchte gern innerhalb des Programm mithilfe von telnet auf fhem zugreifen um dort ein befehl einzugeben. Aber sobald ich das Passwort für den Port eingebe verliert SiriAPI8 die Verbindung und meldet sich darauf neu an.

Ich kopier dir hiermal die Programmstücke rein vllt kannst du mir helfen:

import telnetlib
import sys

host="192.168.178.22"
port="7072"
pas="1234" #Passwort für telenet in fhem

def fernseher(q, wildcards):
if 'an'== wildcards[0]:
print ("Fernseher " + wildcards[0])
tel=telnetlib.Telnet(host,port)
tel.read_unitl("Password:")
tel.write(pas +"\n")
tel.write('set MAX_0ddb3 desiredTemperatur 22.0')+b"\n")
tel.write(b"exit\n"

hab über Kommetare (#) herrausgefunden das der bei tel.write(pas...) also beim einloggen mit Password die Verbindung verliert und den Befehl dann nicht weiter ausführt.
Nur den Telnet teil über ein seperates Skript ausgeführt funktioniert.

iCloud login fail

Hallo,

Hoffe du kannst mir helfen. Ich habe SiriAPI8 nach deiner Anleitung installiert und dann in der example.py meine Email und das Passwort hinterlegt. Wenn ich die Datei dann in der Konsole mit Python 3 ausführe, zeigt er mir erst die Version (8.0.1) an, bricht das Programm aber dann ab und sagt mir als Fehlermeldung: Login to iCloud failed. Check user credential.
Habe aber Emailadresse und Passwort richtige eingetragen.

Socket errors

After running for several days, SiriAPI8 stopped working with the following exceptions. On restart, things are working fine again. I'll report back if I see this again, but debugging this is way out of my league...

Connection failure
Logout succesful
Trying to reconnect
Exception in thread Thread-1:
Traceback (most recent call last):
File "/home/pi/SiriAPI8/SiriAPI8/SiriAPI.py", line 86, in __fetch
self.connection.noop()
File "/usr/lib/python3.2/imaplib.py", line 605, in noop
return self._simple_command('NOOP')
File "/usr/lib/python3.2/imaplib.py", line 1121, in _simple_command
return self._command_complete(name, self._command(name, *args))
File "/usr/lib/python3.2/imaplib.py", line 949, in _command_complete
typ, data = self._get_tagged_response(tag)
File "/usr/lib/python3.2/imaplib.py", line 1064, in _get_tagged_response
self._get_response()
File "/usr/lib/python3.2/imaplib.py", line 977, in _get_response
resp = self._get_line()
File "/usr/lib/python3.2/imaplib.py", line 1074, in _get_line
line = self.readline()
File "/usr/lib/python3.2/imaplib.py", line 265, in readline
return self.file.readline()
File "/usr/lib/python3.2/socket.py", line 287, in readinto
return self._sock.recv_into(b)
File "/usr/lib/python3.2/ssl.py", line 399, in recv_into
return self.read(nbytes, buffer)
File "/usr/lib/python3.2/ssl.py", line 293, in read
v = self._sslobj.read(len, buffer)
socket.error: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/pi/SiriAPI8/SiriAPI8/SiriAPI.py", line 32, in connect
self.connection = imaplib.IMAP4_SSL("imap.mail.me.com", "993") #Connect to s erver
File "/usr/lib/python3.2/imaplib.py", line 1194, in init
IMAP4.init(self, host, port)
File "/usr/lib/python3.2/imaplib.py", line 170, in init
self.open(host, port)
File "/usr/lib/python3.2/imaplib.py", line 1206, in open
IMAP4.open(self, host, port)
File "/usr/lib/python3.2/imaplib.py", line 246, in open
self.sock = self._create_socket()
File "/usr/lib/python3.2/imaplib.py", line 1197, in _create_socket
sock = IMAP4._create_socket(self)
File "/usr/lib/python3.2/imaplib.py", line 236, in _create_socket
return socket.create_connection((self.host, self.port))
File "/usr/lib/python3.2/socket.py", line 397, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
socket.gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.2/threading.py", line 740, in _bootstrap_inner
self.run()
File "/usr/lib/python3.2/threading.py", line 693, in run
self._target(_self._args, *_self._kwargs)
File "/home/pi/SiriAPI8/SiriAPI8/SiriAPI.py", line 97, in __fetch
self.connect(False)
File "/home/pi/SiriAPI8/SiriAPI8/SiriAPI.py", line 34, in connect
raise Exception("Connection to iCloud failed. Check your internet connection ")
Exception: Connection to iCloud failed. Check your internet connection

getting rid of markdown

Hi
I just tested the SiriAPI and works nicely.
I have one little problem, from the example file I get a response with the markdowns

8.1.3
Press any key...
SiriAPI8 error: No action defined for <html><head></head><body>iphone hello you</body></html>

Where can I get rid of these ?

Thank you

Add umlaut handling

Currently umlauts aren't computed correctly which causes problems to german users.

IMAP problem

Hi all,

i have the following problem:

./example.py
8.0.2
Traceback (most recent call last):
File "./example.py", line 14, in
SiriAPI.connect() #Connect to iCloud
File "/root/SiriAPI8/SiriAPI8/SiriAPI.py", line 50, in connect
typ, data = self.connection.search(None, 'ALL', 'SUBJECT "' + self.keyword + '"') #Delete unhandled commands with key
word (TODO: deal with alternative execution in future)
File "/usr/lib/python2.7/imaplib.py", line 627, in search
typ, dat = self._simple_command(name, *criteria)
File "/usr/lib/python2.7/imaplib.py", line 1070, in _simple_command
return self._command_complete(name, self._command(name, *args))
File "/usr/lib/python2.7/imaplib.py", line 905, in _command_complete
raise self.error('%s command error: %s %s' % (name, typ, data))
imaplib.error: SEARCH command error: BAD ['Unexpected quoted string in SEARCH command']

Can someone helps me?

Regards
Nico

Install issue

On step 2.4, I received this error:
sudo python3 setup.py install

Traceback (most recent call last):
File "setup.py", line 3, in
from setuptools import setup
ImportError: No module named setuptools

Connection failure

When i execute a url request as in the my-personal-example.py, the code give some connection failure error. Without the res = json.loads... line it works great, but i like to execute a http request with basic authentication.

Input: Create note Siri disarm
Output:
8.0.1
Press any key...
Connection failure
Logout succesful
Trying to reconnect
Reconnected

My code:
from SiriAPI8.SiriAPI import *
import urllib.request
import json

def request (url): #HTTP request
f = urllib.request.urlopen(url)
return(f.read().decode('utf-8'))

def hello(q, wildcards): #Answer function
print ("You said Hello to " + wildcards[0])

def disarm(q, wildcards): #Answer function
res = json.loads(request("http://user:password@myip/cgi-bin/scada-remote/request.cgi?m=json&r=grp&fn=write&alias=10/0/2&value=1"))
print ("Disarm system " + res)

SiriAPI = SiriAPI("[email protected]", "mypwd") #Create SiriAPI8 object
print(SiriAPI.get_version())

SiriAPI.set_keyword('siri')

hello function

SiriAPI.action.add([['hello', '*']], hello) #Add answer function for hello *

connect KNX

SiriAPI.action.add([['disarm'],['this arm']], disarm)

SiriAPI.connect() #Connect to iCloud

input("Press any key...\n")
SiriAPI.disconnect() #Close connection

No action defined

the example.py reads, analysis and deletes the note on iCloud.
But it only comes to the error function, and q is the complete note "iphone hello anybodys name".
Unfortunately it says, No action defined for "...".
I could not figure out yet what's the problem for this and how the program ends at the error function.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.