Re: Script stopt working :cry: | RESOLVED

Moderator: leecollings

Post Reply
Benneton
Posts: 114
Joined: Thursday 08 December 2016 9:46
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Script stopt working :cry: | RESOLVED

Post 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
Last edited by Benneton on Sunday 29 July 2018 11:43, edited 1 time in total.
User avatar
jvdz
Posts: 2445
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: Script stopt working :cry:

Post 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
Benneton
Posts: 114
Joined: Thursday 08 December 2016 9:46
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Script stopt working :cry:

Post 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
User avatar
StanHD
Posts: 347
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 »

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
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
User avatar
jvdz
Posts: 2445
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: Script stopt working :cry:

Post by jvdz »

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

Jos
Benneton
Posts: 114
Joined: Thursday 08 December 2016 9:46
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Script stopt working :cry:

Post by Benneton »

Jos, StanHD,

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

Bernard
Benneton
Posts: 114
Joined: Thursday 08 December 2016 9:46
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Script stopt working :cry: | RESOLVED

Post by Benneton »

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