It's a very complex topic in controlling AV equipment from DIY devices. Some AV equipment makes it easier by publishing their API, others hide it. And there are external Infrared (IR) blasters that can be accessed from Tasker, but again you have to do the research to know what commands to send to the blaster to generate the proper IR signal for each type of function.
There are some A/V Automation apps that have an API that allows the automation to receive external commands. I use the Allonis system (
allonis.com), and I do send commands from Tasker to my LG TV via Allonis to do things. (Allonis is rather expensive, and has a steep learning curve, though).