Page 1 of 1

Strange log with blockly script

Posted: Thursday 07 December 2017 20:45
by capman
I have a script that switch a dummy switch on (iemand thuis) (somebody home) if this switch is off and person 1 is home or person 2 is home or person 3
is home then switch dummy switch ON. But in my log I see this strange logging.
iemand thuis.JPG
iemand thuis.JPG (40.29 KiB) Viewed 828 times
log.JPG
log.JPG (247.74 KiB) Viewed 828 times
Somebody know what to do. I restart domoticz a couple of times.

And , that is also strange , I saved it in blockly with the name 'iemand thuis nu' (somebody home now) and not 'iemand thuis nu_1' (somebody home now_1). I can't see no loop in my script :?:

Re: Strange log with blockly script

Posted: Thursday 07 December 2017 20:55
by jvdz
I am not an Block fan (expert) but when one of the OR's is true I expect that Thuis is sswitched on... and this each time a device changes which results in an endless loop.
I guess you should have the 2 switches with the OR relation in one leg of the AND.
so something like:

Code: Select all

If Thuis = Off
And Life 360 1 = On OR life 360 2 = On OR life 360 3 = On 
Set Thuis = On
I still prefer Lua as then you simple put it inside of brackets. :)

Jos

Re: Strange log with blockly script

Posted: Friday 08 December 2017 15:37
by kuifje
The iemand thuis nu _1 is the first event triggerd within iemand thuis nu.
No worries.
Groet,
Kuifje