Advice on scene integration with Alexa

Hi all. I’m looking to use a broadlink rm4 to handle turning on a non-smart TV and switching to the appropriate input. I’ve got the codes learned and from what I’ve found from reading online, this needs to be added as scripts to send a sequence of remote.send commands with delays as required. Everything works fine from Home Assistant but I’m struggling a bit to get this working with Alexa.

I use nabucasa and I can see the scripts showing in the alexa app as scenes. I think the problem is the wording I’m choosing and how alexa is interpretting that. I currently have:

"Apple TV on (switch on tv and switch input to hdmi)
“TV on” (send tv power off command)
“TV off”. (switch on tv and switch input to digital)

The issue is if I say “Alexa, new tv on”, I get a response of “A couple things share that name: new tv off and new tv on”. If I choose one, it thinks for a while and then responds with “tv on not responding”

I’ve tried renaming the scripts to thinks like “watch tv” but I then get “I couldn’t find any enabled video skills that can do that”.

I’m hoping this kind of alexa voice control for switching on a tv and switching inputs is quite a common use case. What kind of wording have others used that doesn’t confuse Alexa. Any pointers?

Another thing I haven’t got to yet is how home assistant handles this for multiple rooms. I’ve got TV’s and apple tvs in multiple rooms and ultimately want the same “watch tv” command to work in whichever room hears the command. I can get this working with “turn on lights” due to having all lights in HA exposed to Alexa and then putting the in rooms within the Alexa app. Any ideas on how to achieve the same user experience when it comes to controlling IR devices via broadcomm? My current clunky thinking is using different phrases in different rooms but that’s not very family friendly.

Any pointers greatly appreciated.

Alexa expects you to turn scenes on… so, if your scene is called “new tv on”, she needs you to say “Alexa, turn on new tv on.” Because of this, it is best to name scenes/script in such a way that they do not contain any of the general keywords that it is listening for.

Before Amazon changed how last_called is reported and it became unreliable last year, this was relatively easy to do using the Alexa Media Player integration’s “last_alexa” sensor. For now, I have resorted to adding all the lights in a room to a room group in the Alexa app so that I can use basic “turn on the lights” phrases in any room… I don’t know if that would work for TVs, but you could try it.

Other Tips
It may be necessary to set up a routine within the Alexa app so that a particular trigger phrase executes your HA script. For example, I set up routines in Alexa that trigger on phrases like “Alexa, start Netflix / ,turn on Hulu”. These each trigger their own script in HA that handles turning my TV on and selecting the correct source. It’s more of a hassle than the process was using the last_alexa sensor, but it is, currently, much more reliable.

For on/off operations, another option is to create a template switch in HA.

Alexa hasn’t evolved yo be able to diffeniate tvs and entertainment stuff like that yet. Best it can donis understand if you want to listen to music it knows where you asked and responds accordingly.

Until fhey add that (which it only logically makes sense that they’re probably already working on it and itll show up sometime in the future)

You can
rename your devices and scenes inside Alexa to fix naming issues. Master Bedroom TV v. Living Room TV

Or (very complex version)

Add the Alexa Media Player custom add in.
Youd need it because you can use it to create a sensor for ‘last Alexa spoken to’ then use that in an automation of some type that gets triggered when you say ‘watch TV’ and thrm goes to lool up what Alexa raised the event and turn on the correct TV.


Wait until Amazon eventually adds it. My unscientific and no insider information self bets that happens within 18 months.

Thanks for the feedback chaps. All really helpful. I had tried setting up alexa routines in the app which works ok but I’d prefer to keep logic and config in HA and keep Alexa as dumb as I can.

Template switches look to be a pretty good answer in having a “living room tv” and “living room films” switch with different on services and a common off service. Surprisingly, turning on “living room tv” and then turning off “living room films” works fine which is what I would have wanted.

The only challenge now is that sometimes a “Alexa, turn off living room tv” will actually turn off everything in the Alexa living room group which includes the lights and tv. The echo device is right next to the TV so perhaps the voice is getting mingled with TV background sounds.