Simple rule does not work, why?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
scaevola
Normal user
Posts: 11
Joined: 18 Jul 2017, 07:45

Simple rule does not work, why?

#1 Post by scaevola » 19 Mar 2020, 13:52

Hi,
Today I updated my ESP01 that gathers temperature from all house sensors and sends it to ThingSpeak. This device also has its own Dallas sensor and measures the temperature of central heating.
In previous version I had a simple rule that was rewriting the value of Dallas to dummy sensor, and next this dummy is sent do ThingSpeak along with other variables.
But after this update the rule stopped working and I don't know why.

Code: Select all

On Clock#Time do
TaskValueSet 2,3,[Temp_CO#Temp_CO]
endon
What is going on? I just copied this code from earlier settings.
Log:

Code: Select all

3619475: DS: SP: f1,2,4b,46,7f,ff,c,10,d6,OK,6
3619475: DS : Temperature: 47.06 (28-ff-99-c8-85-16-3-da)
3619502: EVENT: Temp_CO#Temp_CO=47.06
3621659: HTTP : C004 Success! HTTP/1.1 200 OK^
3632141: WD : Uptime 61 ConnectFailures 0 FreeMem 21128 WiFiStatus 3
3635294: DS: SP: ee,2,4b,46,7f,ff,c,10,78,OK,6
3635294: DS : Temperature: 46.88 (28-ff-99-c8-85-16-3-da)
3635362: EVENT: Temp_CO#Temp_CO=46.88
3647586: EVENT: Clock#Time=Thu,13:52
3647624: TaskValueSet 2,4,24.44
3647626: Command: TaskValueSet
3649131: TaskValueSet 2,1,17.25
3649132: Command: TaskValueSet
3649194: TaskValueSet 2,2,13.62
3649196: Command: TaskValueSet
3651109: DS: SP: ea,2,4b,46,7f,ff,c,10,6d,OK,6
3651109: DS : Temperature: 46.63 (28-ff-99-c8-85-16-3-da)
3651161: EVENT: Temp_CO#Temp_CO=46.63
3660646: Dummy: value 1: 17.25
3660647: Dummy: value 2: 13.62
3660647: Dummy: value 3: 0.00
3660647: Dummy: value 4: 24.44
3660661: EVENT: Wrapitup#Temperatura_PokojNGar=17.25
3660761: EVENT: Wrapitup#Temperatura_zewnetrzna=13.62
3660861: EVENT: Wrapitup#Temperatura_CO=0.00
3660961: EVENT: Wrapitup#Temperatura_Salon=24.44
3662141: WD : Uptime 61 ConnectFailures 0 FreeMem 21096 WiFiStatus 3
3666932: DS: SP: e7,2,4b,46,7f,ff,c,10,11,OK,6
3666932: DS : Temperature: 46.44 (28-ff-99-c8-85-16-3-da)
3666961: EVENT: Temp_CO#Temp_CO=46.44

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

Re: Simple rule does not work, why?

#2 Post by TD-er » 19 Mar 2020, 14:01

Do you have multiple dummy tasks?
Make sure it is set to the correct output type and save it (the dummy task) again.

scaevola
Normal user
Posts: 11
Joined: 18 Jul 2017, 07:45

Re: Simple rule does not work, why?

#3 Post by scaevola » 19 Mar 2020, 14:08

Hi,
no, I just have only one dummy task. Moreover it is copied from previous version (I saved the settings and loaded them again after update).

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

Re: Simple rule does not work, why?

#4 Post by TD-er » 19 Mar 2020, 14:16

What do you want to do with the value(s) stored in the Dummy?
Is there a controller coupled to this dummy?
If so, then I guess you also want to "run" this dummy task by calling taskrun.

scaevola
Normal user
Posts: 11
Joined: 18 Jul 2017, 07:45

Re: Simple rule does not work, why?

#5 Post by scaevola » 19 Mar 2020, 15:06

The values stored in dummy are sent to ThingSpeak server.
I have a controller coupled with dummy and it works - the data are sent to the server. But this single variable from dallas does not copy to dummy.
I don't need any taskrun, since the controller works every minute.

EDIT:
Allright, I know what is going on. The rule

Code: Select all

On Clock#Time 
does not work. Thus the condition is not met and variable is not passed.
Did a workaround:

Code: Select all

On System#Boot do
timerSet 1,10
endon
on Rules#Timer=1 do
TaskValueSet 2,3,[TC#TC]
timerSet 1,10
endon
and it works!

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

Re: Simple rule does not work, why?

#6 Post by TD-er » 19 Mar 2020, 15:52

See also the documentation: https://espeasy.readthedocs.io/en/lates ... ore-events

Maybe this also works:

Code: Select all

on Clock#Time=All,**:** do //will run every minute
 GPIO,2,1
endon

scaevola
Normal user
Posts: 11
Joined: 18 Jul 2017, 07:45

Re: Simple rule does not work, why?

#7 Post by scaevola » 19 Mar 2020, 16:17

Tried that, does not work, unfortunately.

User avatar
ThomasB
Normal user
Posts: 614
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Simple rule does not work, why?

#8 Post by ThomasB » 19 Mar 2020, 17:35

Tried that, does not work, unfortunately.
Just to be clear, you tried this?

Code: Select all

On Clock#Time=All,**:** do
  TaskValueSet 2,3,[TC#TC]
endon
I tried this clock rule on a recent Mega build and it works. If you are using a recent Mega release, and it does not work for you, then please post the actual file name to the bin.

- Thomas

scaevola
Normal user
Posts: 11
Joined: 18 Jul 2017, 07:45

Re: Simple rule does not work, why?

#9 Post by scaevola » 19 Mar 2020, 20:11

Yes, I used exactly this formula.
Maybe it's important or maybe not, but it's ESP 01 with 1 MB only.
The bin file is taken from latest release from github, esp8266 1mb.
ESP_Easy_mega-20200310_normal_ESP8266_1M.bin
Greetings
Scaevola

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

Re: Simple rule does not work, why?

#10 Post by TD-er » 19 Mar 2020, 21:54

Maybe copy/paste the rules text into an editor like Notepad++, which can show non-ASCII characters.
Just to be sure you don't have non-standard ASCII characters in the rules due to copy/paste actions from a website.

User avatar
ThomasB
Normal user
Posts: 614
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Simple rule does not work, why?

#11 Post by ThomasB » 19 Mar 2020, 23:17

The bin file is taken from latest release from github, esp8266 1mb.
ESP_Easy_mega-20200310_normal_ESP8266_1M.bin
I tested the "On Clock#Time=All,**:** do" clock rule on:

Code: Select all

  ESP_Easy_mega-20200310_test_ESP8266_4M1M_VCC.bin 
  ESP_Easy_mega-20200222_normal_ESP8285_1M.bin
It works correctly on both.
Just to be sure you don't have non-standard ASCII characters in the rules
Good reminder about that sneaky issue. It's a possible reason behind this problem.

- Thomas

scaevola
Normal user
Posts: 11
Joined: 18 Jul 2017, 07:45

Re: Simple rule does not work, why?

#12 Post by scaevola » 20 Mar 2020, 08:40

Hi there,
mine is ESP_Easy_mega-20200310_normal_ESP8266_1M.bin

Today I tried to clean the code in notepad++, converted enters to unix ones. Still nothing.
The timer workaround works.

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests