Any way to change picture modes for LG Oled TV (C2)

Hello,

I’m currently on the trial of Roomie Remote and am really enjoying it, but I can’t find a command to change picture modes on my LG C2 Oled TV. Is this built-in, or is there any way to use a custom device to do it?

First, technically, you can string menu commands together obviously to set this, so the ability is there now with no special commands.

Going to the lower level of wanting a direct command, it does look possible. I see such a command in the latest API which isn’t supported by our ancient LG C7 test unit from around 2017. You could add such a command as a supplemental code to the LG TV WebOS codeset if you can formulate the command based on the API:

Then the syntax of the custom command you paste into Roomie’s Custom Code Set editor would be like this to match the existing codeset:

{“id”:“$COUNT$”,“type”:“request”,“uri”:“ssap://audio/changeSoundOutput”,“payload”:“{"output":"tv_speaker"}”}

That’s just a different sample command. Given 15 minutes and a working test unit, one could figure it out from the API website.

Good news is that we just had 3 new G4 units installed and they should be setup by next week, so I’d be able to give this a try at some point soon. It’s the kind of thing that would need a simple codeset redeploy which does not require a new release.

Thanks for the response, according to the webOS API docs this command should do it:

{“id”:“$COUNT$”,“type”:“request”,“uri”:“luna://com.webos.service.settings/setSystemSettings”,“payload”:“{ “category”:“picture”, “settings”:{“pictureMode”:“vivid”} }”}

I created a custom device in the app and added that statement as a command. I tried various protocols including HTTP, websocket, socket.io, binary and when testing the command the picture mode didn’t change. I wonder if I’m using the wrong protocol? I’m not sure what to use for “luna”, it seems there is a custom luna client described at luna-service2 Library API Reference | webOS Open Source Edition

LG TV WebOS codeset uses websocket protocol.

Looking a bit deeper, any command in the luna: space seems to be restricted by LG, sort of an internal API. I think it may be designed for apps running on the TV. Anyway, it’s not directly callable as far as I can tell. Possibly enabling developer mode on the TV enables the luna: API, not sure about that. There is also some huge hack with the alert system that seems like it might have some promise. Anyway, just standard formatting is not something I think will work due to LG restrictions on this particular command.

Interesting, yeah previously I was using the plugin from GitHub - merdok/homebridge-webos-tv: Homebridge plugin for LG webOS TVs and was able to change picture modes using homekit. Looking at homebridge-webos-tv/lib/LgTvController.js at master · merdok/homebridge-webos-tv · GitHub it does seem there is a hack with the alert system to make it work. Thanks for looking into it.

Based on the homebrew plugin code this command should work that uses the alert hack:

{“id”:“$COUNT$”,“type”:“request”,“uri”:“ssap://system.notifications/createAlert”,“payload”:“{ "title": "lunaSend", "message": "lunaSend", "modal": false, "buttons": { "label": "Ok", "focus": true, "buttonType": "ok", "onClick": "luna://com.webos.settingsservice/setSystemSettings", "params": { "category": "picture", "settings": { "pictureMode": "vivid" } } }, "type": "confirm", "isSysReq": true }”}

I made sure the protocol is websocket for the custom device. When I enable the logs I see an error “missing auth device” after the request, could that be the issue? I verified the IP address is correct with port 3001. It would be great if you could try the above command when you get the G4 test units, I must be doing something wrong with the custom device.

I got that working after a lot of re-encoding/encapsulation, but LG’s handling is very ugly. It actually puts up the alert so you then need to send CURSOR ENTER after a brief delay to get rid of that. You may not be able to send this from a supplemental code set as the encoding is crazy, but this is the syntax that is tested working:

{"id":"$COUNT$","type":"request","uri":"ssap://system.notifications/createAlert","payload":"{\"title\":\"lunaSend\",\"message\":\"lunaSend\",\"modal\":false,\"buttons\":[{\"label\":\"Ok\",\"focus\":true,\"buttonType\":\"ok\",\"onClick\":\"luna://com.webos.settingsservice/setSystemSettings\",\"params\":{\"category\":\"picture\",\"settings\":{\"pictureMode\":\"vivid\"}}}],\"type\":\"confirm\",\"isSysReq\":true}"}

I deployed all picture modes using this technique so you can try them just by force updating code sets and reloading.

Thanks for adding the commands! I force updated the code sets and added the picture command and it worked to change modes. It’s hard to get the alert popup to close consistently, I’ve tried delays and sending CURSOR ENTER. Sometimes it works and other times it stays open.

The homebridge code is also sending “ssap://system.notifications/closeAlert” if the webos version is greater then 4, and it’s passing “true” for the “modal” property instead of false. It looks like the closeAlert command requires an alert id, I’m not sure if there is a way to replicate this in Roomie Remote, but the Homebridge function for sending a luna command is here: homebridge-webos-tv/lib/LgTvController.js at master · merdok/homebridge-webos-tv · GitHub

I think we’re 97% there. This is the latest command (not deployed to production):

{"id":"$COUNT$","type":"request","uri":"ssap://system.notifications/createAlert","payload":"{\"title\":\"Picture Mode Change\",\"message\":\"Mode change to Vivid.\",\"modal\":true,\"buttons\":[{\"label\":\"OK\",\"focus\":true,\"buttonType\":\"ok\",\"onClick\":\"luna://com.webos.settingsservice/setSystemSettings\",\"params\":{\"category\":\"picture\",\"settings\":{\"pictureMode\":\"vivid\"}},\"onClose\":{\"uri\":\"luna://com.webos.settingsservice/setSystemSettings\",\"params\":{\"category\":\"picture\",\"settings\":{\"pictureMode\":\"vivid\"}}},\"onFail\":{\"uri\":\"luna://com.webos.settingsservice/setSystemSettings\",\"params\":{\"category\":\"picture\",\"settings\":{\"pictureMode\":\"vivid\"}}}}],\"type\":\"confirm\",\"isSysReq\":true}"}

That one works like the previous one if you send CURSOR ENTER after you send it. Or just manually hit the alert. However, the “onFail” and “onClose” actions don’t seem to work. I do have automatic alert dismissal using closeAlert working, but it does not execute those actions using this syntax anyway. The closeAlert thing requires 9.0.1 as Roomie now records the alert ID to send that. Likely there is some simple syntax error above.

Interesting, I look forward to the 9.0.1 release that uses the alert id. In the mean time it’s working well if I manually close the popup. Thanks for adding this feature!

In the new codeset (use Force Codeset Update button) and using the now-available 9.0.1 release, you will see a new ALERT CLOSE command which closes the previous alert from whatever command was sent before it. You will also see the “normal” PICTURE MODE commands that can be dismissed using CURSOR ENTER and then one command titled PICTURE MODE VIVID EXPERIMENTAL which is specifically for use with ALERT CLOSE, but corresponds to the command above and last I checked the alert would dismiss but the onfail/onclose actions wouldn’t execute.

Thanks for the update, I tried the PICTURE MODE VIVID EXPERIMENTAL command and added the ALERT CLOSE command but the popup stays open. Are you using any delay commands in between the PICTURE MODE VIVID EXPERIMENTAL command and the ALERT CLOSE command in the activity?

I’d recommend using 200-600ms delay on pretty much every command to every device. Especially in the case you mention, you need to allow time for the LG to reply, send us its alert ID, record the alert ID, and then process it into the next command.

Thanks, I setup the activity commands like this (using the regular picture commands for now):

  1. Wake on LAN
  2. Delay 1 second
  3. Picture mode expert 1
  4. Delay 5 seconds (large time for testing)
  5. Cursor Enter

For some reason it’s like the 5 second delay is ignored and cursor enter is sent immediately so the popup stays open. I can tell cursor enter is sent because the tv shows a hdmi 2 overlay. I’m not sure why the delay isn’t happening.

Wake on LAN is a separate pipeline (layer 2 vs layer 3). If you want a delay after Wake on LAN, you generally will need to use Delay All (global) rather than a simple Delay.

Also, we provide extensive logs so you can look at what’s going on directly. Another option is to submit this from the app so that we can look at your logs.