Non-mqtt-Sensor as state information for mqtt-switch

Hallo,
is there a possibility to use a non-mqtt-sensor as state information for a mqtt-Switch?

Yes you can use whatever you want in the value template. Even though it says it is for extracting the state from the state topic.

Do I replace the state topic or the state_on, state_off entrys by a template?