Stop Timeout on Brighthouse Networks DVR when using EyeTV and HD-PVR

I recently switched away from a SageTV running on an old PC to a new quad-core Mac Mini. I’ve found EyeTV to be a very worthy replacement for Sage; furthermore its compatibility with the HD-PVR is pretty good save for its lack of IR capability. Luckily, the DVR I have from Brighthouse has an active firewire (1394) port and so I was able to use Alex Fajkowski’s Mac OS X FireWire Channel Changer for EyeTV. Only problem now is that since I’m using firewire to change channels, my Brighthouse DVR seems to time out a lot more frequently. Seems that the Brighthouse DVR will time out after it’s tuned to the same channel for three hours. So back-to-back recordings on the same channel would ultimately get cut off because the screen saver became active.

I rigged a solution using Applescript and, now that it’s working, wanted to share it so anyone else out there with a DVR timeout could benefit from it.

First, it’s noteworthy that EyeTV has a pretty extensive Applescript API. In my case I simply asked it to tell me what channel it was currently tuned to using the following command line:
osascript -e 'tell application "EyeTV" to get current channel'

Then, I use standard GUI Applescript to launch the System Preferences, switch to the Channel Change application, then manually tune that channel number.

What this process does is cause the DVR to retune the current channel and therefore reset the screen saver timeout. The only impact this has on the recording is it will cause the channel info window to briefly appear on the screen, a small price to pay for not having your DVR timeout anymore.

Finally, I made the Applescript part of LaunchD so it runs every two hours.

Here is the Applescript which I saved as “ChannelChanger.applescript”:

tell application "EyeTV"
set ChannelNumber to get current channel as string
end tell
tell application "System Preferences"
activate
set current pane to pane id "com.fajkowski.ChannelChanger"
end tell
tell application "System Events"
tell application process "System Preferences"
click radio button "Log" of tab group 1 of window "Channel Changer"
keystroke tab
keystroke tab
keystroke tab
keystroke ChannelNumber
keystroke tab
keystroke space
end tell
end tell
tell application "System Preferences" to quit

Then I created the following plist in: ~/Library/LaunchAgents/com.MyAgent

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.myAgent</string>
<key>LowPriorityIO</key>
<true/>
<key>Program</key>
<string>/usr/bin/osascript</string>
<key>ProgramArguments</key>
<array>
<string>osascript</string>
<string>/Users/bhelmick/ChannelChange.applescript</string>
</array>
<key>StartInterval</key>
<integer>7200</integer>
</dict>
</plist>

I then loaded it up with:
launchctl load ~/Library/LaunchAgents/com.myAgent.plist

Although you can just reboot and it will load that way as well.

Unfortunately you do have to suffer with the command launching every two hours and interrupting your viewing experience; again it’s a small price to pay for not having your recordings interrupted. Thankfully the recording has only a negligible impact.

Now I’m not an expert at Applescript; in fact, this is the first one I’ve ever written. So if you want to improve this, please by all means contact me.

No comments yet.

Leave a Reply


*