Page 1 of 1

Re: Script stopt working :cry: | RESOLVED

Posted: Saturday 28 July 2018 15:39
by Benneton
Hi,

I have created the script below:
Image
It has been working fine for quite some time.
Since start of this week my PI had ethernet issues so I had to setup the PI again with clean install.
Did this and put my backup back. All seems to work fine except that this script only works for the "ON" part.
It does not switches the lights off anymore.

Anyone an idea what is wrong or what went wrong?

Thanks for the support!

Bernard

Re: Script stopt working :cry:

Posted: Saturday 28 July 2018 15:47
by jvdz
You have an impossible test in the ElseIf: The time can never be greater then 23:08 and less then 07:15.
Guess the and needs to be an or?

Jos

Re: Script stopt working :cry:

Posted: Saturday 28 July 2018 16:12
by Benneton
Hi Jos,

Thanks for looking into.
Thought about that. Did change it to an 'OR' statement. Will see tonight if this does the trick.
Also did change the 'AND' to 'OR' in the IF statement.

WHat I do not understand is that this script has worked for many month.
Light on between 07:15 and 23:08 when the "Schemerschakelaar HAL" went on.
Lights off after 23:08 or when the "Schemerschakelaar HAL"went off

But that must then be BLOCKY have more qurious things with it.

Bernard

Re: Script stopt working :cry:

Posted: Saturday 28 July 2018 17:11
by StanHD
Benneton wrote:Hi Jos,

Thanks for looking into.
Thought about that. Did change it to an 'OR' statement. Will see tonight if this does the trick.
Also did change the 'AND' to 'OR' in the IF statement.

WHat I do not understand is that this script has worked for many month.
Light on between 07:15 and 23:08 when the "Schemerschakelaar HAL" went on.
Lights off after 23:08 or when the "Schemerschakelaar HAL"went off

But that must then be BLOCKY have more qurious things with it.

Bernard
The 'and' in the first if statement is ok because the time range does not cross 00:00 (midnight).
As @jvdz says, in the 'else if' statement the time does cross 00:00 therefore it must be 'or'.

In Domoticz time conditions reset at midnight 00:00. Image

Re: Script stopt working :cry:

Posted: Saturday 28 July 2018 17:18
by jvdz
As StanHD said: Do not change the If since that one is correct and will mess things up when changed!

Jos

Re: Script stopt working :cry:

Posted: Saturday 28 July 2018 20:23
by Benneton
Jos, StanHD,

reverted back to and in the IF statement.
One day I wil get the hang of it :)

Bernard

Re: Script stopt working :cry: | RESOLVED

Posted: Sunday 29 July 2018 11:43
by Benneton
Jos, StanHD,

Thanks it works :)
Still do not get it why it worked before?

Bernard