Error with device entity as only numbers

Hass.io 0.50.2, Intel NUC

Well it works. But I have an issue with google maps.

device_tracker.10526 is the entity, in known_devices.yaml it is ‘10256’ if I use 10526 in google api it fails, works fine with the HASS map and button on top of page but not google. The only other difference that I have seen is traccar has 14 decimal places while the other provider is 7 except on iphone it is 14 decimal places and it has worked.
How can I change the entity, and where does it come from?

error message:

2017-08-12 03:09:21 ERROR (MainThread) [homeassistant.components.camera.generic] Error parsing template <homeassistant.helpers.template.Template object at 0x7faa938b1dd8>: UndefinedError: homeassistant.helpers.template.DomainStates object has no element 10526

known_devices.yaml content:

'10526':
  hide_if_away: false
  icon:
  mac:
  name: Randy
  picture:
  track: true
  vendor:

camera.yaml content:
camera 8 works, camera 9 not so much

#camera 8:
  - platform: generic
    name: tester_Randy
    still_image_url: https://maps.googleapis.com/maps/api/streetview?location={{ states.device_tracker.randy_cell.attributes.latitude }},{{ states.device_tracker.randy_cell.attributes.longitude }}&size=456x456&key=mykey
    limit_refetch_to_url_change: true   
#camera 9:
  - platform: generic
    name: traccar_Randy
    still_image_url: https://maps.googleapis.com/maps/api/streetview?location={{ states.device_tracker.10526.attributes.latitude }},{{ states.device_tracker.10526.attributes.longitude }}&size=456x456&key=mykey
    limit_refetch_to_url_change: true           

and entity information:

device_tracker.10526 Our_Home
source_type: gps
latitude: 44.38544986355593
longitude: -69.40444697877102
gps_accuracy: 0
totalDistance: 12152.61
ip: 45.2.190.13
protocol: osmand
speed: 2.0823703860354423
address: null
status: online
lastUpdate: 2017-08-12T05:47:55.486+0000
friendly_name: Ran

Found the solution:

square brackets and single quote, remove the 1 period between device_tracker and id.

take this:
device_tracker.10526
and make it:
device_tracker[‘10526’]

1 Like

Hi,

Have you had any luck in exposing the device.tracker attributes as a template sensor? (I can see that you also use traccar by the attributes you have)

I have this, but I can’t seem to get it to pull the values although the values are present in the attributes when I go to developer tools.

Here is what I have as the template sensor. Any help would be greatly appreciated…

golf_address:
  friendly_name: 'Current Golf Address'
  value_template: '{{ states.sensor.device_tracker.golf.attributes.address }}'

golf_odometer:
  friendly_name: 'Golf Odometer'
  value_template: '{{ states.sensor.device_tracker.golf.attributes.totaldistance }}'
  unit_of_measurement: mi

golf_speed:
  friendly_name: 'Golf Speed'
  value_template: '{{ states.sensor.device_tracker.golf.attributes.speed }}'
  unit_of_measurement: mph

image

image

Yeah I’m very noob but I think .sensor shouldn’t be there, just states.device_tracker.blablabla

1 Like

Sometimes it just takes another set of eyes… ! that worked!

Thank you very much