Nightmare...
I can never work out why they happen or what I do that fixes them but usually rebooting the broadband modem while all Apple devices are turned off is involved
Didn't werk...
Had to shut everything down then fire up one at a time...
I think the issue is certain things (the Chromecast for instance) powering-up before the Wifi has finished POST and therefore unable to obtain an IP Address...