[mythtv-users] Turn cable box off after recording

William william_munson at comcast.net
Tue Jun 16 21:54:50 UTC 2009

On 06/16/2009 05:01 PM, Preston Crow wrote:
> On Tue, 2009-06-16 at 13:45 -0700, David Brodbeck wrote:
>> On Sat, June 13, 2009 2:18 pm, Preston Crow wrote:
>>> One of the motivations is that we sometimes watch live TV though the
>>> cable box bypassing Myth (mostly for sports).  We need to have a way of
>>> knowing if we're going to mess up recodings, and having Myth turn off
>>> the cable box when it's not using it seems like the simplest method.
>> One potential problem that immediately comes to mind is that Myth may
>> decide it needs the cable box for something while you're watching the game
>> or whatever.
>> I generally use LiveTV mode for this sort of thing, but I'm assuming
>> there's some reason that doesn't work in your situation.
> Yup, the live TV watching through Myth isn't completely stable
> (firewire), and doesn't work for 5C channels.  In our home, having Myth
> cut in to switch channels to record is acceptable, so that's what we'll
> have it do.
> I've found that a user job to turn off the cable box works.  It sees
> that channel it was recording, and can determine from that if it was
> using the cable box.  It can check the state of the system to see if a
> tuner that uses the cable box is in use (for back-to-back recordings),
> but it can't tell which input is in use, which makes a difference.
> I don't see how to force the user job to always be active for all
> recordings, or at least all recordings for a given set of channels.
> I don't see how to set my user job to run before any commercial
> detection.

I know there is a status.xml file that is output from the backend on 
request. (Sorry, dont have the details handy) but I know  it details the 
status of all of your recorders. It would not be hard to write a script 
that checks status that way and then turns off the cable box if nothing 
is recording. Run this at 5 and 35 after the hour via cron. Multiple off 
commands should not affect your box unless it toggles on each command. 
If thats the case you will need to keep a status flag on the drive. In 
fact you will want that flag to keep it from turning off the box while 
you watch live tv.  Reset the flag whenever you see the channel in use.

Hope this points you in a usable direction. I wrote a similar script to 
check activity before triggering a firewire reset.

More information about the mythtv-users mailing list