Error setting input variable to sensor with @ symbol

I’m trying to set an input text helper with the data from a sensor from swatch which contains “@42” or whatever the beat time is at the time.

service: input_number.set_value
target:
  entity_id: input_text.internet_time
data_template:
  value: "{{ states('sensor.beat_time') | string }}"

It gives me the error in traces

“Error: expected float for dictionary value @ data[‘value’]”

I thought I did this right. That’s the information under “edit as yaml” not the whole automation. I assume it’s because the sensor has an “@” sign? How do I properly format it using templating in the automation?

You are calling the service “input_number.set_value”, but you are setting a target that is an input_text.
Either change your service or change you target and then make sure that the value is a number by removing the @

Oh crap. My bad.

Okay so first it failed because it said it expected a float, so I changed it from string to float, then it said it needed a default so I added (0) and it seems to have just set it to zero.

alias: "Beat time Internet time "
description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.beat_time
condition: []
action:
  - service: input_text.set_value
    target:
      entity_id: input_text.internet_time
    data_template:
      value: "{{ states('sensor.beat_time') | float (0)}}"
mode: single

I don’t get what I did wrong.

How do I make it ignore the @ sign and work?

{{ states('sensor.beat_time').replace('@','') | float (0)}}