[mythtv-users] Event script oddities
Stephen Worthington
stephen_agent at jsw.gen.nz
Mon Feb 7 08:30:00 UTC 2022
On Sun, 6 Feb 2022 19:06:23 +0100, you wrote:
>Hi all,
>
>I use the following event scripts on my backend
>
>EventCmdLivetvStarted: /usr/local/bin/mythtv_livetvstarted.sh %HOSTNAME%
>
>EventCmdLivetvEnded: /usr/local/bin/mythtv_event_livetvstopped.sh %HOSTNAME%
>
>EventCmdPlayStarted: /usr/local/bin/mythtv_event_playbackstarted.sh
>%HOSTNAME%
>
>EventCmdPlayStopped: /usr/local/bin/mythtv_event_playbackstopped.sh
>%HOSTNAME%
>
>
>EventCmdPlayStarted and EventCmdPlayStopped run fine and the %HOSTNAME%
>variable is filled correctly.
>
>Starting thread for command
>'/usr/local/bin/mythtv_event_playbackstarted.sh desktop'
>...
>Starting thread for command
>'/usr/local/bin/mythtv_event_playbackstopped.sh desktop'
>
>
>But the variable %HOSTNAME% is not filled, when the livetv scripts are
>executed. Then the literal string "%HOSTNAME%" is used instead.
>
>Also, when livetv stops, both scripts for EventCmdLivetvEnded and
>EventCmdPlayStopped are executed, in both cases with %HOSTNAME% not filled.
>
>Starting thread for command '/usr/local/bin/mythtv_livetvstarted.sh
>%HOSTNAME%'
>...
>Starting thread for command
>'/usr/local/bin/mythtv_event_playbackstopped.sh %HOSTNAME%'
>Starting thread for command
>'/usr/local/bin/mythtv_event_livetvstopped.sh %HOSTNAME%'
>
>Is this a known bug or am I doing something wrong?
>
>
>Thanks
>
>Thomas
Each event has different parameters you can give it - not all
parameters work on all events. Exactly what works for each event is
not well documented. Only things relevant to the event work. Some
things are obvious, such as the "scheduler ran" event not providing
anything to do with recording files, but in other cases things you
might expect to work do not. With the pre-recording events, the early
ones happen before a recording file has been created, so you can not
get the filename on those events. The only way I know that you can
work out what works and what does not is to try them out. If you put
a script on EventCmdAll and put lots of parameters on it and have the
script log to a file what it received on its command line, then you
can come back in a day or two and see which parameters worked on which
event. Make sure to have the %EVENTNAME% parameter as the first
parameter so you can see the type of each event.
More information about the mythtv-users
mailing list