Re: Script stopt working :cry: | RESOLVED

Post Reply
Benneton
Posts: 31
Joined: Thursday 08 December 2016 10:46
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Script stopt working :cry: | RESOLVED

Post by Benneton » Saturday 28 July 2018 15:39

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
Last edited by Benneton on Sunday 29 July 2018 11:43, edited 1 time in total.

User avatar
jvdz
Posts: 1464
Joined: Tuesday 30 December 2014 20:25
Target OS: Raspberry Pi
Domoticz version: Stable
Location: Westland/Netherlands
Contact:

Re: Script stopt working :cry:

Post by jvdz » Saturday 28 July 2018 15:47

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

Benneton
Posts: 31
Joined: Thursday 08 December 2016 10:46
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Script stopt working :cry:

Post by Benneton » Saturday 28 July 2018 16:12

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

User avatar
StanHD
Posts: 595
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Script stopt working :cry:

Post by StanHD » Saturday 28 July 2018 17:11

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
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Domoticz Slave - Asrock Ion - Linux, Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa

User avatar
jvdz
Posts: 1464
Joined: Tuesday 30 December 2014 20:25
Target OS: Raspberry Pi
Domoticz version: Stable
Location: Westland/Netherlands
Contact:

Re: Script stopt working :cry:

Post by jvdz » Saturday 28 July 2018 17:18

As StanHD said: Do not change the If since that one is correct and will mess things up when changed!

Jos

Benneton
Posts: 31
Joined: Thursday 08 December 2016 10:46
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Script stopt working :cry:

Post by Benneton » Saturday 28 July 2018 20:23

Jos, StanHD,

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

Bernard

Benneton
Posts: 31
Joined: Thursday 08 December 2016 10:46
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Script stopt working :cry: | RESOLVED

Post by Benneton » Sunday 29 July 2018 11:43

Jos, StanHD,

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

Bernard

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest