Issues with rules

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Prutsium
Normal user
Posts: 38
Joined: 29 Mar 2018, 15:39
Location: Germany / Netherlands

Issues with rules

#1 Post by Prutsium » 31 Aug 2019, 12:37

Hi all,

A while ago i made an RFID entry system and with the help of a few here we managed to squeeze a large rule into something quite small.
This was due the amount of RFID tags used and we had to come up with an simplified system.

So far so good as that worked perfect without any issues.

Just as reference this was:

Code: Select all

//Jerome
On RFID#Tag do
if [RFID#Tag]=1899267376
WifiAPMode
if [RFID#Tag]=82431090
Event,OkTag
if [RFID#Tag]=83398378
Event,OkTag
if [RFID#Tag]=3497384643
Event,OkTag
if [RFID#Tag]=63002323
Event,OkTag
if [RFID#Tag]=2271020827
Event,OkTag
if [RFID#Tag]=2382158275
Event,OkTag

//Kosta
if [RFID#Tag]=2590891203
Event,OkTag
if [RFID#Tag]=324590275
Event,OkTag
if [RFID#Tag]=1186585027
Event,OkTag
if [RFID#Tag]=4241495763
Event,OkTag
if [RFID#Tag]=3200668835

Event,OkTag

//Ali
if [RFID#Tag]=2648774355
Event,OkTag
if [RFID#Tag]=4199927683
Event,OkTag
if [RFID#Tag]=3842933699
Event,OkTag

//Marina / Anna
if [RFID#Tag]=4225832659
Event,OkTag
if [RFID#Tag]=3579188947
Event,OkTag
if [RFID#Tag]=3348324307
Event,OkTag
if [RFID#Tag]=2964545235
Event,OkTag
if [RFID#Tag]=341776595
Event,OkTag
if [RFID#Tag]=182785747
Event,OkTag
if [RFID#Tag]=177785987
Event,OkTag

endon
endif

On OkTag do
gpio,13,0
gpio,14,1
//publish domoticz/in,{"command": "switchlight", "idx": 125, "switchcmd": "On" }
timerSet,1,5
endon

On Rules#Timer=1 do 
gpio,13,1
gpio,14,0
//publish domoticz/in,{"command": "switchlight", "idx": 125, "switchcmd": "Off" }
endon
Unfortunate my ESP died this week but he go some backups so took an new ESP (same type) and flashed the latest FW (08-30) but run directly in a issue.
When i scan a tag now it doesn't activate the rule anymore:
711462: PN532: Tag: 83398378 55
711465: EVENT: RFID#Tag=83398378
711564: Domoticz: Sensortype: 20 idx: 124 values: 83398378

I noticed one thing if i shorten my rule to just only one tag it works again.
When i use the rule as described above it stops working.

Has this something to do with changes in the Rule system (i use the classic rule system since i dont understand the new one)

Any help would be appreciated as now i have angry neighbors :)

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

Re: Issues with rules

#2 Post by grovkillen » 31 Aug 2019, 12:53

Endif and EndOn is not correctly. You should close each if with an EndIf.
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:

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

Re: Issues with rules

#3 Post by TD-er » 31 Aug 2019, 13:00

If that's not fitting in one rule file, you may also want to use another one. Only I don't know yet how to define an on event thing on a new rules file.
Maybe you could fire a new event if it isn't matched yet using the RFID code?

Prutsium
Normal user
Posts: 38
Joined: 29 Mar 2018, 15:39
Location: Germany / Netherlands

Re: Issues with rules

#4 Post by Prutsium » 31 Aug 2019, 13:17

grovkillen wrote:
31 Aug 2019, 12:53
Endif and EndOn is not correctly. You should close each if with an EndIf.
Wierd how was it then that it worked before always perfect?
I luckily found an .bin backup of my old system i uploaded that one with the exact same rules and it works .....
(Version mega-20180910)

Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests