Send notification when IP (global) changed

Some correction… The version with ‘dnsip’ is working. And I receive notification…
The previous version - still something wrong. No notifications send.

This one is no good:

alias: Send iPhone notification when external IP changed
description: Automation to send notification to iPhone when external IP changed
trigger:
  - platform: state
    entity_id: sensor.external_ip
condition:
  - condition: template
    value_template: >-
      {% if trigger.from_state.state and trigger.to_state.state %} true {% else %} false {%
      endif %}
  - condition: template
    value_template: >-
      {% if trigger.from_state.state == 'unknown' %} false {% else %} true {%
      endif %}
  - condition: template
    value_template: >-
      {% if trigger.to_state.state == 'unknown' %} false {% else %} true {%
      endif %}
  - condition: template
    value_template: '{{ trigger.from_state.state != trigger.to_state.state }}'
action:
  - service: notify.mobile_app_dpiphone8
    data:
      title: Your External IP address has changed
      message: >-
        Your External IP changed from {{ 'trigger.from_state.state' }} to {{
        'trigger.to_state.state' }}
mode: single

After few days of testing - looks like this is O.K.
I would like also have displayed the time/date when last change occured.
Any suggestions the simplest way to do that?

The sensor.external_ip and sensor.dnsip wasn’t working for me. I had to change it to sensor.myip.

trigger:
    - platform: state
      entity_id: sensor.myip
  condition:
    - condition: template
      value_template: '{{ trigger.to_state.state != ''None'' }}'
  action:
    - service: notify.skyler_sms
      data:
        title: Home Assistant - IP changed
        message: "Public IP is now: {{ states.sensor.myip.state }}"