Easy script for modbus won't work

Hi guys, I’m trying a simple script but for some reasons (probably stupid) it won’t work.

Working script has a hard coded value:

set_ahs_temp_for_pdc:
  alias: "Set the temp for AHS"
  fields:
    temp:
      description: "AHS temp"
  sequence:
  - service: modbus.write_register
    data:
      hub: hub_term
      slave: 1
      address: 237
      value: 13

Not working script uses the variable temp instead of the hard coded number

set_ahs_temp_for_pdc:
  alias: "Set the temp for AHS"
  fields:
    temp:
      description: "AHS temp"
  sequence:
  - service: modbus.write_register
    data:
      hub: hub_term
      slave: 1
      address: 237
      value: "{{ temp }}"

When I try to use the script this error is shown

expected dict for dictonary value @data['service_data']. Got 13

Where 13 is the value that I’m trying to pass it.

nobody knows?!