Map Your Family and Send Travel Updates by Push Notifications

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.

1 Like

Everything works accordingly.

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.

Thank you very much.

1 Like

I cant get this part to work (yes i have replaced trackers :slight_smile: )

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(',') }}

What names are in your input_select? You have to change those and then change the following lines accordingly.

{% if center == "Jeremy"%}
...
{% if center == "Anja"%}

Yes they are also replaced, its the platform template giving errors:

ERROR (MainThread) [homeassistant.config] Invalid config for [sensor.template]: required key not provided @ data[‘sensors’]. Got None

Did you put it under sensors? Template sensor is a type of sensor and should be embedded under one.

Also the value_template should be indented 2 spaces (and everything underneath)

Yes its under sensors.

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(',') }}
1 Like

With that code i get:

bad indentation of a mapping entry at line 89, column 20:
center_map_on:
^

Sorry. Was doing it from my phone and forgot something. I edited it above. Try again

1 Like

Now it works thank you :slight_smile:

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).

Thanks again @Jer78 ! This is great!

1 Like

First of all thanks for sharing!

When you say IOS app? Did you mean IOS Home Assistant App or iCloud? Can you please kindly elaborate.

Some sort of device_tracker from the phone (I use the iOS app here)
Some sort of Notify (Again, using iOS)

I want implement my wife has iPhone and I have an android.

@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.

On the camera part of the config. Anyway to hide the API key using secret.yaml?

@Vin yes. I put the entire URL in the secret file and just reference it

Lol… thanks :slight_smile: it was that simple :slight_smile:

1 Like