The Home Assistant Cookbook is also a good source of information.
As far as the TV goes, if it’s a dumb one you’re really limited to actions that could be carried out via the remote control, but you can reproduce these with a universal IR remote like the Broadlink RM4.