Create a MQTT switch with payload and entities variables

Hi all.

I am really stuck on something that is probally something eas. I have a switch where i want to execute a mqtt command:

  - platform: mqtt
    name: "leaf_climate"
    state_topic: "leaf/climate/runningStatus"
    command_topic: "leaf/command/climate"
    state_on: "true"
    state_off: "false"
    payload_on: "{{'startC ' + state_attr('climate.nissan_leaf_2', 'temperature') | string() }}"
    payload_off: "stop"
    icon: mdi:hvac

some how the payload is not executing should i use a value template or is this something that should work?

Hello! I guess my component “mqtt template switch” may help you. Standard component can’t do it yet.

This can be found in HACS.
But note, one day it can just stop working because of release )