If that is indeed the case, that does not seem like good coding. Instead of duplicating the code in each room, I'm duplicating the macro (with the same code).
I'm thinking, if I create a variable.
When bedroom off -> set value of this variable to bedroom tv
When living room off -> set value of this variable to living room tv
In the macro,
If variable = bedroom tv, execute commands a, b,c on bedroom tv
If variable = living room tv, execute commands a, b, c on living room tv
If this works, it is still a lot of hard coding and repetition.
Ideally it would be, when room off, extract the value of which room and then provide this value to the macro.
In the macro -> get the <room> -> execute commands a,b,c on the the <room> tv
Possible?