Enable/Disable task by commands

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Jedrunia
Normal user
Posts: 8
Joined: 28 Mar 2019, 09:22

Enable/Disable task by commands

#1 Post by Jedrunia » 05 Nov 2019, 12:05

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

TD-er
Core team member
Posts: 1776
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Enable/Disable task by commands

#2 Post by TD-er » 05 Nov 2019, 21:39

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

Jedrunia
Normal user
Posts: 8
Joined: 28 Mar 2019, 09:22

Re: Enable/Disable task by commands

#3 Post by Jedrunia » 06 Nov 2019, 16:06

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

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests