Hello how are you?
I wanted to consult you with two things that I don’t know how to solve.
The first is when I turn on the TV and it starts a certain source and has to change the input.
Second case when I change the input
I’m a little lost with this
I use a broadlink to change the source of the tv
Could you guide me a bit to know how I can do it? Thanks
I do not pretend that they do it but that they guide me. Thank you
input_select:
name: source samsung tv
options:
- hdmi1
- hdmi2
- av
Please state your model of Samsung TV.
I do not self own a Samsung TV anymore, but I believe that many TVs that can be pulled as media players in HA also can be controlled the same way, so maybe there is no need for the Broadlink.
As I stated I do not have a Samsung TV, but if a TV is having an interface to present values, then it usually also have a way to change those values.
Sometimes it might require an integration or some extra configuration, but the ones that can help you probably have to know the TV model to give you the best way to do it.
Make sure you are checking for things like input._select shown above, small errors like that will just make everything more difficult.
You can’t just piece together service calls like this. Check Developer Tools → Services to see what services are available and how to use them. To change what an input_select has currently selected, use something like this:
For your second case, what is it not doing that you expect it to do? I don’t have a remote to check the service call for you, can you do it how I described above?
My other question was how to do so that when an input_select changes, a broadlink remote control executes several actions to get to the source I chose. For example if I select hdm2 and I am in 1 I have to change once but if it is before several times. I do not know if you understand.
You should not change your entity_id.
The entity_id is the entity you want to call the service on, which should be your TV.
The line {{ state_attr(‘media_player.bdv_n9200w’, ‘media_title’) }} is the one that gets replaced with the output from it, so if it outputs hdm1, then the TV changes to that.
You can test the output by opening Developer Tools in the Left sidebar and then choose Template in the top.
Delete the demo template text and paste in
Hi
I used the developer template and this {{state_attr (‘media_player.bdv_n9200w’, ‘media_title’)}} at a certain point brought me back TV. So this value is correct but not how I am writing it since it tells me that it is not correct
You are trying to change the value of the HA input_select variable with your script and the value you change want to change it to needs to be defined as an option in the imput_select definition.
What I want is for you to change the selection from the source list when you turn on the computer or change it from a remote control.
Logger: homeassistant.config
Source: config.py:464
First occurred: 18:17:45 (2 occurrences)
Last logged: 21:38:08
Invalid config for [automation]: [service] is an invalid option for [automation]. Check: automation->service. (See ?, line ?).
It describes the problem for you: This is an invalid config. You can’t just throw service calls into an automation, they must be in the action list. I’d recommend reading through the docs here and the ones linked at the end, as well as the docs for service calls.
I put the solution to this post. Thank you very much everyone for the help
- alias: bdv_n9200w_input_select
description: "Set input select to value of media title whenever media content id changes"
trigger:
- platform: state
entity_id: media_player.bdv_n9200w
attribute: media_content_id
condition: []
action:
- service: input_select.select_option
data:
option: "{{ state_attr('media_player.bdv_n9200w','media_content_id')[7:] }}"
target:
entity_id: input_select.home