Custom:config-template-card - trigger issue

Hi,

I am trying to show the position of my car on google maps. This works ok, but when the car moves, the gps coordinates are not available (LAT, LON=“unknown”) and an invalid map is displayed. How can I prevent displaying invalid GPS coordinates? Any ideas?

type: custom:config-template-card
variables:
  LAT: states['device_tracker.golf_position'].attributes.latitude
  LON: states['device_tracker.golf_position'].attributes.longitude
entities:
  - device_tracker.golf_position
card:
  title: Golf
  type: iframe
  url: >-
    ${"http://maps.google.com/maps?&z=18&mrt=yp&t=k&q="+LAT+","+LON+"&output=embed"}
  aspect_ratio: 80%