You might try having the automation trigger every time the state of the sensor changes, then you could put the 5mm etc in the condition section. There’s some thoughts about this is the Home Assistant Cookbook:
You might try having the automation trigger every time the state of the sensor changes, then you could put the 5mm etc in the condition section. There’s some thoughts about this is the Home Assistant Cookbook: