Here are some of the MQTT commands I’ve found to work on my TV, the 55H8G. Source and app selection works well, although I had to capture it from the RemoteNOW app. Button presses work well, especially if you’re building a remote in the UI. It seems as if MQTT commands get put into a queue if you issue them while the TV is in standby (as in, not completely powered off), and they’ll get executed once the WOL packet is sent.
Button presses are as follows. These work over CEC.
/remoteapp/tv/remote_service/XX:XX:XX:XX:XX:XY$normal/actions/sendkey
Power = KEY_POWER
Back = KEY_RETURNS
Menu = KEY_MENU
Exit = KEY_EXIT
Pause = KEY_PAUSE
Play = KEY_PLAY (play and pause work the same)
Stop = KEY_STOP
Up = KEY_UP
Down = KEY_DOWN
Left = KEY_LEFT
Right = KEY_RIGHT
Fast Forward = KEY_FORWARDS
Backwards = KEY_BACKWARDS
Home = KEY_HOME
Back = KEY_BACK
Menu = KEY_MENU
RGYB Buttons = KEY_RED, KEY_BLUE, etc.
Numkeys = KEY_0, 1, 2, 3, etc.
Channeldot = KEY_CHANNELDOT
Channel Up = KEY_CHANNELUP
Channel Down = KEY_CHANNELDOWN
Closed Captions = KEY_CC
For app launching, here’s an example MQTT publish and the JSON for it. This launches the app immediately, from every screen and input I could try.
/remoteapp/tv/ui_service/XX:XX:XX:XX:XX:XY$normal/actions/launchapp
{
"appIcon": "",
"appId": "",
"has_detail_page": 0,
"isLocalApp": 1,
"name": "Plex",
"storeType": 0,
"type": 0,
"url": "com.plexapp.android",
"urlType": 0
}
Sources basically work identically to the app launching. You can just copy and paste the JSON and change HDMI 1 to the other numbers, they’re identical. I don’t use OTA or cable TV, so I cannot test channel inputs, though it would probably work okay with the remote codes above.
/remoteapp/tv/ui_service/XX:XX:XX:XX:XX:XY$normal/actions/changesource
{"displayname":"HDMI 1","hotel_mode":"","isDemo":false,"is_lock":"","is_signal":"","sourceid":"3","sourcename":"HDMI 1"}
Volume changing took a bit, because I just couldn’t understand how it worked. This is partially due to me using ARC, it doesn’t allow for arbitrary volume settings, only +1 or -1 per MQTT publish. If you’re using TV audio, I would assume that the value you publish would be the new setting. The TV will always return a JSON response here, formatted like so. This allows you to get the current volume setting.
/remoteapp/mobile/broadcast/platform_service/actions/volumechange
{"volume_type":1,"volume_value":11}
Volume type appears to be TV Audio, ARC, or Bluetooth (on my TV), with a value of 0, 1, or 2.
This is not how you set volume, nor does sending remote codes seem to work consistently. The best way I’ve found is as follows.
/remoteapp/tv/platform_service/XX:XX:XX:XX:XX:XY$normal/actions/changevolume
Just send a value between 0 - 100 – no formatting needed. If you’re using ARC (at least in my testing), a value above your current volume will increment up by one, and down by one if you’re sending a lower value. If you’re not using ARC, it seems as if it just sets it to that volume. I have yet to find a way to mute with ARC, as I can’t find a key command that works as a mute button.
Here’s one I have yet to find actually useful, but it’s worth putting in here. You can send keyboard inputs, including delete, enter, space, and special characters. The formatting for some of the special characters does make sense (@ is SHIFT_2), but it’s unwieldy, to say the least. Here’s the topic.
/remoteapp/tv/remote_service/XX:XX:XX:XX:XX:XY$normal/actions/input
Here’s one that seems to list known channels, but like I said, I don’t use OTA antennas so YMMV.
/remoteapp/mobile/XX:XX:XX:XX:XX:XY$normal/platform_service/data/getchannellistinfo
This will return a JSON response with all installed apps, makes it easy to format the app changing commands above.
/remoteapp/mobile/XX:XX:XX:XX:XX:XY$normal/ui_service/data/applist
Here’s one for known sources
/remoteapp/mobile/XX:XX:XX:XX:XX:XY$normal/ui_service/data/sourcelist
That’s all I’ve been able to mess with the last day or two. Hope this helps someone out!