Alert for Device Status

Hey,
I’m trying to set up an Alert. I’ve got a mysql DB linked, which has a table devices, with unique IDs and status (either 1 or 0). I know how to set it up for x devices offline or a %, however i want it to fire when a NEW device goes offline.

For example, let’s say I’ve got 4 devices offline at the moment. If another device goes offline, I want it to send an alert, but I don’t want it to repeat for the same IDs. Is there a way to do that?

I don’t want to create separate alerts for each device as there’s over 2000 of them in the DB.