In my configuration, I have a URL being sent via rest_command to give GPS coordinates to a web service. Right now I have those coordinates hard-coded into the command. How can I replace those with the longitude and lattitude attributes of the device_tracker.iphone entity that I have? I can verify that within that entity, I have my current GPS long. and lat.
Current code:
rest_command:
namehere:
url: 'https://domain.com/?id=1234×tamp=1234&lat=45.234&lon=-90.234&speed=0&bearing=0&altitude=0&accuracy=5&batt=100'
I’d like to do something like:
rest_command:
namehere:
url: 'https://domain.com/?id=1234×tamp=1234&lat={{ state_attr('device_tracker.iphone', 'Lattitude' }}&lon={{ state_attr('device_tracker.iphone', 'Longitude' }}&speed=0&bearing=0&altitude=0&accuracy=5&batt=100'
But that hasn’t worked and I haven’t been able to make any combination of quotes work. Can I do templating like that right in the URL option or is there some other way?