I am not sure if this is possible but I would like to be able to add a custom on command for my LG WebOS TV. I have added the media player to by configuration and that works fine once TV is on. Unfortunately, my TV doesn’t support wake on LAN so no use adding the mac: as this just gives me an on button that doesn; 't work. I have usually turn ON my TV using another raspberry pi connected via HDMI and HDMI CEC commands. This works perfectly. I know I can add a separate on switch using the below config which works fine but my question is, can I combine the 2 and add a custom ON command for the webostv media_player configuration? Basically add the power button back which adding mac: option adds but have it work by running a custom command?
@nxd4n Thank you so much, I finally got around to looking into this, It looked very complicated when I first looked at it and at the time when you replied I didn’t have time to look into it. Today after actually reading the universal media player setup page I found that the setup is very basic. I only had to add the one override command for power_on, the rest comes from the child entry. Then just hide the command line power_on switch I created and child media player and now everything is working perfectly just how I wanted it Thanks again.
Hey @nxd4n, do you know is there a way to add channel up & down controls to the universal player? I don’t see an option for it but would think it should be possible. I have setup custom switches for now but would be good to hide them and add this to the media player.
No, I didn’t look further into it, I remapped nextTrack in media_player/braviatv.py to do a channel_up in place of media_next(). Dirty hack that will be overwritten at next update.
Hey @juan11perez, Yea sure. Bellow are the relevant bits I used for this. I just have an old Raspberry Pi 1 connected to my TV via HDMI cable to turn it on.
customize:
switch.tv_rpi:
hidden: true
media_player.tv:
hidden: true
media_player:
- platform: webostv
host: !secret tv_ip
name: TV
filename: webostv.conf
customize:
sources:
- livetv
- youtube
- Plex
- platform: universal
name: Living Room TV
children:
- media_player.tv
commands:
turn_on:
service: switch.turn_on
data:
entity_id: switch.tv_rpi
switch:
- platform: command_line
switches:
tv_rpi:
friendly_name: TV Power On
command_on: ssh [email protected] "tvservice -o; echo on 0 | cec-client -s -d 1"
No worries, yes it is just used for Turning on the TV at this stage but you could use it for more if needed. Could put Kodi on it or something. I would prob use a Raspberry Pi Zero W if I was buying something for this but I had the old Pi laying around not being used.
All I would like to do is create a command_line switch in HA to turn off/on Magic Mirror Screen. Once it’s in HA I can create a script or scene to control it with Google Home.
Thanks Paulio! I used this to turn on a 2011 Samsung TV that didnt support a wake on lan function… I used the built in CEC switch in HASSio instead of the ssh command, but it works great!