-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set Picture Mode via Home Assistant #51
Comments
I am trying to achieve the same thing, but it seems that this project is missing something for those endpoints. I am able to send the picture commands from a standalone installation of bscpylgtv via my system’s terminal and they work as expected (switch from Standard to Cinema, etc.) However, in Home Assistant w/ aiopylgtv, the endpoint Its seems that many of the endpoints that begin with “com.webos” are this way. |
Interesting, I wonder if it would be easy enough to slot bscpylgtv into a custom component replacing aiopylgtv. |
Also pretty sure it's possible to run CLI commands via HA so could probably just install the package and run those commands via scripts or automations, since it's just picture modes would only need to setup a couple of static commands. |
It is. That’s how I solved it. But I’d prefer it to be part of the integration. Now I have to reinstall bscpylgtv manually every time the python environment is updated on my dietPi. |
Would you mind providing some details on how you set that up? I think I have some kind of fundamental misunderstanding of how to use python scripts with HA. |
Maybe as bscpylgtv as a requirement to a custom component with nothing else in it? Should install itself at startup each time if not present. But yet built in would be better. |
I installed bscpylgtv as per instructions, and added this to configuration.yaml:
This allows me to call |
Again, I feel like I have some kind of fundamental misunderstanding about this. Are you installing via "pip install bscpylgtv" in the Home Assistant CLI? Because that works for me, and I can issue the commands from the CLI and they work. But, adding the shell commands to configuration.yaml and calling them from an automation always returns error code 127. Here is my shell_command entry:
Again, these commands work when directly typed into the CLI, but do NOT work when calling a shell command from an automation. |
@DeLub Any advice on this? |
Before installing you should probably activate the Python environment. On my Pi I do this by
does this help you? |
Thanks for the reply 🍻 Unfortunately, that directory doesn’t exist for me, and the I run HAOS in a Hyper-V VM, if that makes any difference. |
Sorry, can’t help you with that. I guess bscpylgtv needs to be added to the container. But I don’t know how you should do that. |
This is actually a quite funny hack to access the internal "luna" api of webos.. idk if the maintainer of this project would like to implement it: https://github.com/chros73/bscpylgtv/blob/8267636a991bacbb581bca57b6b461adf1df05a2/bscpylgtv/webos_client.py#L1097 |
So in theory something like this should do the trick, but it doesn't: set_picture_mode:
sequence:
- service: webostv.command
target:
entity_id: media_player.lg_webos_smart_tv
data:
command: system.notifications/createAlert
payload:
message: " "
buttons:
- label: ""
onClick": luna://com.webos.settingsservice/setSystemSettings
params:
category: picture
settings:
pictureMode: cinema
onclose:
uri: luna://com.webos.settingsservice/setSystemSettings
params:
category: picture
settings:
pictureMode: cinema
onfail:
uri: luna://com.webos.settingsservice/setSystemSettings
params:
category: picture
settings:
pictureMode: cinema
//Edit: Also it opens up a dialog that you need to close manually on the TV, which is otherwise handled by the bscpylgtv script. |
I am using the linuxserver homeassistant image. As a workaround which is probably not recommended, I have set the PUID and PGID to root as when I tried my own user, I could see permission errors in the logs.
/path/to/store/custom/scripts/homeassistant:/custom-cont-init.d:ro
#!/bin/bash
echo "**** installing bscpylgtv via pip****"
pip install --no-cache-dir bscpylgtv
...
environment:
- PUID=0
- PGID=0
- ...
...
|
Apologies if this is the wrong place to ask this but I'd like to set the picture mode via homeassistant automations. I don't need to adjust picture settings necessarily just change between modes that are already configured. Any guidance would be appreciated.
The text was updated successfully, but these errors were encountered: