cris
May 6, 2020, 9:36pm
1
Hi all,
I’m trying to figure out how to change source to HDMI2 at power on.
I have the following script:
telecamere:
alias: telecamere
sequence:
- service: homeassistant.turn_on
entity_id: media_player.tv_soggiorno
- delay:
seconds: 2
- service: media_player.select_source
entity_id: media_player.tv_soggiorno
data:
source: hdmi2
when I trigger the script, the TV turns on, but it does not change the source.
Any idea what’s wrong?
Thanks.
kevin59
(KW)
May 7, 2020, 12:20am
2
I don’t know if this is any help to you but for my LG TV I have a card set up to switch inputs. Here is a cut/paste from that card.
cards:
- cards: []
type: horizontal-stack
- cards:
- entity: media_player.mancave_lg_tv
icon: 'mdi:satellite'
name: DirecTV
tap_action:
action: call-service
service: media_player.select_source
service_data:
entity_id: media_player.mancave_lg_tv
source: DirecTV
I see there are a few differences from what you have. Might be worth a try. Have you tried increasing the delay on your script to longer than 2 seconds?
1 Like
Makis
(Makis)
May 7, 2020, 3:53pm
3
Hi
do you happen to have a card that switches channels for live tv? In the latest versions of webos integration we lost this capability and I haven’t manage to make my own.
Here is the entire card. I checked before replying and it does still switch for all of the sources shown.
cards:
- cards: []
type: horizontal-stack
- cards:
- entity: media_player.mancave_lg_tv
icon: 'mdi:satellite'
name: DirecTV
tap_action:
action: call-service
service: media_player.select_source
service_data:
entity_id: media_player.mancave_lg_tv
source: DirecTV
theme: darkblue
type: entity-button
- entity: media_player.mancave_lg_tv
entity_picture: /local/netflix.png
name: Netflix
tap_action:
action: call-service
service: media_player.select_source
service_data:
entity_id: media_player.mancave_lg_tv
source: Netflix
type: entity-button
- entity: media_player.mancave_lg_tv
icon: 'mdi:antenna'
name: Antenna
tap_action:
action: call-service
service: media_player.select_source
service_data:
entity_id: media_player.mancave_lg_tv
source: LiveTV
type: entity-button
type: horizontal-stack
- cards:
- entity: media_player.mancave_lg_tv
icon: 'mdi:youtube'
name: YouTube
tap_action:
action: call-service
service: media_player.select_source
service_data:
entity_id: media_player.mancave_lg_tv
source: YouTube
type: entity-button
- entity: media_player.playstation_4
name: PS4
tap_action:
action: call-service
service: media_player.select_source
service_data:
entity_id: media_player.mancave_lg_tv
source: Playstation
type: entity-button
- entity: media_player.mancave_lg_tv
name: Hulu
tap_action:
action: call-service
service: media_player.select_source
service_data:
entity_id: media_player.mancave_lg_tv
source: Hulu
type: entity-button
type: horizontal-stack
- cards:
- entity: script.tv_volup
hold_action:
action: more-info
icon: 'mdi:volume-plus'
name: Volume Up
show_icon: true
show_name: true
tap_action:
action: toggle
theme: darkblue
type: button
- entity: script.tv_voldown
hold_action:
action: more-info
icon: 'mdi:volume-minus'
show_icon: true
show_name: true
tap_action:
action: toggle
type: button
- entity: script.tv_mute
hold_action:
action: more-info
icon: 'mdi:volume-mute'
show_icon: true
show_name: true
tap_action:
action: toggle
type: button
type: horizontal-stack
- cards:
- entity: script.tv_ch_up
hold_action:
action: more-info
icon: 'mdi:arrow-up'
name: Channel Up
show_icon: true
show_name: true
tap_action:
action: toggle
theme: darkblue
type: button
- entity: script.tv_ch_down
hold_action:
action: more-info
icon: 'mdi:arrow-down'
show_icon: true
show_name: true
tap_action:
action: toggle
type: button
type: horizontal-stack
- cards:
- entity: media_player.mancave_tv
type: media-control
type: horizontal-stack
title: New Card TV Sources
type: vertical-stack
2 Likes
Forgot to mention I also had to set up scripts for volume up/down, mute and channel up/down. I’m sure there are better ways to do this but I plagiarized from other posts to get as far as I did
tv_volup:
alias: Volume Up
sequence:
- service: webostv.button
data:
entity_id: media_player.mancave_lg_tv
button: VOLUMEUP
tv_voldown:
alias: Volume Down
sequence:
- service: webostv.button
data:
entity_id: media_player.mancave_lg_tv
button: VOLUMEDOWN
tv_mute:
alias: Mute
sequence:
- service: webostv.button
data:
entity_id: media_player.mancave_lg_tv
button: MUTE
tv_ch_up:
alias: Channel Up
sequence:
- service: webostv.button
data:
entity_id: media_player.mancave_lg_tv
button: CHANNELUP
tv_ch_down:
alias: Channel Down
sequence:
- service: webostv.button
data:
entity_id: media_player.mancave_lg_tv
button: CHANNELDOWN
Makis
(Makis)
May 7, 2020, 5:41pm
6
This is great! It is working fine.
Thanks
if you know, how can I create a button for channel 1 in live tv? can you give an example if it is not difficult for you?
in every case I am very happy with this set up
erik7
(Erik)
May 7, 2020, 6:40pm
7
Very usefull
Where do I have to add the below?
tv_volup:
alias: Volume Up
sequence:
- service: webostv.button
data:
entity_id: media_player.mancave_lg_tv
button: VOLUMEUP
Etc…
Thanks as well!
cris
May 7, 2020, 7:08pm
8
Hi all,
don’t know if this can be helpful to you, but here is a link to add a custom card on lovelace with the LG remote:
LG_Remote_Card
it’s in Italian though.
Cris
cris
May 7, 2020, 7:09pm
9
Unfortunately that configuration does not work for me.
Cris
cris
May 7, 2020, 7:37pm
10
Got it… it was just the name of the source. worked with the following:
source: "HDMI 2"
kevin59
(KW)
May 7, 2020, 8:47pm
11
I created or added to scripts.yaml. I don’t recall whether the file existed when I started.
In your configuration.yaml file make sure you have this as well.
script: !include scripts.yaml
kevin59
(KW)
May 7, 2020, 8:48pm
12
Sorry…not sure I can help you there.
1 Like
Makis
(Makis)
May 7, 2020, 8:49pm
13
In the scripts the file is there
erik7
(Erik)
May 11, 2020, 2:17pm
14
cris, the “LG-Remote_Card” page is also available In English
With some little changes I was able to add it.
Thanks for the tip!