I am working on a notification automation, that will send a message when when a power level changes to below a threshold, this works great. But, I want to also add an additional condition that checks to ensure “network connected state” was NOT recently “offline”, say within the last 60 seconds. I have an entity that does monitor the connectivity of the device. Not sure if I can do this or not.
Ultimately, I am trying to make it so the threshold notification doesn’t send a message when/if the power/network goes out so I wanted it to check the online/offline state and as long as it was connected it will send the alert, and it won’t send it if it was recently offline as it’s a false positive on the power level change as the primary condition.
This sort of checking is foreseen in the automation syntax. Use an ‘entity’ condition in the ‘conditions’ section of the automation, that checks the state of your connectivity checking entity. Then fill in the desired time it should have been in that state in the ‘for’ field of that condition.
I’ll point out that it is fairly easy to make a condition that “entity has been in state online for at least 60 seconds” but it is a bit more difficult to make a condition for “entity has been in any state(s) except offline for the previous 60 seconds”.
Hopefully the difference is apparent and hopefully you meant the former and not the latter.