I want to use my home harmony remote to be able to start a specific application (netflix/plex/you tube) on my nvidia shield. It’s not as easy as I thought it would be, so I thought I’d share the process!
Prereq:
Ensure you have mosquitto installed and configured (you also obviously need HASS and a shield!) I talk about integrating with harmony, but you don’t have to do this bit - it’s just what I use to trigger the automatioin.
Part 1:
The first part is getting it so the harmony remote can actually interact with Home Assistant. Thankfully a chapp called Marton has does the hard part with his home assistant roku emulator: https://gitlab.com/mindig.marton/ha-emulated_roku/. Simply add this, configure it and you can add the fake roku to the harmony.
Part 2:
Now I need to be able to actually start the applicaiton on the shield. For this I had to install Tasker (https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm&hl=en_GB). There are many experts for this complex app, so please don’t take what I’m saying as the right way to do it… but it did work for me.
To get started you will need to install this on your shield. This can be done from the google play website, but to launch it you will need to install the sideload launcher (https://play.google.com/store/apps/details?id=eu.chainfire.tv.sideloadlauncher&hl=en). You might want to have a mouse plugged into your shield too.
With tasker launched go to tasks and create one called Netflix. In there you should be able to add a task to launch netflix (you can pick netflix from the list of apps), Check that running the task start netflix!
Now you need to get an app called mqttclient (https://play.google.com/store/apps/details?id=in.dc297.mqttclpro&hl=en). This one you have to side load. I’d follow a guide for this, but you basically use a file explorer to grab the apk and install it.
With that installed, open it using the sideload launcher and add your mosquitto broker. Subscribe to a topic, and veirfy it can recieve a message.
Now go back to tasker and on profiles add in an event from a plugin. Select mqtt client. In the new window enter variable names for the topic and message, but in the section for message eq type in “netflix”. Save this and go back to the shield home screen
Now sent “netflix” to the topic from mosquitto and it should launch on your shield!
Step 3:
The automation should be very simple from here. You can see mine here: https://github.com/rossdargan/hass-config/blob/master/configuration/automation/roku.yaml#L131
It basically looks like this:
- id: turn_on_netflix
initial_state: ‘on’
alias: Turn on netflix
trigger:- platform: event
event_type: roku_command
event_data:
type: keypress
key: Home
action: - service: media_player.select_source
entity_id: ‘media_player.yamaha_reciever’
data:
source: “HDMI6” - service: mqtt.publish
data:
topic: ‘tv’
payload: ‘netflix’
- platform: event
So when I press the “home” button on the fake roku it will switch my av reciever onto the correct source, and will launch netflix!
Please note I’ve written this from memory so it you have any issues let me know and I’ll look up the exact steps!