Replies: 8 comments 8 replies
-
Greetings @efiniste! You are absolutely right. A longer press on a virtual button in the Firemote card is not something that's easily detected. Since I can't properly detect them, a long or short press is processed the same way as regular click. I've looked into detecting a long press event a few times, but I haven't yet pursued it. Maybe it's time I look at it again? In the meantime, perhaps I can help you with a launcher button customization to give you a working solution while you wait. What kind of device are you using? |
Beta Was this translation helpful? Give feedback.
-
HI @PRProd, thanks very much for the quick response. A launcher button would be great. I'm using a Fire TV, device type fire_tv_4_series Steve |
Beta Was this translation helpful? Give feedback.
-
Good news @efiniste! I have a Fire TV 4 Series in front of me right now, so I put this simple YAML config together, tested it in YouTube, and it works! type: custom:firemote-card
entity: media_player.fire_tv_192_168_107_88
device_family: amazon-fire
device_type: fire_tv_4_series
compatibility_mode: default
custom_launchers:
- friendly_name: Longpress Select
label: L Select
color: red
background: white
service: androidtv.adb_command
target:
entity_id: media_player.fire_tv_192_168_107_88
data:
command: >-
sendevent /dev/input/event0 1 28 1 && sendevent /dev/input/event0 0 0 0
&& sleep 1 && sendevent /dev/input/event0 1 28 0 && sendevent
/dev/input/event0 0 0 0
app_launch_1: customlauncher Longpress Select PLEASE REMEMBER to replace my TV's entity ID with yours in both places. |
Beta Was this translation helpful? Give feedback.
-
@PRProd Thanks Doug. I'm sorry, I made a mistake on the device type. It's actually a fire_stick_4k in the device type, Fire TV Stick 4k (1st Gen - 2018) on the drop down chooser. The button shows fine in my test card but doesn't have any effect on-screen when pressed. All the other buttons work fine so it's got the correct entity configured. |
Beta Was this translation helpful? Give feedback.
-
No problem! Try it this way instead: type: custom:firemote-card
entity: {YOUR ENTITY ID HERE}
device_family: amazon-fire
device_type: fire_stick_4k
compatibility_mode: default
custom_launchers:
- friendly_name: Longpress Select
label: L Select
color: red
background: white
service: androidtv.adb_command
target:
entity_id: {YOUR ENTITY ID HERE}
data:
command: >-
sendevent /dev/input/event4 1 28 1 && sendevent /dev/input/event4 0 0 0
&& sleep 1 && sendevent /dev/input/event4 1 28 0 && sendevent
/dev/input/event4 0 0 0
app_launch_1: customlauncher Longpress Select |
Beta Was this translation helpful? Give feedback.
-
Works perfectly. Thanks very much, Doug. Steve |
Beta Was this translation helpful? Give feedback.
-
That's great news! Thanks for letting me know! |
Beta Was this translation helpful? Give feedback.
-
Hello again Steve! Congrats on getting a NVIDIA Shield! I hope you love it! I know It is my favorite of all of the devices I've owned and tested. In response to your question in the home assistant community discussion board:
You are absolutely right, the command is different. Because of the way the Shield is designed, you will need to use both the ADB integration and the Android TV Remote integration for this solution to work. I assume you've already set your system up that way, otherwise the lag would be unbearable. type: custom:firemote-card
entity: {YOUR SHIELD ENTITY ID HERE}
android_tv_remote_entity: {YOUR SHIELD REMOTE ENTITY ID HERE}
device_family: nvidia-shield
device_type: shield-tv-pro-2019
compatibility_mode: default
custom_launchers:
- friendly_name: Longpress Select
label: L Select
color: red
background: white
service: remote.send_command
target:
entity_id: {YOUR SHIELD REMOTE ENTITY ID HERE}
data:
num_repeats: 1
delay_secs: 0
command: KEYCODE_DPAD_CENTER
hold_secs: 1
app_launch_1: customlauncher Longpress Select
app_launch_2: youtube |
Beta Was this translation helpful? Give feedback.
-
I don't seem to be able to do a "long" press of the ok/centre button when using Firemote. I use this, for example, to bring up context menus in the YouTube app. Is this not working because it's a "virtual" button now? Is it possible to program one of the app buttons to do a long press?
Thanks,
Steve
Beta Was this translation helpful? Give feedback.
All reactions