Sensor data not parsed in payload for Dashboard-button, but in script?

hi, i switched from fhem to HA and now i have a script that correctly is sending my pool temps to pixelit via mqtt.publish,
but if i create a button on dashboard with activity:publish,
the sensor_date is not parsed, and the pixelit receives just the Test like “pool: {{ states(‘sensor.pool_pooltemp’) }}”

any idea what is my dumb issue ?
i already read about payload_template (which is deprecated) and other examples, but not finding any solution in web :frowning:

here is the yaml of the button:

show_name: true
show_icon: true
type: button
name: Pooltemp senden
icon: mdi:thermometer
tap_action:
  action: perform-action
  perform_action: mqtt.publish
  target: {}
  data:
    topic: pixelit/PixelIt-7402873/setScreen
    retain: true
    payload: |-
      {
                    "text": {
                        "textString": "pool: {{ states('sensor.pool_pooltemp') }}",
                        "scrollText": "auto",
                        "bigFont": false,
                        "centerText": false,
                        "scrollTextDelay": 40,
                        "hexColor": "#FFFFFF",
                        "position": {
                            "x": 0,
                            "y": 1
                        }
                    }
                }
entity: sensor.pool_pooltemp

as i am somehow an experienced It Nerd, i assume only the quotation seems to avoid this, but in script it is working ,

confusing me

Limitations

It is not possible to use templates for actions. But calling a script is a good alternative.

confusing, found this solution in forum…here, or Simon42… :woozy_face:
where the payload_template was used, but
payload was suggested

Always use the docs. You can use a template in the payload of mqtt.publish where templates are supported, like in scripts; but not where they aren’t, like in actions.

Just make the button call the script.