Check counter value for automation

Hi,

Does anyone know how to check a counter value for an automation?

I want to check if a counter value is less than a certain number, and if so, it should action a notification.

Any ideas? Thanks in advance…