Lovelace: Firemote Card - Remote controls for Amazon Fire / Android devices

I set up the firemote card today and linked the vol+ and - buttons to scripts I already had to use the vizio integration to control TV volume.

volume_up_tv:
  alias: Volume Up TV
  sequence:
    - service: rest_command.vizio_processkey
      data:
        ip: '[[[ return variables.ip ]]]'
        port: '[[[ return variables.port ]]]'
        auth: '[[[ return variables.auth ]]]'
        codeset: '5'
        code: '1'

Now the physical fire tv remote can only turn the volume up or down 1 click. if you click more, you get nothing. if you put the remote down for 30 seconds, then click again, it will go one click again, but no more, rinse, repeat. The physical Vizio TV remote is not impacted.

I’m wondering if somehow the fire tv is controlling the volume over hdmi and my “take over” via adb had somehow broken this relationship. Any of you seen anything like this?

1 Like

Mark @g13092 ~

Hmmm… that’s interesting. It’s a new one for me, but I think we can figure it out.

I assume that you’ve always used CEC between your Fire TV and your Vizio? It’s not something silly like weak batteries in your FireTV remote when it’s trying to use I.R. instead of CEC, right?

If that’s not the case, then i’d double check your FireTV’s CEC settings. There are actually 2 places to enable CEC stuff in the Fire TV menus. If you haven’t looked through that section on the Firemote Wiki, I suggest taking a quick peek: Using CEC Controls · PRProd/HA-Firemote Wiki · GitHub

If all of that looks good, it’s also possible that maybe a setting in your Vizio was accidentally adjusted or changed during a software update. CEC connections can usually be adjusted on both ends, the TV and the media player.

If that’s not the case, I’d take a look at your HDMI cable (if you are using one) between your FireTV device and your Vizo TV. I’ve seen strange behaviors that only go away when the cable is replaced. I’m not sure why, but it happens to me sometimes.

I’m interested to know what happens! Please let me know if these suggestions help at all.

-Doug

I think the issue is in the FireTV device. When we first got fire TV 10 years back, I wanted to watch two ways - 1) straight in or 2) routed through my receiver so I could get surround sound. The idea was to use #1 for normal tv watching and #2 for movies. I’ve got an older marantz receiver, so it wouldn’t pass through hdmi when turned off. So, I had an HDMI splitter! I plugged fire into that, then sent 1 output directly to the tv on hdmi1 input and the other to the marantz. Then, I routed output of the marantz to hdmi2 on the tv.

Yesterday when I was debugging, I tried to ‘reset’ the firetv remote, but would get stuck when it asked me to turn the TV off, wait 10 seconds, and turn it back on all using the intended remote. It would not register the ‘turn on’ and allow me to continue to the next step. That’s when it dawned on me firetv is using the hdmi for control of the tv and the splitter may be blocking the handshake. When we first got the current firetv, I set it up by plugging it into another hdmi port on the tv directly. Once it was running, including remote control of tv functions, I took out the old firetv at the splitter and plugged the new one right in it’s place.

Today, I eliminated the splitter. The receiver is old and the TV is newer, so I figure a better way to get surround is to abandon the HDMI approach and use a digital connection from the tv to the receiver. Even so, I had to reset the firetv to factory defaults and bring it up from scratch. There was no way to make it forget the remote and reset it completely. After the factory reset, the remote configured properly!

Stay tuned. I’ll try it again soon. Ok, it verks! I was hesitant, but went forward and we’re good. So, lesson learned, don’t put junk in your HDMI circuits! :grinning: Thanks for the cool contribution to the community @crdougn

1 Like

@g13092 ~

Yeah, HDMI can be a finicky thing sometimes. Since I own so many media player devices (I won’t add them to the Firemote project unless I can work with them in my lab, so I have A LOT) I don’t always experience the simplicity of connecting a device directly to a TV.

In reality, I have 2 HDMI switches with 5 inputs each. Both of those switches are wired into separate HDMI inputs on my FireTV 4 Series. One of those switch outputs goes through a 4K HDMI capture box first so I can more easily grab screenshots and post Firemote YouTube tutorials.

This setup has caused all kinds of unusual behavior. For the most part, I’ve been lucky with CEC but I’ve had some issues with resolution detection/negotiation. I found that a lot of those issues went away when I upgraded to 8K rated HDMI cables, even though the best my devices and TV will do is 4K.

All of that to say this: You might be able to add “junk” to your HDMI path successfully, but not all “junk” is created equal. Sometimes, you get what you pay for.

1 Like

Bummer. The problem has returned. It’s funny that it only seems to impact the volume management. Any thoughts on how to debug it?

@g13092 ~ Yikes. That’s frustrating!

At this point, I’m wondering if the physical remote itself is at fault. Have you taken a look at Amazon’s help article called Reset Your Fire TV Remote?

While I was looking around today, I also found a few YouTube videos about how to reset your remote due to odd things occurring such as “some” buttons stop working or are laggy, which sort of matches what you are describing. The instructions directly from that Amazon help article essentially are the same as what was described in the videos, but perhaps maybe a little different from the instructions you were trying?

I vaguely remember having an app once that could capture remote control / game pad control input and display it on the screen, but for the life of me I can’t remember what it was called. I’ll keep looking.

Another troubleshooting step you could take is to download an app called Input Event Checker from the App Store. It’s designed to show a connected remote or game pad’s sent commands. Maybe this could help you determine if your remote itself isn’t sending the commands like it should, or if your device just isn’t properly handling the commands.

Also, I’m curious: Which model of FireTV device do you have? If this comes down to an issue with a faulty or aging media player device, I can help you choose an alternative.

Sorry, I’ve been out of pocket a few days. I’ve got a Firestick 4K 2nd gen 2023. I’ll give the reset techniques a try and check out the input event checker soon!

:grinning: installed and messed with the input checker. First few volume + and - clicks it would say CONNECT and DISCONNNECT with each line, then after about 8 or 9 clicks, it stopped registering in the checker and started “working normally” i.e. rapid volume clicks, no waiting. IDK. I guess we’ll wait and see if it stays like this acts up again.

Huh, started acting up again. With the input checker, I still see these Input Device: DISCONNECT followed by a Amazon Fire TV Remote p?:CONNECT
:smiley: IDK

I did a complete reset/re-pair on the remote, but it didn’t change anything.

Bummer @g13092, It sounds like a hardware issue for sure. It’s tough to know which end (your remote or your device) is causing the disconnections and reconnections, but maybe that clue will give you something to research?

I’m glad you mentioned it, reminded me to come back.

I feel like an idiot, as it seems to be the dang batteries. They were 1.49V, but fresh ones made all the difference. Maybe they have low “cold cranking amps” :grinning: This would at least make sense why they’d work once for volume, then not for a few seconds, then again, etc, but work fine for native firestick actions. IR for some TV actions, RF for firestick, maybe taking more current for IR blasting. The interesting part is that with fresh cells, the disconnect / connect sequence doesn’t appear on the controller action test at all. The cool part is that we all learned something :laughing:

Thanks for the great card!

1 Like

cold cranking amps - that one got me! :rofl:

I’m glad that you didn’t end up having to buy a replacement device!

1 Like

First of all, amazing work OP. Thank you VERY much for this!

I see your FAQ has intructions in how to create a Launcher Button Customistation, which is much apreciated. However, i see the examples calls/triggers functions on HA itself.

Question: Would customise a Third-Party App something technically possible to be done in similar approach? Or a third-party app, requires the process of App Shortcut Reuest (which I’ve followed easily with your well-detailed steps already, thank you!)?

Just wondering if is something we can “relief” you from creating this thousand of possible apps :slight_smile:
Thanks!

Hello there @enazevedo!

To answer your question, YES! This is absolutely possible to do! I should update my documentation a little with an example, so THANK YOU for asking me about it!

Let’s say you wanted to make your own custom launcher for Netflix. (I know you could choose Netflix from the menu, but I just like using it as my example app) Adding any one of these to your Firemote YAML would make that happen:

custom_launchers:
  - friendly_name: NETFLIX
    label: red
    icon: mdi:netflix
    color: red
    background: white
    action: androidtv.adb_command
    target:
      entity_id: {YOUR MEDIA PLAYER ENTITY GOES HERE}
    data:
      command: adb shell am start -n com.netflix.ninja/.MainActivity
app_launch_2: customlauncher NETFLIX

or

custom_launchers:
  - friendly_name: NETFLIX
    label: red
    icon: mdi:netflix
    color: red
    background: white
    action: media_player.select_source
    target:
      entity_id: {YOUR MEDIA PLAYER ENTITY GOES HERE}
    data:
      source: com.netflix.ninja
app_launch_2: customlauncher NETFLIX

or

custom_launchers:
  - friendly_name: NETFLIX
    label: red
    icon: mdi:netflix
    color: red
    background: white
    action: media_player.select_source
    target:
      entity_id: {YOUR MEDIA PLAYER ENTITY GOES HERE}
    data:
      source: Netflix
app_launch_2: customlauncher NETFLIX

It can be easy or difficult to find the right command to put in your YAML to make your app launch. Looking through the Developer Tools, and also looking at the adb_response after following these steps are great places to start.

I hope this helps!

-Doug

– EDIT –
I updated the appropriate section in the Firemote wiki with the examples I posted in this thread. Hopefully that will help the next person. :smile: