Sensor HA always unaviable

Hi All,
I have try to do a new sensor in HA to convert coordinates, the configuration is valid but the Sensor state is always unavailable .Could you please help me
this is the code

  - platform: template
    sensors:
        latitufede:
          attribute_templates: 
            data: >-
             {% set lat1 = state_attr('sensor.fordpass_gps' , 'latitude') | float %}
             {% set lat2 = state_attr('sensor.fordpass_gps' , 'latitude') | int %}
             {% set baby = ((lat1 – lat2) * 60) | int %}
             {% set pippo = (lat1) | round(1, default=0) | int %}
             {% set pluto = ((lat1 – lat2) * 60) | round(1, default=0) | int %}
             {% set papero = (((((lat1 – lat2) * 60) | round(5, default=0) | float ) - baby)*60) | round(1) %}
             {% test_json4 = {"temp4": pippo,"unit4": "°"} %}
             {% json5 = {"temp5": pluto,"unit5": "'"} %}
             {% json6 = {"temp6": papero,"unit6": "''"} %}
          value_template: >-
              {{ json4.temp4 }}{{ json4.unit4 }}{{ json5.temp5}}{{ json5.unit5 }}{{ json6.temp6}}{{ json6.unit6 }}

The value_template can’t access the variables from your data attribute like that, test_json4 should be json4, and a couple of your set statements are missing their set.

sensor:
  - platform: template
    sensors:
      latitufede:
        value_template: >-
          {% set lat1 = state_attr('sensor.fordpass_gps' , 'latitude') | float(0) %}
          {% set lat2 = state_attr('sensor.fordpass_gps' , 'latitude') | int %}
          {% set baby = ((lat1 – lat2) * 60) | int %}
          {% set pippo = (lat1) | round(1, default=0) | int %}
          {% set pluto = ((lat1 – lat2) * 60) | round(1, default=0) | int %}
          {% set papero = (((((lat1 – lat2) * 60) | round(5, default=0) | float(0) ) - baby)*60) | round(1) %}
          {% set json4 = {"temp4": pippo,"unit4": "°"} %}
          {% set json5 = {"temp5": pluto,"unit5": "'"} %}
          {% set json6 = {"temp6": papero,"unit6": "''"} %}
          {{ json4.temp4 }}{{ json4.unit4 }}{{ json5.temp5}}{{ json5.unit5 }}{{ json6.temp6}}{{ json6.unit6 }}

FWIW, the you could also use:

sensor:
  - platform: template
    sensors:
      latitufede:
        value_template: >-
          {% set lat1 = state_attr('device_tracker.b130dl' , 'latitude') | float(0) %}
          {% set x =((lat1 - lat1|int) * 3600)|round(1) %}
          {{ lat1|int }}°{{ (x // 60)|int }}'{{ (x % 60) }}"

EDIT: fixed indent error

Thank you for your support, I have change the parameter as your suggested, but the sensor is always unavailable

Are you getting the proper output from the template when you paste it in the Developer Tools > Template tool?

I solved thanks, the problem was the code formatting