Virtual Switch to turn on Roku/TV/Receiver

Hey all-

I’m new to the Home Assistant platform, coming off smartthings, so far really enjoying it and all of the help from others! Before I go down a rabbit hole, I’d like to see if anyone could point me in the right direction of the following:

I’d like to create a virtual button on the dashboard that when you press it, it turns on:

TV
Receiver
Roku
And opens to Youtube

Similar to how a Harmony remote did in the day. All of these are within the HA environment, but I’m just not sure where to start.

Eventually I’d like to expose it to Alexa, but wasn’t sure if anyone had anything set like this.

Thanks!

You have to make a script, and then call the script from a button

Here is one I have to turn on the stereo, and select the source:

From there, just call the script on an entity card.

cards:
              - type: custom:button-card
                color_type: card
                color: rgb(160, 160, 160)
                icon: mdi:power
                size: 40%
                styles:
                  card:
                    - height: 120px
                    - width: 120px
                tap_action:
                  action: call-service
                  service: script.new_scriptt
                name: 'On'
1 Like

Can the same entity button card turn off the TV? Versus having to make a separate script to turn off everything and a separate card to control that script with a tap. I’d like more of a “toggle” action. Thanks!

I am sure it possible, with a toggle or something else. I just have an on and off button, works for me.

Or, write it in the script somehow,

If Device Is Powered on, then Power Off Device…