Page 2 of 2

Re: light switch not off with SwitchOn().forMIN(2)

Posted: Friday 05 January 2018 13:52
by rbisschops
dannybloe: isn't .active not part of V2.3? Like many, i'm running V2.2.

[edit] using .active gives unexpected behaviour in V2.2 not an error, so better be carefull with this :(

Re: light switch not off with SwitchOn().forMIN(2)

Posted: Friday 05 January 2018 14:02
by dannybloe
Ah, yeah, you can check for the state or use 'if (device.bState) then'

Re: light switch not off with SwitchOn().forMIN(2)

Posted: Friday 05 January 2018 14:15
by dannybloe
I'm a bit confused now. Which 'original' code are you referring to? The one on '04 Jan 2018, 17:34'?

You description of how checkFirst() is correct. It's just a check against the current state indeed.

Re: light switch not off with SwitchOn().forMIN(2)

Posted: Friday 05 January 2018 22:36
by rbisschops
I understand your confusion. I was refering to the code i posted yesterday (17:34) the one you kindly corrected. The puzzling part for me is that the command is still send despite the checkfist() after the switchOn(). Afterall, as the switch is on, it should not be send at all imho.

Re: light switch not off with SwitchOn().forMIN(2)

Posted: Friday 05 January 2018 23:24
by dannybloe
I suppose you mean the outdoorlamp.switchOn().checkFirst().forMin(2) inside the nightime check. (that's the only lamp with a switchOn()).
So, have you really confirmed that the on command is indeed sent if the state is on? Have you set dzVents in debug mode and actually confirmed that a switch on command is placed in the commandArray? In debug mode the command array is dumped after each script. If it is sent it should show something like 'Buitenlam voor: On FOR 2 MINUTES'

Re: light switch not off with SwitchOn().forMIN(2)

Posted: Saturday 06 January 2018 13:58
by rbisschops
@dannybloe: Maybe a stuppid moment to conclude this, but wasn't checkFirst() also added in 2.3.0. I see this in the log:

Code: Select all

2018-01-06 13:54:30.386 Error: dzVents: Error: Presence actions: An error occured when calling event handler presence_V1-0-3
2018-01-06 13:54:30.386 Error: dzVents: Error: Presence actions: .../pi/domoticz/scripts/dzVents/scripts/presence_V1-0-3.lua:35: attempt to call field 'checkFirst' (a nil value)
I checked the DzVents changelog and see that it's noted as a 2.3.0 function ...

Re: light switch not off with SwitchOn().forMIN(2)

Posted: Saturday 06 January 2018 18:12
by dannybloe
Ah. Indeed. I lose track actually.