Create a custom entity in Home Assistant to detect your public IP address and any changes to it

When having a dynamic IP address that can change without you noticing, it can be handy to have a sensor you can add to your Home Assistant that shows the current IP and can be automated to send you notifications when it changes.