Automation condition, if sensor X outputs more than

I have an automation which sends me the Home Assistant shopping list when I enter the zone of my local supermarket.
The output of my Shopping List sensor is normally: ‘Boodschappen:’

When I have some items on my shopping list, like beer, it will output: ‘Boodschappen: - Beer’.

I would like to set a condition, so the automation will only send me the Shopping List when I have items on this list. But I don’t know how this would be possible…

So the condition would be: IF output of Sensor Shopping List is more than ‘Boodschappen:’ , then send this list. How can I achieve this?

condition:
  condition: template
  value_template: "{{ not is_state('sensor.shopping', 'Boodschappen:') }}"

Great, thanks! Easier than I thought…

1 Like

By the way, if you’re going to trigger the automation with sensor.shopping changing, then you can do this:

trigger:
  platform: state
  entity_id: sensor.shopping
condition:
  condition: template
  value_template: "{{ trigger.to_state.state != 'Boodschappen:' }}"
action:
  ...
1 Like