The first topic I'll address is using adb to open apps on the Fire Stick or Android TV. I typed this post a while ago but did some quick edits.
Firstly, You have to download adb with the Android SDK platform tools:
sudo apt-get install -y android-tools-adb
To connect to your fire stick: Enable Developer Settings and ADB then;
adb connect fireIPaddress:5555
Make sure to authorize your pi once you press enter, a window will pop up, on your TV; remember the device and connect.
Here are a couple examples:
If you want to open Playstation Vue:
adb shell monkey -p com.snei.vue.firetv 1
Get the listings for your installed apps by doing this:
adb shell pm list packages
Copy the result to the clipboard and paste it in notepad so you can search it.
If an app is just nowhere to be found: Install it in your Android device from the play store and use another app that allows you to extract apks from your phone (apk extract).
Find the app and look at the package name, then reference the adb result you pasted in notepad. Replace the psvue (above) with the proper package name and run it as a test. HBO Max requires a special call:
adb shell monkey -p com.hbo.hbonow -c android.intent.category.LEANBACK_LAUNCHER 1
For Remote Commands:
adb shell input keyevent (code from above)
Personally, I exclusively use RPi to receive commands from my Harmony for switching apps, the commands that I have set up for a dummy device are received by a MCE Remote Receiver.
In the next section, I'll describe how to use the pi to invoke a piston by using irexec and curl