Page 1 of 1

Prowl plugin - send messages to iPhone/iPad

Posted: Wed Jan 02, 2013 11:30 am
by mickelin
I have put together a simple Prowl plugin that lets you send messages to your iOS device(s). Great for getting push notifications from EventGhost when you are away from home etc. This plugin sends directly to the iOS device, no need to install Growl.

You need to purchase the Prowl app from App Store, register an account at http://www.prowlapp.com and generate an API Key that you enter in the plugin config. The rest should be fairly straight forward. You can specify your own message parameters or forward {eg.event.string}, {eg.event.payload} etc.

In addition to showing the message, Prowl also lets you start an app on the device or redirect to a web page when the message arrives. For instance, you could have a motion detector at home, let EventGhost send a message when motion is detected, and have Prowl redirect to a web camera on the iPhone, showing you what's going on.

It uses Jacob Burch's prowlpy library (included) and some code is borrowed from Pako's Growl plugin. Thanks guys!

Try it and let me know what you think.

/mickelin

Newest version always here:

Version 0.2 - added support for unicode characters in message

Re: Prowl plugin - send messages to iPhone/iPad

Posted: Thu Jan 03, 2013 5:42 pm
by krambriw
Nice, thank you,
Initial test is working fine, currently using Growl and Growl plugin in my "production system" but it is always nice to remove software layers in between...

BestR Walter

Re: Prowl plugin - send messages to iPhone/iPad

Posted: Thu Jan 03, 2013 6:22 pm
by mickelin
Thanks! Yes, I wrote it because I wanted to avoid installing any extra software on my "production system" :D Trying to keep it to a minimum to ensure stability.

Re: Prowl plugin - send messages to iPhone/iPad

Posted: Sun Jan 06, 2013 3:18 am
by User1306
works perfectly, amazing thanks :D

Re: Prowl plugin - send messages to iPhone/iPad

Posted: Sun Jan 13, 2013 4:24 pm
by mickelin
I'm trying to add support for unicode characters (ÅÄÖ) but the whole encoding thing has got me confused. Adding .encode(eg.systemEncoding) to the message parameters gets rid of the Python errors, but the messages turn up in Chinese characters on the iPhone! Any tips on properly handling unicode? I have read a lot but still can't get it right.

Re: Prowl plugin - send messages to iPhone/iPad

Posted: Sun Jan 13, 2013 6:28 pm
by krambriw
You could try the code below, it works fine for me after the change and restart of EG (I receive ├Ñ├ñ├ in my iPhone). It might be that you could do it smarter in a way but I think this was simple and easy enough.

BestR

Code: Select all

    def Push(self, application, event, description, url, prio):
    	p = Prowllib.prowlpy.Prowl(self.apikey)
    	try:
    	    p.post(
    	        application.encode('utf-8'),
    	        event.encode('utf-8'),
    	        description.encode('utf-8'),
    	        prio,
    	        None,
    	        url
    	    )
    	except Exception,msg:
    	    print msg

    def QuickPush(self, message):
    	application = eg.ParseString(self.application)
    	event = eg.ParseString(self.event)
    	p = Prowllib.prowlpy.Prowl(self.apikey)
    	try:
    	    p.post(
    	        application,
    	        event,
    	        message.encode('utf-8'),
    	        self.prio,
    	        None,
    	        self.url
    	    )
    	except Exception,msg:
    	    print msg

Re: Prowl plugin - send messages to iPhone/iPad

Posted: Sun Jan 13, 2013 7:24 pm
by mickelin
That did it, thanks Walter! :D

Re: Prowl plugin - send messages to iPhone/iPad

Posted: Wed Jan 30, 2013 11:34 am
by Rauna
Hi

Stupide question, where do you put the code to get ├Â├ñ├Ñ ?

Kenneth

Re: Prowl plugin - send messages to iPhone/iPad

Posted: Wed Jan 30, 2013 11:35 am
by Rauna
Hi

Stupide question, where do you put the code to get ├Â├ñ├Ñ ?

Kenneth

Re: Prowl plugin - send messages to iPhone/iPad

Posted: Wed Jan 30, 2013 6:36 pm
by mickelin
New version with Walter's unicode fix in first post