[mythtv-users] Script to check/fix Sky (UK) channel numbers

David Greaves myth at dgreaves.com
Mon Jan 19 11:52:21 UTC 2009

Neil Bird wrote:
>   As promised, here's an alpha of my script to sanitise Sky channel
> numbers.  I didn't get a chance to revisit it over the W/E, but I did
> re-run it to double-check the output.
>   I'm not sure how practical it's going to be to get it to update the
> d/b itself, as I can't see myself trusting it enough (at least until
> such time as I/someone generates a definitive Sky#<->xmltvid list)
> [e.g., E4 is, apparently, on a diff. channel for NI to the rest of the
> UK, but it's difficult to cater for that from the digitialspy site].
>   As it stands, edit the details at the top (to get d/b host/user/pass
> and also [important!] the specific source_id for your Sky input.  Run
> it, and it should print some SQL that, in principal, will fix
> mis-matched channel numbers.
>   You probably want to go through ones you care about and check them
> manually before fixing anything!  Also, it [currently] presumes that
> both the channum AND freqid are the Sky number (as that's how I have
> it).  Also not sure how well it'll work with the radio channels (4 digit
> with '0' prefix) as they seem to be coming through too.
>   Any thoughts or improvements welcome!

Instead of getting the data from the Sky site would you be interested in getting
the data from the serial port on the box?
It may be easier than tracking website layout changes.

Here is a sample:

[{'tag': 'Current-Channel-Number', 'data': '129'}, {'tag':
'Current-Channel-Name', 'data': 'SCI FI'}, {'tag': 'Current-Time', 'data': '
9.00pm Mon 15 Dec '}, {'tag': 'Current-Programme-Start-Time', 'data': '9.00pm'},
{'tag': 'Current-Programme-Name', 'data': 'Eli Stone'}, {'tag':
'Current-Programme-Description', 'data': 'Waiting For That Day: Jonny Lee Miller
is a lawyer-turned prophet in this hit US comedy drama. Eli has a vision of an
earthquake striking the Golden Gate Bridge, but will anyone heed his warnings?'}]

This is emitted on the RS232 port every 60 seconds or on a channel change event.

A script is attached. It runs client server because my myth box only has 1
serial port and that does the IR blasting :D
It also works with skyd if you're using that - but this can function as an
all-in-1. You need to setup the serial port; I don't do that in perl ATM.

Connect to the listen_port and send a string, eg : "Current-Channel-Number\n"

The response will be:
This tells you that it is on channel 103 and the last update was
1229528943 seconds since the epoch.

The command 'Now' gives the server current time
The command 'Status' gives any headers that have a value and their last update time

The commands understood are:
 "Signal-Error",   # Error - eg. no satellite signal recieved
 "System-Status",  # 0 = sky box powered on, 1 = off
 "Interactive-Status", #  0 = leaving interactive mode,
                       #  1 = entered interactive mode
                       # (ie. when you press the 'red' key on remote)
 "Now",                # server current time
 "Last-Update",        # time of last serial msg
 "Status",             # dump of all headers/timestamps

PS cc me to attract attention, I don't read all the list postings
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sky_status.pl
Type: text/x-perl
Size: 10990 bytes
Desc: not available
URL: <http://mythtv.org/pipermail/mythtv-users/attachments/20090119/c33ee8c9/attachment.pl>

More information about the mythtv-users mailing list