I decided to share what I have that partially works to see if it helps anyone. Please feel free to contribute if you see something wrong! The script works great sometimes and after the TV power cycling it may or may not work. If it does work, it works for the entire time the TV is on.
Code is here (work in progress):
[Link: github.com]