thank you so much for responding! reason why i ask, based on this incredible thread and amazing finding from all of you guys commenting here and especially you @SLC-Josh , i wrote a custom integration for Unfolded Circle Remote (link to github) for users to control their FireTV using the Unfolded Circle Remote. but i found that some users getting connection refused . it worked perfectly against Cube Gen 3, others with different models getting connection refused, just trying to learn. To be fair and disclaimer, i dont even own a Fire TV but i am trying to fill in some gap for users of the unfolded remote, after all - this is what the community is all about, no ?
same as your incredible post!!! thank you for this. Many users wil be happy
@SLC-Josh if you have a github, would like to mention you in credit section
Also, i wonder if we can use HTTP TOOLKIT to sniff for other commands … like power toggle and other…
My github is the same as my display here SLC-Josh. My testing was done using the official app, I have found another that might have some other buttons to try. The biggest issue is the apps security and getting the https data. Sometimes it wont find the fire stick during the sniffing.
For those having issues, what step are they having them at? We’ve noticed the firesticks are very picky.
i’ve had many users test my integration , confirmed working agaisnt Cube Gen3 and Fire TV Max (1st generation) but then getting connection refused against Fire TV stick 4K max 2023. its sporadic. i have some users use HTTP Toolkit to try and snill the network but Fire App is refusing to connect if it detect network sniffing apps on the phone . we did get the first post:
HTTP/1.1
POST 192 . 168 . 1 . 126
Method: POST
URL
http://192.168.1.126:8009/apps/FireTVRemote
Headers
Accept-Encoding:
gzip
Connection:
Keep-Alive
Content-Length:
0
Content-Type:
text/plain; charset=utf-8
Host:
192.168.1.126:8009
User-Agent:
okhttp/4.10.0
x-amzn-request-id:
f309cfcd-1046-497a-bc22-b8f95a3c7808
201
Status: 201 Created
Headers
Access-Control-Allow-Origin:
(null)
Content-Type:
text/plain
Location:
http://192.168.1.126:8009/apps/FireTVRemote/run
it is odd the differences, i am trying to make this work across multiple devices but they act differently. i am also developing this without actually having a fire TV device in hand, which make it more dificault. my code was based on this thread alone…
So I was doing some tests last night. Still not sure on getting the power to work but can send the sleep command now. I also discovered the ability to send text but still need to check that out more. I also discovered that when you activate a voice command it seems to use a websocket. I have no clue how it works at this time but I did observe it doing it. Will try to keep playing around with it but might not until the weekend.
i was able to find all the below commands apis:
def _build_simple_commands(self) -> List[str]:
commands = [
'DPAD_UP',
'DPAD_DOWN',
'DPAD_LEFT',
'DPAD_RIGHT',
'SELECT',
'HOME',
'BACK',
'MENU',
'EPG',
'VOLUME_UP',
'VOLUME_DOWN',
'MUTE',
'POWER',
'SLEEP',
'PLAY_PAUSE',
'PAUSE',
'FAST_FORWARD',
'REWIND',
'LAUNCH_APP',
]
Unable to find the rest
This is pretty cool. With these API endpoints I was able to build a multi device c++ App that runs standalone and saves on Postgres. It sends discovery to ha over mqtt so is just a matter to add your fire tv devices and you’ll get all controls over the mqtt integration. Added my own dashboard for multi device but you can customize to your own
I’m not sure if anyone else has noticed. With my max 2nd gen with the last update it did need a reboot as it was not taking commands and it needs to wake up each time it has sat for a good while. I’m adding a rule to mine to send the wake up command for each command just in case it has sat.
Thanks for this work!
I was able to create scripts for each button that both send the wake up command and the button command, and then I created a custom Firemote card from the HA Firemote HACS integration and created button overrides mapped to the scripts. Now my Firemote integration bypasses the much slower ADB inputs and uses the significantly faster REST commands. This is working wonderfully for me on the most recent update with my Fire TV 4k Max 2nd gen.
