Add condition for trigger-based template sensors

I expect that they do, and I mentioned that at the end of my post. It would help for simple instances where you want to limit a trigger to anything other than a given set of states, but not if you want to combine multiple conditions or do something else more complex. Consider a case where you want to update the sensor value if the original sensor is not ‘unavailable’ or ‘unknown’ and is between 4 and 6:

- trigger:
    platform: state
    entity_id: input_text.test
    not_to: 
      - 'unknown'
      - 'unavailable'
  condition:
    - condition: numeric_state
      entity_id: input_text.test
      above: 4
      below: 6
  sensor:
    - name: test
      state: "{{ trigger.to_state.state }}"

The point being that conditions are much richer than triggers, and a common automation pattern is to trigger on anything you care about and filter in the condition. This extends that paradigm to template sensors.

- trigger:
    platform: state
    entity_id: input_text.test
  condition:
    - not:
        condition: state
        entity_id: input_text.test
        state:
          - 'unavailable'
          - 'unknown'
    - condition: numeric_state
      entity_id: input_text.test
      above: 4
      below: 6
  sensor:
    - name: test
      state: "{{ trigger.to_state.state }}"