Kwh * Power price calculator

Hello all,

I briefly need your help.

Initial situation: (Awattar electricity provider “hourly price change” * kwh which I load into the car).

For this I would need a sensor or the like which calculates me per hour this for a month.
I started like this but logically this does not work…

- name: loading_monthly_eur
        unique_id: loading_monthly_eur
        unit_of_measurement: "€/kWh"
        state_class: total_increasing
        state: >-
          {{ (states('sensor.get_hourly_test') | float /1000) * (states('sensor.epex_spot_price_eur_per_kwh') | float) }}