OMG, good catch, can't believe I missed that. OK so I changed those. Quit and deleted the old app, rebuilt new app, tried again. Now, no more errors in Terminal, great! One step closer...
I added all of the NBCU channels into my bmitune.sh file, matching their channel numbers from my HDMI Custom Channel source. Unfortunately the macro / sequence of keystrokes didn't match up on this device's interface. So I re-read this thread and went back to try different methods to control this device. The search command didn't seem to work either. But the start -a android.intent.action.VIEW
command did, after I edited each URL with the matching video_id from the desired channels. So here is what's working for me, on a HD Chromecast with GoogleTV dongle:
bmitune.sh:
#!/bin/bash
HOME="input keyevent KEYCODE_HOME; sleep 1"
PRIME1="input keyevent 19 19 19 19; sleep 1; input keyevent 21 21 21; sleep 1; input keyevent 22; sleep 1; input keyevent 23; sleep 1"
PRIME2="input keyevent 19; sleep 1"
PRIME3="input keyevent --longpress 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67"
SEARCH1="input keyevent 66; sleep 2"
SEARCH2="input keyevent 66"
#MSNBC
if [ $1 = "100" ];then
HOME="input keyevent KEYCODE_HOME; sleep 1"
adb shell am start -a android.intent.action.VIEW -d https://tv.youtube.com/watch/q6bWEVqhP8o?onboard=1 -n com.google.android.youtube.tvunplugged/com.google.android.apps.youtube.tvunplugged.activity.MainActivity
fi
#E!
if [ $1 = "101" ];then
HOME="input keyevent KEYCODE_HOME; sleep 1"
adb shell am start -a android.intent.action.VIEW -d https://tv.youtube.com/watch/ILTrUfLFrHI?onboard=1 -n com.google.android.youtube.tvunplugged/com.google.android.apps.youtube.tvunplugged.activity.MainActivity
fi
#Bravo
if [ $1 = "102" ];then
HOME="input keyevent KEYCODE_HOME; sleep 1"
adb shell am start -a android.intent.action.VIEW -d https://tv.youtube.com/watch/xNk2Sv4t4Tc?onboard=1 -n com.google.android.youtube.tvunplugged/com.google.android.apps.youtube.tvunplugged.activity.MainActivity
fi
#Oxygen
if [ $1 = "103" ];then
HOME="input keyevent KEYCODE_HOME; sleep 1"
adb shell am start -a android.intent.action.VIEW -d https://tv.youtube.com/watch/v4upAc0UExk?onboard=1 -n com.google.android.youtube.tvunplugged/com.google.android.apps.youtube.tvunplugged.activity.MainActivity
fi
#USA
if [ $1 = "104" ];then
HOME="input keyevent KEYCODE_HOME; sleep 1"
adb shell am start -a android.intent.action.VIEW -d https://tv.youtube.com/watch/DJ7m0fdLKEY?onboard=1 -n com.google.android.youtube.tvunplugged/com.google.android.apps.youtube.tvunplugged.activity.MainActivity
fi
#SYFY
if [ $1 = "105" ];then
HOME="input keyevent KEYCODE_HOME; sleep 1"
adb shell am start -a android.intent.action.VIEW -d https://tv.youtube.com/watch/2_WogcoZ1cY?onboard=1 -n com.google.android.youtube.tvunplugged/com.google.android.apps.youtube.tvunplugged.activity.MainActivity
fi
#CNBC
if [ $1 = "106" ];then
HOME="input keyevent KEYCODE_HOME; sleep 1"
adb shell am start -a android.intent.action.VIEW -d https://tv.youtube.com/watch/GIBoX-XF5i0?onboard=1 -n com.google.android.youtube.tvunplugged/com.google.android.apps.youtube.tvunplugged.activity.MainActivity
fi
#Golf
if [ $1 = "107" ];then
HOME="input keyevent KEYCODE_HOME; sleep 1"
adb shell am start -a android.intent.action.VIEW -d https://tv.youtube.com/watch/XK34g7QRvGk?onboard=1 -n com.google.android.youtube.tvunplugged/com.google.android.apps.youtube.tvunplugged.activity.MainActivity
fi
And I can confirm that I'm able to manually run ./bmitune.sh 100
through ./bmitune.sh 107
and I now see that it changes what's streaming via YTTV on the HDMI output over to the expected channel. This is excellent!
My last hurdle is how to link these particular channels properly in the M3U, because when I try to tune in via the guide in the Channels client, I get the error that "The connection to the HDHomeRun was lost. Press play to try again." What should this text be changed to, if anything?
I think I need to get the ./bmitune.sh msnbc
command working, at least the same way the ./bmitune.sh 100
command works when I invoke it manually, but that's the final piece that's stumping me.