Template not evaluated with platform rest


I have created a sensor to retrieve the information of an API with the platform rest and resource_template.

If the resource template is harcoded, it works well and I get the information I need

resource_template: "https://api.meteo-concept.com/api/location/city?token=myToken&latlng=xx.xxxxx,yy.yyyyy"

If the resource template uses the longitude and latitude as a parameter of my phone, the URL is not well evaluated. Here is an example :

resource_template: "https://api.meteo-concept.com/api/location/city?token=myToken&latlng={{ state_attr('myPhone', 'latitude')}},{{ state_attr('myPhone, 'longitude')}}"

In the Debug I have this :

resource_template: "https://api.meteo-concept.com/api/location/city?token=myToken&latlng=none,none"

It looks as if the URL was not well evaluated before being sent to the API.
I may have found other posts with the same issue but still unsolved.

Do you know how to solve this issue ?
Thanks to all for your help.

What does that give in the template debugger?

if it’s coming out None,None then your template is wrong. Either the wrong entity_id or the wrong attribute. Can you please show the actual code you’re using instead of this fake abbreviation in your post?

Thanks to all

The issue was not the template itself but the time needed during the start of HA to update the longitude/latitude sensor.
With a sensor.uodate, it has been solved.
Sorry for the trouble