Decide over which device change the volume based on which is on

Hi all,

I am newbie in HA, I even I am not sure if this is the correct subforum to post my doubt :wink:

I have an Amazon echo 4, and a broadlink rm4 pro. I have configured them without problems. I have my TV and my speakers system remotes integrated, and working fine.

Currently, if I want to change the volume of the TV I have to say “volume up on TV”, and if I want to change it in the speakers, “volume up on speakers”. But I would like to say only “volume up” and based on if the speakers are on or off (I could detect it with the power consumption of the plugs), volume up the speakers or the TV

But I do not know if this can be done using HA. I would like to try it, as I already have a raspberry pi. But I do not find any information about how to do it?

Does HA recognize Alexa commands? I do not think so. For example, that HA executes something when I give an order to Alexa. I think HA provides the list of devices and automations to Alexa, but it does not “hear” to what we say to Alexa.

Should I create a “virtual” device in HA (for example with name “test”) and configure the volume change according the state of the plug, and then say “Alexa, volume up test”, and it will rise the volume of the TV or the speakers based on the state of the speakers plug? (if the plug has power consumption, raise volume of speakers, if not, raise volume of the TV)

Is there any way to do what I would like to?

I hope I have explained myself
Thanks for your help!!

I dont have experience with Alexa but i do have a Google Home.

I don’t exactly know how to make a virtuel device, but i think that defently would be best, as you also would be able to use command as “set volume to 50” for example.
Though if your only command are “volume up” or “Volume down” without specific volume, it would defently be possible in HA,
since you could make a “shortcut” as it is called in Google Home, might have another name in Alexa app, but it is a custom saying that would fire a script, which would change the volume a fixed amount based on your conditions

Hi,
thanks for your answer.
I have been looking for, and it seems there is not equivalent to GH shortcuts in Alexa, but I will keep trying.
The first step will be how to create a virtual device in home assistant. I will try something similar to Universal Media Player