Templates/Automation

Hi guys!

I am relatively new to Home Automation. Just picked up a RPi and installed Home Assistant. I am currently running v0.89.1. Attempting to automate some Philips Hue Scenes, but ran into some issues.

- alias: Living Room Scene
  hide_entity: true
  trigger:
    platform: state
    entity_id: input_select.living_room_scene
  action:
    - service_template: >
        {% if is_state("input_select.living_room_scene", "Romantic") %}
          scene.turn_on
        {% elif is_state("input_select.living_room_scene", "Party Mode") %}
          scene.turn_on
        {% else %}
          hue.hue_activate_scene
        {% endif %}
      data_template:
        group_name: 'Living Room'
        scene_name: >
          {% if is_state("input_select.living_room_scene", "Romantic") %}
            Romantic
          {% elif is_state("input_select.living_room_scene", "Party Mode") %}
            Party Mode
          {% else %}
            '{{ trigger.to_state.state }}'
          {% endif %}
      entity_id: >
        {% if is_state("input_select.living_room_scene", "Romantic") %}
          scene.romantic
        {{% elif is_state("input_select.living_room_scene", "Party Mode") %}
          scene.party_mode
        {% else %}
          script.pop
        {% endif %}

Error in the log shows:
2019-03-11 01:37:48 ERROR (Thread-2) [homeassistant.util.yaml] while parsing a block mapping in "/home/homeassistant/.homeassistant/automations.yaml" expected <block end>, but found '<scalar>' in "/home/homeassistant/.homeassistant/automations.yaml"

FYI, script.pop does nothing.

Please help me out. Thanks for checking!

EDIT: Pardon me. I do not know how to do the formatting.

The error log says your configuration is incorrect. You also need to repaste your configuration following the directions on the top of the site so it’s readable to us.

If you’re new to Home Assistant, you should start off making some basic automations without templates. Once you get familiar with YAML and don’t have any errors with your config, then you should try out templating.

your if statements should look like this

{% if (state_attr(trigger.entity_id, ‘total_matches’ ) | int) > 0 %} true {% else %} false {% endif %} without quotes for the variable to be evaulated