Can an app enable/disable the wifi-hotspot without root?
I don't like this solution for my needs. It's documented in case someone else has a use for it.

Create a task in Tasker with the following actions:


Secure Settings plugin with the "Actions" -> "Launch Activity" configuration


Select "Settings" as the app.
Choose "[Mobile Hostspot] .wifi.mibileap.WifiApSettings" for the activity to launch.


This action opens the Mobile Hotspot setting screen where the hotspot can be turned on and off.
AutoInput plugin use the "Action" configuration to record the click on the switch.


This solution has the following drawbacks:


Screen needs to be unlocked.  (It may be possible to add steps to check if screen is locked and unlock the screen if it is.)
The "AutoInput" service needs to be enabled under the Android Accessibility setting.  This allows the AutoInput app to interact with the gui.
It's a hotchpot of paid apps, fragile setup, and weakens the security of the device.