Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

control FireTV from EventGhost?

If you have a question or need help, this is the place to be.
Post Reply
kingfetty
Posts: 5
Joined: Thu Sep 06, 2012 8:17 pm

control FireTV from EventGhost?

Post by kingfetty »

I'm looking for some way to control a firetv from eventghost.

Thoughts so far are to possibly leverage the ADB to send keypress events over the network. There are some wrappers out there for the ADB interface or I could simpy write a whole bunch of batch files for each keypress.

http://unlockfiretv.com/remote-control- ... rough-usb/

Anyone have any ideas? FireTV is basically Android, wondering if that might give a possibility of side loading and app to listen to eventghost and issue keypresses.
kkl
Experienced User
Posts: 317
Joined: Wed May 04, 2011 9:32 pm

Re: control FireTV from EventGhost?

Post by kkl »

I looked into it a few weeks ago and came up with the same possible solution that you found. I haven't found the time to try it out. A couple of other related resources:

http://developer.android.com/tools/help/adb.html
http://www.aftvnews.com/how-to-remotely ... k-via-adb/
http://www.aftvnews.com/how-to-sideload ... indows-pc/

Please post back with your experience if you try it out.
kingfetty
Posts: 5
Joined: Thu Sep 06, 2012 8:17 pm

Re: control FireTV from EventGhost?

Post by kingfetty »

Well, I've manged to cobble something together as a proof of concept.

What I've done:

I used the managed adb library on nuget to write a system tray application that listens for EG TCP network events and then issues the corresponding command back out the ADB to the FireTV. I then mapped my remote buttons to send the correct events to this c# application. When I press the input button on the remote, it disables the Folder for XBMC on my EG tree and sends a command to the AVR to switch to the FireTV input. When I press input again, it switches back to my HTPC, re-enables the XBMC tree and disables the FireTV folder.

The Result:

I use 1 remote (Tivo Slide Pro) to control both my HTPC running Kodi, and my AFTV. There is a slight delay right now between button press and the AFTV response. I'm working to see if I can reduce this delay a bit.


The Hope:

I don't know anything about Python or developing plugins for EG. I'm trying to brush up to see if I can packages this into a singular plugin that handles all without the need for the c# relay. We know the proof of concept works, now to build an actual plugin.

Any advice on how to learn to write plugins for EG would be greatly appreciated.

Basically we need 2 commands to be echoed to ADB from EG

startup: adb connect x.x.x.x
on key press: adb shell input keyevent x

List of Keyevent #'s you can send:

Code: Select all

 
1 --> "KEYCODE_MENU"
 2 --> "KEYCODE_SOFT_RIGHT"
 3 --> "KEYCODE_HOME"
 4 --> "KEYCODE_BACK"
 5 --> "KEYCODE_CALL"
 6 --> "KEYCODE_ENDCALL"
 7 --> "KEYCODE_0"
 8 --> "KEYCODE_1"
 9 --> "KEYCODE_2"
 10 --> "KEYCODE_3"
 11 --> "KEYCODE_4"
 12 --> "KEYCODE_5"
 13 --> "KEYCODE_6"
 14 --> "KEYCODE_7"
 15 --> "KEYCODE_8"
 16 --> "KEYCODE_9"
 17 --> "KEYCODE_STAR"
 18 --> "KEYCODE_POUND"
 19 --> "KEYCODE_DPAD_UP"
 20 --> "KEYCODE_DPAD_DOWN"
 21 --> "KEYCODE_DPAD_LEFT"
 22 --> "KEYCODE_DPAD_RIGHT"
 23 --> "KEYCODE_DPAD_CENTER"
 24 --> "KEYCODE_VOLUME_UP"
 25 --> "KEYCODE_VOLUME_DOWN"
 26 --> "KEYCODE_POWER"
 27 --> "KEYCODE_CAMERA"
 28 --> "KEYCODE_CLEAR"
 29 --> "KEYCODE_A"
 30 --> "KEYCODE_B"
 31 --> "KEYCODE_C"
 32 --> "KEYCODE_D"
 33 --> "KEYCODE_E"
 34 --> "KEYCODE_F"
 35 --> "KEYCODE_G"
 36 --> "KEYCODE_H"
 37 --> "KEYCODE_I"
 38 --> "KEYCODE_J"
 39 --> "KEYCODE_K"
 40 --> "KEYCODE_L"
 41 --> "KEYCODE_M"
 42 --> "KEYCODE_N"
 43 --> "KEYCODE_O"
 44 --> "KEYCODE_P"
 45 --> "KEYCODE_Q"
 46 --> "KEYCODE_R"
 47 --> "KEYCODE_S"
 48 --> "KEYCODE_T"
 49 --> "KEYCODE_U"
 50 --> "KEYCODE_V"
 51 --> "KEYCODE_W"
 52 --> "KEYCODE_X"
 53 --> "KEYCODE_Y"
 54 --> "KEYCODE_Z"
 55 --> "KEYCODE_COMMA"
 56 --> "KEYCODE_PERIOD"
 57 --> "KEYCODE_ALT_LEFT"
 58 --> "KEYCODE_ALT_RIGHT"
 59 --> "KEYCODE_SHIFT_LEFT"
 60 --> "KEYCODE_SHIFT_RIGHT"
 61 --> "KEYCODE_TAB"
 62 --> "KEYCODE_SPACE"
 63 --> "KEYCODE_SYM"
 64 --> "KEYCODE_EXPLORER"
 65 --> "KEYCODE_ENVELOPE"
 66 --> "KEYCODE_ENTER"
 67 --> "KEYCODE_DEL"
 68 --> "KEYCODE_GRAVE"
 69 --> "KEYCODE_MINUS"
 70 --> "KEYCODE_EQUALS"
 71 --> "KEYCODE_LEFT_BRACKET"
 72 --> "KEYCODE_RIGHT_BRACKET"
 73 --> "KEYCODE_BACKSLASH"
 74 --> "KEYCODE_SEMICOLON"
 75 --> "KEYCODE_APOSTROPHE"
 76 --> "KEYCODE_SLASH"
 77 --> "KEYCODE_AT"
 78 --> "KEYCODE_NUM"
 79 --> "KEYCODE_HEADSETHOOK"
 80 --> "KEYCODE_FOCUS"
 81 --> "KEYCODE_PLUS"
 82 --> "KEYCODE_MENU"
 83 --> "KEYCODE_NOTIFICATION"
 84 --> "KEYCODE_SEARCH"
 85 --> "TAG_LAST_KEYCODE"
kingfetty
Posts: 5
Joined: Thu Sep 06, 2012 8:17 pm

Re: control FireTV from EventGhost?

Post by kingfetty »

Well, I've been toying around all day and have my proof of concept ported over to a plugin. This is my first plugin and first bout with Python so please be forgiving. The one thing I noticed is the file browse box doesn't seem to be populating with the save value, not sure how to fix that yet.

Feel free to suggest changes to the plugin as I have no clue what I'm doing.
Attachments
AFTV.zip
(854 Bytes) Downloaded 203 times
kkl
Experienced User
Posts: 317
Joined: Wed May 04, 2011 9:32 pm

Re: control FireTV from EventGhost?

Post by kkl »

Wow! That is really impressive that you've already written a plug-in. One of the smart guys here can probably explain why the path to the ADB executable doesn't stay populated in the configuration dialog. I guess the good news is that it keeps working with or without it.

Here's the original guide to writing plug-ins. When you're ready, you should post this into a new thread in the Plugin Support forum. I found a Python ADB. It would be cool if you incorporated that so that the Windows Android SDK isn't required.

For anyone setting this up, the other thing that is required is to turn on ADB Debugging in your Fire TV: Settings...System...Developer Options...ADB Debugging -> ON.
sunshine
Posts: 4
Joined: Tue Nov 19, 2013 5:02 am

Re: control FireTV from EventGhost?

Post by sunshine »

Many thanks for the plugin! Thought I'd chime in as i've found some further ways to use EV with the FTV. I was able to side-load eventghost for android onto the FTV. Now i have macros set up in the eventghost app on the fire tv to launch specific apps using events sent by the Network Sender Plugin. Combined with your plugin it's a great way to quickly launch apps like Kodi or pandora from without ever having to navigate the default launcher. Currently im using a URC remote to trigger these events.
sunshine
Posts: 4
Joined: Tue Nov 19, 2013 5:02 am

Re: control FireTV from EventGhost?

Post by sunshine »

A complete list of key codes can be found here:

http://developer.android.com/reference/ ... MEDIA_PLAY

I found 85 and 87 particularly useful for play/pause and skip forward, respectively, but i've only tried a few. This is just great thanks again everyone on this post.
sunshine
Posts: 4
Joined: Tue Nov 19, 2013 5:02 am

Re: control FireTV from EventGhost?

Post by sunshine »

Also, eventghost for android can be sideloaded. Network Events can trigger macros to launch any installed app. I'm using it to quickly switch between Kodi, Pandora, Netflix, and Amazon with an IR remote, just in case this helps anyone else.
Post Reply