Android phone not receiving alerts after a few hours

Hello Everyone. After searching the forum, i think my issue has to do with my android device going to sleep after a period of inactivity. This is a spare phone that i have which is dedicated to veralert on a wifi connection. It will work great for a few hours and then eventually it will stop receiving alerts in a reasonable amount of time. It will eventually send the alerts but they all come in at one time. So an example is that i have an alert sent when a door sensor is tripped. If the door is opened several times within a few minutes, it will not send any alerts, but then 20 minutes later all of those alerts come in at the same time. This makes me agree with another post on this fourm that the phone is sleeping and then eventually “wakes up” and receives the alerts. I was wondering if anyone has a manual process to prevent the phone from sleeping so that i can resolve this issue. I have tried a few things including the “stay awake” feature within the developer options as well as several apps which prevent the wifi from going into sleep mode. I do want to mention that i also have the alerts sent to my phone that i carry with me and the alerts do arrive in a timely manner. Any help would be appriciated.

Thanks,
Ryan

Settings - Wifi - Advanced (disable turn off wifi during sleep)

In addition of the phone is rooted you can use a program like setcpu or another to prevent sleep (Wakelock).