Need help setting up a simultaneous toggle for two Broadlink IR devices

I have learned IR power codes with the Broadlink integration for two devices, samsung_monitor and denon_media_server. I have tested both with an action like

service: remote.send_command
target:
  entity_id: remote.universal_remote
data:
  device: denon_media_server
  command: power

Now what I want to do is have a card with a button that will toggle both devices at the same time. Should I do that just with the YAML in the card, or set up a script? In either case, how do I structure the YAML to allow it to perform both actions? I don’t think I can just paste the above twice with two different devices. Or can I?

You could try making a custom Broadlink switch for each device, then combining the two in a group.

Is a group an entity in HA? I ask because I am trying to get these devices exposed to Alexa.

Yes. You should be able to expose that to Alexa.

A switch is not that good of an idea for a remote, as you don’t get feedback on the state of the switch.
Your first idea to combine them in a script is the way to go. You add two actions, one remote.send_command for each of the remotes. You can directly expose this script to Alexa.

Not sure what you mean - it’s a normal switch entity.

Block the IR transmitter and toggle the switch. Do you still have the correct state?
If you don’t get feedback on the state it is a cleaner way to work with stateless entities. For the purpose of this thread a switch will probably do the job, you just end up with an entity that might have the wrong state, that’s all I’m saying.

You can never have the correct state of a device controlled by IR - communication is one way. A switch gives you an assumed state, which is the best you can do. :grin:

The reason I’m asking about this is because I currently have a script called toggle_media_center that uses a remote.send_command to each device. That is not offered as something I can expose to Alexa. Should it be? In fact, there is not a lot I can expose to Alexa that I’d want to. None of my lights, etc., show up in the list.

How are you integrated with Alexa? If you have a Nabu Casa subscription you can add them (and the script) in Settings | Voice Assistants | Expose.

Edit: If you haven’t got a subscription, there seems to be an integration in the June release. Don’t know the details.

I do have a subscription. Yesterday when I first set it up, there was almost nothing exposable. I just went back and most everything is.:man_shrugging:Must take it a while to find everything.

So no need to set up switches or groups. I was thinking it was kind of silly to copy the codes into script data when there is already a remote.send_command that will run the codes that automatically.

1 Like

I’ve seen others suggest you can use a power monitoring smart switch and use the voltage to tell for sure if they are on or off based on current they are drawing. Sounds like a lot of trouble to me.