Here's my solution. It seems to work well as it can join Wifi and refresh a device in about 1 second after a power failure; also it doesn’t take more than a second for the device to discharge the AC adapter. It does 3 refresh calls to your canary bulb. Cost is $5 shipped (in US), assuming you have a spare USB adapter.
EDIT: This doesn't always work for short blips because the capacitors don't fully exhaust and power down the device; it works for longer outages though. If you have a UPS hooked to a Linux system you can edit apcupsd to call your maker API refresh - this will help fix the blips.