IP Device offline/online notification help

Hi, I have a wifi connected IP device on my local HA network which occasionally goes offline for no obvious reason. I’d like a single notification message (via email) when it has been offline for say 10mins and a second email when it appears back online. I’ve found a few hints at how to do parts of this but has anyone a complete solution. I’m pretty new to all of this so any help appreciated. Thanks

  • ping sensor to check if it is online
  • email notifier to send an email

Thank you Francis for your helpful response - apologies for my late acknowledgement - been busy on other things!
Lance