Time Sensor AM/PM

That is not the same thing as the configuration.

Think about what you’re doing there. The Template Editor is for testing templates. Of course it will evaluate whatever template you paste in it.

It doesn’t care what other text you put in front of or after the template, it just processes the template. Whether you put unit_of_measurement: or my_name_is_wakestate: in front of the template is irrelevant because the Template Editor just evaluates the template, not the template’s suitability for any option or other purpose.