Automatically disable mobile hotspot when no device is connected, using Tasker
I know this is an old thread, but i did not find any solution anywhere when i  wanted. So just posting the solution for other enthusiasts. 

Ok so i just added a time profile with 5mins interval (choose the time which suits you better) as the trigger.

I added a new task with actions as follows:

A1:-

    Code &gt; Run Shell

    Command:                     ip neigh show dev wlan0
    Store Output In:             %ipneigh
    Store Errors In:             %ipneigherr
    Continue Task after error:   Yes


A2:-

    Net &gt; Wifi Tether

    Set:                         Off
    IF:
         %ipneigh !~ *REACHABLE*   AND
         %ipneigh !~ *STALE*       AND
         %ipneigh !~ *PROBE*       AND
         %ipneigh !~ *DELAY*   


PS: I don't know the workings of ip neigh command. I implemented this by shear trial and error. But It works for me and i am not sure of any bugs yet. Will update with edits if i encounter or anyone comments with any.