taskvalueset and rules trigger.

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
leel1967l
Normal user
Posts: 73
Joined: 30 Nov 2017, 18:29

taskvalueset and rules trigger.

#1 Post by leel1967l » 25 Mar 2018, 12:29

Hi,
Does taskvalueset command triggers a rule?

I am having the following issue:
I created a dummy task (name=dummy, value=t1, task number 1) and the following rule:

Code: Select all

on [dummy#t1] do
  ..do something ..
endon
but if I fire the command

Code: Select all

taskvalueset,1,1,100
in the rules, the first rule is not triggered.

Wemos D1
Firmware: mega-20180324
Last edited by leel1967l on 25 Mar 2018, 14:33, edited 2 times in total.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: taskvalueset and rules trigger. Bug?

#2 Post by grovkillen » 25 Mar 2018, 13:03

That's by design. To trigger the rule you need to add a TaskRun after the TaskValueSet.

Code: Select all

TaskRun,<task/device nr>
Read more here: https://www.letscontrolit.com/wiki/inde ... _Reference
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

leel1967l
Normal user
Posts: 73
Joined: 30 Nov 2017, 18:29

Re: taskvalueset and rules trigger. Bug?

#3 Post by leel1967l » 25 Mar 2018, 13:16

ok thanks.

leel1967l
Normal user
Posts: 73
Joined: 30 Nov 2017, 18:29

Re: taskvalueset and rules trigger. Bug?

#4 Post by leel1967l » 25 Mar 2018, 14:32

grovkillen wrote: 25 Mar 2018, 13:03 That's by design. To trigger the rule you need to add a TaskRun after the TaskValueSet.

Code: Select all

TaskRun,<task/device nr>
Read more here: https://www.letscontrolit.com/wiki/inde ... _Reference
Hi,
something is still not right.

Here is the rule:

Code: Select all

on task1 do
  taskvalueset,1,1,%eventvalue%
  taskRun,1
endon

on [dummy#t1] do
  oled,2,1,S1=[dummy#t1]
  oled,4,1,received
  event,zone1trigger
endon
Here is how I call it (from another UNIT):

Code: Select all

sendto 16,event,task1=[rotary#counter]
Here is the log:

Code: Select all

9376109 : EVENT: task1=29
9376146 : ACT : taskvalueset,1,1,29
9376157 : ACT : taskRun,1
9379297 : WD : Uptime 155 ConnectFailures 0 FreeMem 13568
9409297 : WD : Uptime 156 ConnectFailures 0 FreeMem 13568
9413423 : EVENT: Clock#Time=Sun,14:30
But the code triggered by the value changed is not executed.

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: taskvalueset and rules trigger. Bug?

#5 Post by toffel969 » 26 Mar 2018, 00:33

leel1967l wrote: 25 Mar 2018, 14:32
grovkillen wrote: 25 Mar 2018, 13:03 That's by design. To trigger the rule you need to add a TaskRun after the TaskValueSet.

Code: Select all

TaskRun,<task/device nr>
Read more here: https://www.letscontrolit.com/wiki/inde ... _Reference
Hi,
something is still not right.

Here is the rule:

Code: Select all

on task1 do
  taskvalueset,1,1,%eventvalue%
  taskRun,1
endon

on [dummy#t1] do
  oled,2,1,S1=[dummy#t1]
  oled,4,1,received
  event,zone1trigger
endon
Here is how I call it (from another UNIT):

Code: Select all

sendto 16,event,task1=[rotary#counter]
Here is the log:

Code: Select all

9376109 : EVENT: task1=29
9376146 : ACT : taskvalueset,1,1,29
9376157 : ACT : taskRun,1
9379297 : WD : Uptime 155 ConnectFailures 0 FreeMem 13568
9409297 : WD : Uptime 156 ConnectFailures 0 FreeMem 13568
9413423 : EVENT: Clock#Time=Sun,14:30
But the code triggered by the value changed is not executed.
I think I see a syntax error, should it not be:

Code: Select all

on task1 do
  taskvalueset,1,1,%eventvalue%
  taskRun,1
endon

on dummy#t1 do
  oled,2,1,S1=[dummy#t1]
  oled,4,1,received
  event,zone1trigger
endon
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

leel1967l
Normal user
Posts: 73
Joined: 30 Nov 2017, 18:29

Re: taskvalueset and rules trigger.

#6 Post by leel1967l » 26 Mar 2018, 00:38

You are right!
You can't imagine how many times I have looked at the code without noting it...

Will try tomorrow.

Thanks

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest