[mythtv] SMS your MythTV

Christian Hack christianh at pdd.edmi.com.au
Wed Sep 24 16:40:58 EDT 2003


Due to popular demand (OK one guy asked for it), here's my script which
allows me to SMS my MythTV box from anywhere in the world. I made this
particularly because I don't have an always on Internet connection, so
MythWeb wasn't all that useful to me. I almost always have a mobile
phone whereas internet access is a bit harder to get to sometimes.

Get it here:
http://www.hack.id.au

I would like to keep control of it initially so if you make any mods
please send them to me and I will update the perl script on the page.

As I mentioned earlier, it's a bit ugly and sometimes doesn't always
work, but it's currently good enough for what I want it to do. This is
the doco I added to it this afternoon - it's also in the actual script.
You need to get gnokii (and of course Myth) running first, change a few
constants at the top and set it up as a cron job and your done.

Let me know what you guys think.

#
# SMS to MythTV script 
#
# v1.0 Christian Hack 2003 (christian at hack.id.au)
#
# Uses gnokii to read specially formatted SMSes from some sort of Nokia
# phone. It then searches the MythTV MySQL database for matching
programs.
# If a matching program is found, an entry (or entries) is placed in the
# record database and the mythbackend is signalled a new entry has been
# made. It then sends a response SMS back to the initiating phone
listing
# what programs have been recorded.
#
# Developed with an old 5110 (busted LCD) and a MBUS cable built using
info
# from http://www.panuworld.net/nuukiaworld/hardware/cables/mbus.htm and

# Gnokii 0.5.2 in simple command line guise.
#
# If you modify it and/or make it better, bring it back to the
mythtv-dev list
# http://www.mythtv.org/mailman/listinfo/mythtv-dev so others can see
it.
# And please keep my name on it. Drop me a line if you use/like it.
#
# Usage:
#
# Send a simple SMS with 2 to 4 parameters separated by spaces.
#
# <callsign> <start> [end] [date]
#
# callsign = the callsign to match in the DB (i.e. in Australia my
callsigns
#            are 2, 7, 9, 10, 28 and 31
# start    = start time in 24 hour 3 or 4 digit format (i.e. 900 = 0900
or 2300 etc) 
#            start time of program. must be exact.
# end      = end time in 24 hour 3 or 4 digit format (i.e. 900 = 0900 or
2300 etc) 
#            if specified, all programs that start between start and end
inclusive
#            will be recorded.
# date     = date in DDMMYYYY format (if not specified the current local
MythTV date
#            is used)
#
# e.g.
#
# "9 2130" - would record whatever starts at exactly 9:30pm on chanid
with callsign 9 
# "9 2130 2230" - would record whatever starts between 9:30pm and
10:30pm inclusive
#                 on chanid with callsign 9. i.e. will record something
that starts at
#                 10:30pm
# "9 2130 2230 24092003 - as above but on the 24th September 2003.
#
# Simply call it by a cron job every 5 minutes or so.
#
# Response SMS will be of the format "<title> # <title> #". It will send
up to a max of
# 2 SMS responses (should there be more than 160 characters). Others
will be recorded,
# just not reported back in the SMS. If the entry already has a one-off
recording time,
# "(dup)"  will be appended in the response SMS
#
# e.g. "THE SIMPSONS # SEINFELD (dup) #"
#
# Known Bugs/Limitations:
# - doesn't handle or care about weekly/channel/always type recordings.
#   It appears Myth helps a bit there and doesn't double record.
# - doesn't allow for phones that sometimes lockup (i.e. my 5110)
# - will only read SMSes from the first 4 locations in phone memory
# - my callsigns are the numbers we know the channels by in Australia.
The 
#   script will search for the first chanid that matches that callsign.
This
#   may not work for others around the world, but it does fine for me.
# - if there are no matching entries in the DB, nothing is recorded even
#   if you know it's on. Could easily be added as a manual recording
perhaps
#   with a 5th parameter for a title.
# - it can probably be improved greatly but it does what I want for now.
#
# PS: Credits to Isaac Richards et al for the great MythTV project
#



More information about the mythtv-dev mailing list