Binary Trend Sensor Quick Question - Trigger on increased sensor value

I am working on an automation that will tell me if my waze sensor (time to work) has increased. I believe the sensor updates every 5 minutes. While searching the forums here, I came across the trend sensor. I just wanted to make sure I understand what causes it to change from Off to On and back to Off

So lets say my commute is 30 minutes, then 5 minutes later changes to 32 minutes. I get that the trend sensor would change to on. Now 5 minutes later it changes to 30 again, I get that it would change to off. But what if it changed from 30 to 32 and 5 minutes later changed to 40. I suspect that it would just stay on (makes sense), but of course then it would not be a good trigger.

I want to know every time the sensor value increases. So I’d want something to trigger from 30 to 32 and from 32 to 40, etc.

Any suggestions?

Not sure what the state of your travel time sensor looks like, but maybe something along these lines:

automation:
  - alias: Travel time increases
    trigger:
      platform: state
      entity_id: sensor.TRAVEL
    condition:
      condition: template
      value_template: >
        {{ trigger.to_state is not none and trigger.from_state is not none and
           trigger.to_state.state|int > trigger.from_state.state|int }}
    action:
      ...

Nice, I like that approach. I think I’ll need to do a little tweaking. I actually have two work sensors, and I had one automation that I used to tell me it was time to leave for work. I think this is close, but I do realize that there would be situations where the action would not be what I want

- alias: Travel time increases
  trigger:
  - platform: state
    entity_id: sensor.time_to_work1
  - platform: state
    entity_id: sensor.time_to_work2
  condition:
  - condition: numeric_state
    entity_id: sensor.ha_runtime_in_minutes
    above: 1    
  - condition: state
    entity_id: binary_sensor.workday_sensor
    state: 'on'
  - condition: template
    value_template: >
      {{ trigger.to_state is not none and trigger.from_state is not none and
         trigger.to_state.state|int > trigger.from_state.state|int }}
  action:
  - service: script.audio_notify
    data_template:
      tts_msg: >-
        {% if states('input_select.work_location') == 'work1' and trigger.entity_id == 'sensor.time_to_work1' %}
          Traffic to the work1 just got worse,  Your estimated time in traffic is now {{ states('sensor.time_to_work1') }} minutes.
        {% if states('input_select.work_location') == 'work2' and trigger.entity_id == 'sensor.time_to_work2' %}
          Traffic to the work2 just got worse,  Your estimated time in traffic is now {{ states('sensor.time_to_work2') }} minutes.
        {% else %}
          I'm not sure where you're going today
        {% endif %}
      mplayer: "main"

I think I’m just going to create two similiar automations for each work location. So in my case I have an automation (that you just helped me with the sensor in a seperate thread @pnbruckner ) thta basically tells me, Hey you have to leave in 15 minutes (based on traffic times) if you want to get to work on time. I’ll use this to get another alert if traffic has gotten worse since the 1st announcment.

- alias: Travel time increases
  trigger:
  - platform: state
    entity_id: sensor.time_to_work
  condition:
  - condition: numeric_state
    entity_id: sensor.ha_runtime_in_minutes
    above: 1    
  - condition: state
    entity_id: binary_sensor.workday_sensor
    state: 'on'
  - condition: state
    entity_id: input_select.work_location
    state: 'work'
  - condition: state
    entity_id: sensor.time_to_leave_for_work
    state: 'true'
  - condition: state
    entity_id: binary_sensor.person1_presence
    state: 'on'
  - condition: template
    value_template: '{{ as_timestamp(now()) - as_timestamp(states.automation.notify_person1_when_its_time_to_leave_for_work.attributes.last_triggered) | int < 3600 }}' 
  - condition: template
    value_template: >
      {{ trigger.to_state is not none and trigger.from_state is not none and
         trigger.to_state.state|int > trigger.from_state.state|int }}
  action:
  - service: script.audio_notify
    data_template:
      tts_msg: "Traffic to the  work just got worse. Your estimated time in traffic is now {{ states('sensor.time_to_work') }} minutes."
      mplayer: "main"