Automation template help

Hey,

This doesn’t work they way I want it to - is it possible?

  - id: 'april_changed'
    alias: April Changed Notification
    trigger:
      platform: state
      entity_id: person.april
    condition:
      condition: template
      value_template: '{{ trigger.from_state.state != trigger.to_state.state }}'
    action:
    - service: notify.mobile_app_stephen_s20
      data_template:
        title: >
          April just changed from
          {% if trigger.from_state.state == 'not_home' %}
            Away
          {% elif trigger.from_state.state == 'home' %}
            Home
          {% else %}  
            {{ trigger.from_state.state }}
          {% endif %}
          to
          {% if trigger.from_state.state == 'not_home' %}
            Away
          {% elif trigger.from_state.state == 'home' %}
            Home
          {% else %}  
            {{ trigger.from_state.state }}
          {% endif %}.
        message: ''
        data:
          clickAction: /lovelace/device_tracking

You’ll have to tell us how you want it to work. :stuck_out_tongue_winking_eye:

But I’ll guess you might want to replace from_state with to_state in the “to” part of your title tempate.