Why are you using a template sensor instead of a binary template sensor?
It’s a binary value looking at your template.
It still should work as a sensor though, and I don’t see anything wrong with the configuration you have posted. Try it in the template editor, make sure you have the entity ids right.
I already tried the templates in the editor and everything is ok.
As for the binary sensor file, I just tried it and as opposed to sensors file at least my homeassistant starts normally. I pasted the same thing in the binary_sensor.yaml. But it still does not work. Here is what is says in the log:
Invalid config for [binary_sensor.template]: [value_template] is an invalid option for [binary_sensor.template].
Actually I just had a closer look at your config. It is not correct. You are missing sensors: and the map under it. As well as using name instead of friendly_name.