Tojson in MQTT Button (configuration.yaml)

Hello iam totally lost.

I have no Idea how to set the Payload for my MQTT Button.
I managed to get the correct values in my Json. But i dont know what " : ’ - is needed to write it into the config :frowning:

I need the following Button config :frowning:

mqtt:

    - unique_id: bewaesserung_start
      name: "Bewässerung starten"
      command_topic: "test/relay1/cmd"
      payload_press: >
       {{ {"cyclic_timed_irrigation": {"total_number": 5, "irrigation_duration": states("input_number.bewasserung") | int(0), "irrigation_interval": 5}} }}
      availability_topic: "wled/gaderobe/status"
      qos: 0
      retain: false

The {{ {“cyclic_timed_irrigation”: {“total_number”: 5, “irrigation_duration”: states(“input_number.bewasserung”) | int(0), “irrigation_interval”: 5}} }}

is working in Template Playground. But not processed via the button.

Because payload_press does not support templates. You can use the command template to generate the payload to send

How do i reformat this query ?

I really have no Idea. Iam totally stuck with that Json formatting :slight_smile:

Edit,

i got it i think:

    - unique_id: bewaesserung_start
      name: "Bewässerung starten"
      command_topic: "test/relay1/cmd"
      command_template: '{"cyclic_timed_irrigation": {"total_number": 5, "irrigation_duration": {{ states("input_number.bewasserung") | int(0)}} , "irrigation_interval": 5'}}
      availability_topic: "wled/gaderobe/status"
      qos: 0
      retain: false

I forgot these {}