Premise Jabber IM system events using Python

Motorola Premise

dinki

Member
One of things I've always wanted was a realtime notification of things that are going on at home while I am at work. I have the beginnings of something along those lines and thought I'd share with the rest of you guys as you might have your own use for this sort of thing. Please note that I am far from being a programmer so keep that in mind when you see how I approach things.

You will need the following to use the program I've written for it's intended purpose:

Two free IM accounts from http://www.jabber.org/index.php/create-an-account/
Python 2.x
XMPPY
Premise logging module
My Python program (attached)

Install Python and XMPPY. Add the path to your Python install to your windows PATH environment variable. Install the logging module in Premise. Edit the variables in my program to match your IM accounts and log path. You can log into www.meebo.com for a browser-based no-install IM client rather installing the jabber client.

You can place my program anywhere and just double click it to start it up. It will open the log file and will monitor the file for any new lines. The script will IM any lines added to the log file in realtime.

I plan on working on cleaning up a bit of the output to make it a bit more readable but for the most part, this is a decent one way alert for keeping an eye on things when away from home. If there is any interest, I can probably wrap this thing up as an executable and pull the variables from command line arguments. I will need to add a way to check for the log filename change when a new day starts.

Oh well, thought some might find this interesting ...View attachment 2528
 

Attachments

Thanks for contributing this utility!

This Python-based app is 'loosely coupled' with Premise because it communicates via the contents of a text file. Food for thought: You can use Python to write a Windows Script Component (WSC) and then call the component from within Premise. A WSC provides tighter coupling and opens up Premise to use resources developed in other programming languages, like Python. Osler, a HouseBot user, has developed a WSC for a Proliphix thermostat and it *should* work with Premise.

A Jabber WSC would have methods that allow a Premise class, like a MediaZone, to transmit the title of the currently playing song to a Jabber client.

So many possibilities, so little time to explore all of them ...
 
Back
Top