Page 1 of 1

Enable/Disable task by commands

Posted: 05 Nov 2019, 12:05
by Jedrunia
Hello,

Can I enable/disable task using commands sent by RS or WiFi or from rules?
Or
Can I have task enabled but not running/not updated? (even on wakeup/reset)

Regards
Andrzej

Re: Enable/Disable task by commands

Posted: 05 Nov 2019, 21:39
by TD-er
There is no command to enable/disable a task.
You could set the interval of the task very high and just call TaskRun (see https://espeasy.readthedocs.io/en/lates ... nds-listed ) on it from the rules.

If you set the task interval to 0, there seems to be a discrepancy between plugins whether it will use the 'default' interval, or not run at all.
So you could also check if setting it to 0 will prevent it from running.
The plugins which have TimerOptional = true will allow it to disable running the plugin on an interval.

See also this issue: https://github.com/letscontrolit/ESPEas ... -550014020

Re: Enable/Disable task by commands

Posted: 06 Nov 2019, 16:06
by Jedrunia
In the first solution, every task is run once - on boot or wake up from deep sleep.
Second solution (if it will be new feature, not a bug) is what I'm looking for. Task is active, and not run by itself.

Thanks
Andrzej