Help with template syntax

Currently, when displaying a person.xxxxx entity in a card, it will show, “Home”, “Work”, “Away” in the card. I would like to change that behavior so instead of displaying “Away”, to display a device_tracker geolocation address instead. Below is my best attempt at doing this by creating a new entity, marcos_person, instead of using person.xxxxx. However, I’m getting the error below when starting up Home Assistant:

2020-05-11 14:01:05 ERROR (SyncWorker_0) [homeassistant.util.yaml.loader] while scanning for the next token
found character '%' that cannot start any token
  in "/config/configuration.yaml", line 37, column 10
2020-05-11 14:01:05 ERROR (MainThread) [homeassistant.bootstrap] Failed to parse configuration.yaml: while scanning for the next token
found character '%' that cannot start any token
  in "/config/configuration.yaml", line 37, column 10. Activating safe mode

Below, is what I have in my configuration.yaml

sensor:
  - platform: template
    sensors:
      marcos_person:
        value_template: >-
        {% if is_state('person.marcos_smith', 'Away') %}
        sensor.sm_a505u_geocoded_location.state
        {% endif %}
sensor:
  - platform: template
    sensors:
      marcos_person:
        value_template: >
          {% if is_state('person.marcos_smith' ,  'not_home') %}
            {{ states('sensor.sm_a505u_geocoded_location') }}
          {% else %}
            {{ states('person.marcos_smith') }} 
          {% endif %}
1 Like