I don’t understand what you are trying to get at with the API keys linked to devices (they aren’t). I use the same API key for all of my google API calls (html5 push notifications, travel time, maps) because I enabled all of the APIs on a single project on googles website.
Reread the OPs configuration for the cameras and you’ll see that the API calls takes a latitude/longitude point(s) and your API key. A single API key handles an infinite number of latitude/longitude points (ignoring API rate limits).
If you can get a single map down from Google, then odds are you have an error somewhere else. Check your configuration to make sure valid latitude/longitude points are being fed to the cameras URL.
After redo everything again. Everything works fine now. Street view display, sometime have no image due to private road. But once I go outside, it display normally. I didn’t see any image yesterday because of devices are home and private road therefore no picture to display.
I cant get this part to work (yes i have replaced trackers )
center_map_on:
value_template: >-
{% set center = states.input_select.center_map_on.state %}
{% if center == “Jeremy”%}
{% set lat = states.device_tracker.jeremys_iphone.attributes.latitude %}
{% set long = states.device_tracker.jeremys_iphone.attributes.longitude %}
{% elif center == “Anja”%}
{% set lat = states.device_tracker.anjas_iphone.attributes.latitude %}
{% set long = states.device_tracker.anjas_iphone.attributes.longitude %}
{% else %}
{% set lat = states.device_tracker.jeremys_iphone.attributes.latitude %}
{% set long = states.device_tracker.jeremys_iphone.attributes.longitude %}
{% endif %}
{{ [lat,long]|join(’,’) }}
@dawnlord can you post your config so I can see where the problem may be? Also if you can use the </> formatting in the toolbar it’s more helpful. Thanks
I have copied all parts and everything works but this:
- platform: template
center_map_on:
value_template: >-
{% set center = states.input_select.center_map_on.state %}
{% if center == "Jeremy"%}
{% set lat = states.device_tracker.xxx.attributes.latitude %}
{% set long = states.device_tracker.xxx.attributes.longitude %}
{% elif center == "Anja"%}
{% set lat = states.device_tracker.yyy.attributes.latitude %}
{% set long = states.device_tracker.yyy.attributes.longitude %}
{% else %}
{% set lat = states.device_tracker.xxx.attributes.latitude %}
{% set long = states.device_tracker.xxx.attributes.longitude %}
{% endif %}
{{ [lat,long]|join(',') }}
Now i tried as you said: (yyy = person 1, xxx = person 2).
Failed config
sensor.template:
- Invalid config for [sensor.template]: required key not provided @ data[‘sensors’]. Got None.
platform: template
center_map_on: None
- platform: template
center_map_on:
value_template: >-
{% set center = states.input_select.center_map_on.state %}
{% if center == "xxx"%}
{% set lat = states.device_tracker.xxx.attributes.latitude %}
{% set long = states.device_tracker.xxx.attributes.longitude %}
{% elif center == "yyy"%}
{% set lat = states.device_tracker.yyy.attributes.latitude %}
{% set long = states.device_tracker.yyy.attributes.longitude %}
{% else %}
{% set lat = states.device_tracker.xxx.attributes.latitude %}
{% set long = states.device_tracker.xxx.attributes.longitude %}
{% endif %}
{{ [lat,long]|join(',') }}
sensor:
- platform: template
sensors:
center_map_on:
value_template: >-
{% set center = states.input_select.center_map_on.state %}
{% if center == "xxx"%}
{% set lat = states.device_tracker.xxx.attributes.latitude %}
{% set long = states.device_tracker.xxx.attributes.longitude %}
{% elif center == "yyy"%}
{% set lat = states.device_tracker.yyy.attributes.latitude %}
{% set long = states.device_tracker.yyy.attributes.longitude %}
{% else %}
{% set lat = states.device_tracker.xxx.attributes.latitude %}
{% set long = states.device_tracker.xxx.attributes.longitude %}
{% endif %}
{{ [lat,long]|join(',') }}
WOW - this is awesome. I continue to be blown away by the power of Home Assistant and the contributions individuals make for neat solutions like this. After a bunch of copy/pasting and some find/replacing I was able to stitch this together in a single package file and get it to work. Now I can work on tweaking little things with it (Notifications, timestamps, etc).
@Vin Yes, I use the iOS app for the device_tracker but I believe any sort of device_tracker that provides lat and long coordinates into HA should work just as well.