Can´t apply custom x y values to plotly chart

I try to display custom x and y values by a plotly graph. The values are stored as attributes in a sensor:

grafik

They are stored in attributes because of the 256bit limitation of sensor values.

When I apply manually the values to the plotly graph it works:

  • entity: ‘’
    name: test
    line:
    shape: spline
    color: white
    x: [-20, -19, -18, -17, -16, -15, -14, -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
    ‘y’: [55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 54.24, 53.21, 52.16, 51.09, 50, 48.89, 47.76, 46.61, 45.44, 44.25, 43.04, 41.81, 40.56, 39.29, 38, 36.69, 35.36, 34.01, 32.64, 31.25, 29.84, 28.41, 26.96, 25.49, 24]

but trying to access the attributes and hand them over to the entity does result in an empty chart. What I tried so far:

        x: >
          {{ states['sensor.trovis_regler_vorlaufkurve'].attributes.y_werte
          }}

or

x: "[[[ return states['sensor.trovis_regler_vorlaufkurve'].attributes.x_werte; ]]]"
'y': "[[[ return states['sensor.trovis_regler_vorlaufkurve'].attributes.y_werte; ]]]"

or

    x: |-
      [[[
        return states['sensor.trovis_regler_vorlaufkurve'].attributes.x_werte;
      ]]]
    'y': |-
      [[[
        return states['sensor.trovis_regler_vorlaufkurve'].attributes.y_werte;
      ]]]

I don´t get why plotly is not able to “read” the applied values. For the last option I know that this works for another guy.