I have a couple of scripts that trigger it (they basically set the TV to a specific image mode, the soundbar to a specific mode and the lights on the room depending on what I callout to Google Assistant) but these aren’t being run as the soundbar and lights remain the same.
Unlikely. The only thing connected to the TV is a Mi Box. It does have HDMI-CEC enabled but the Mi Box itself isn’t integrated into HA (and it’s not turning on when the TV turns on).
I’ve commented all this code out, restarted and the TV didn’t turn on. I’ve looked at the log book and there are no errors by any kind of automation trying to turn on the now non-existent switch.
I have two scripts that trigger it but they aren’t connected to any automation. They are only invoked through Google Assistant and that’s not interfering since all the other actions in the script aren’t happening.
It’s literally when I reboot host that the TV comes on, 100% of the time. I have no automation that triggers on boot so there’s no valid reason for it.
You’re implying this is a bug, however I use template switches everywhere and this issue does not occur for me. Zero service calls are performed on restart or reloading of templates. Not to mention, I’ve worked on that section of code and I can tell you without doubt: Your template switch configuration will not trigger the service call on restart.
So you aren’t looking in the correct spot.
The only way we can help is if we see your configuration.