Smart WiFi

I could use help setting up a smart WiFi profile. What I want to do seems relatively straightforward: have WiFi turn off when I'm not connected (e.g., when I leave home), and then turn on every 15 minutes, check to see whether it can connect to a known network, and then react appropriately (i.e., stay on if connected, turn back off if not). For whatever reason, I cannot get this to work. I'm admittedly a novice, so my mistake(s) may be obvious. I'll list the two profiles I've put together; any advice would be welcome:

Profile 1: WiFi Connected
If WiFi connected, set %WiFi to Connected
Exit task: set %WiFi to Disconnected

Profile 2: WiFi Disconnected
If %Wifi equals Disconnected, then:
1. Turn WiFi off
2. Wait 15 minutes
3. Turn WiFi on

I know this is extraordinarily basic, but something is not working. Typically the WiFi will just keep turning off even when I'm at home or the office for a while. What am I missing?

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License