For those of us running HAOS, how do we install the bscpylgtv
package?
Iâm also running HAOS (in a rpi). Using the âAdvanced SSH & Web Terminalâ add-on I connected to the docker container by running docker exec -it homeassistant bash
and once inside installed it normally with pip install bscpylgtv
. Then the usual Control+d to exit the container.
Thanks for the quick reply. Iâm running HAOS in Proxmox, so could just do the same from the console in the VM. Works perfectly
Too much meta information is being spread around here. Just to make things as easy and clear for everyone: The steps to add the picture mode option to Home Assistant are the following:
- Install the Advanced SSH & Web Terminal Add-On
- Configure the Add-On for your specific environment (Disable Protection mode and make sure the Add-On starts automatically on system boot!)
- Restart the Add-On
- Start an SSH session via the Add-On
- Execute the following command:
docker exec -it homeassistant bash
- Execute the following command:
pip install bscpylgtv
- Create the following
shell_command
in yourconfiguration.yaml
file:<yourCustomShellCommandName>: /usr/local/bin/bscpylgtvcommand <your_LGTVs_IP_address> set_current_picture_mode "{{ picture_mode }}"
Hereâs my workingshell_command
as an example:
shell_command:
lgwebos_set_picturemode: /usr/local/bin/bscpylgtvcommand 192.168.50.10 set_current_picture_mode "{{ picture_mode }}"
- Restart Home Assistant
- Create your according automations and/or scripts by using the
shell_command
integration where you can just pass the required picture mode to the variable{{ picture_mode }}
from above. Hereâs my working example script to set the cinema picture mode:
sequence:
- action: shell_command.lgwebos_set_picturemode
metadata: {}
data:
picture_mode: cinema
Hope this helps someone.
So based on your comment, it sounds like youâre using the same kind of HA install that Iâm using with docker containers.
How are you installing the library in the container since it wonât be permanent?
Referencing this: # Need to install bscpylgtvcommand in the docker container for this to work
EDIT: I figured out a way. Added it to my docker-compose file like this for anyone else that might need it:
home-assistant:
image: homeassistant/home-assistant:stable
container_name: 0-home-assistant
hostname: 0-home-assistant
network_mode: host
privileged: true
restart: unless-stopped
volumes:
- home-assistant-config:/config
- /etc/localtime:/etc/localtime:ro
command: >
sh -c "pip install bscpylgtv && python -m homeassistant --config /config"
For anyone wondering how to make this work without the requirement to confirm a popup modal (i.e. fully automated; I have a rooted TV so YMMV):
action: webostv.command
data:
entity_id: media_player.tv
command: settings/setSystemSettings
payload:
category: "picture"
settings:
pictureMode: game
EDIT: I tried also setting âsoundModeâ (category âsoundâ) but it doesnât work (âkey is not allowedâ), however it works when using the popup - probably a permission thing or something.
ivm struggling with the commands to open up pictures from my nas.
my nas is not always on the same position ( I have multiple media players and sometimes my nas is on top, sometimes on the bottom). So using commands like âleftâ of down Arent always ok.
Is there a way to use luna to open a directory from a nas mediaplayer ?
Hi, my TV is rooted as well, but if I try your command I get the following error code:
{'type': 'error', 'id': 91, 'error': '500 Application error', 'payload': {'returnValue': False, 'errorCode': -1000, 'errorText': "category, picture doesn't support the key(s): undefined"}}
I canât find your command in this list: aiopylgtv/aiopylgtv/endpoints.py at 6b676ea69cb77f4e363d8fc5934cc126d07ad537 ¡ bendavid/aiopylgtv ¡ GitHub, so are you sure it works? Tbh, getSystemSettings
gives me a similar error ({'type': 'error', 'id': 93, 'error': '500 Application error', 'payload': {'returnValue': False, 'errorCode': -1000, 'errorText': 'keys are mandatory.'}}
), but something simple as audio/volumeUp
does work, so I assume Iâm doing something wrong, but god knows what.
It works on my TV (rooted LG C3 OLED 2023), but the problem with these undocumented/internal APIs is that they might change between models and OS versions, so (assuming you did it right) it either works or it doesnât
Yeah, I dove in a bit more and it appears to be pretty random sadly. The documented bits are next to useless . At least the version with the notification popup works for me!
Ok, so I used ssh to connect to my TV and send the luna command to get the picturemode that way, and then it works, like so:
luna-send -n 1 -f "luna://com.webos.settingsservice/getSystemSettings" '{"category":"picture","keys":["pictureMode"]}'
This returns the following:
{
"dimension": {
"input": "default",
"_3dStatus": "2d",
"dynamicRange": "sdr"
},
"subscribed": false,
"category": "picture",
"method": "getSystemSettings",
"settings": {
"pictureMode": "expert1"
},
"returnValue": true
}
So the info is there.
Setting the picturemode also works, using the following
luna-send -n 1 -f "luna://com.webos.settingsservice/setSystemSettings" '{"category":"picture"
,"settings":{"pictureMode":"game"}}'
So now I just have to figure out why this doesnât work via webostv.command
(I thought that literally did the same, but apparently not).