Invalid config for 'sensor' at configuration.yaml required key 'platform' not provided - new template syntax

You cannot just paste entities configured under the template integration into files like sensor.yaml and binary_sensor.yaml which are most likely included under the sensor and binary_sensor integrations respectively. They should be placed into configuration.yaml or a file properly split to be under the template integration.