Why does one script not work while they are almost exactly the same?? Topic is solved

Moderator: leecollings

Post Reply
rick8245
Posts: 75
Joined: Wednesday 22 April 2020 15:59
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Why does one script not work while they are almost exactly the same??

Post by rick8245 »

Hi ,

I have 2 scripts of two lamps.

The first one is called: Tuinlamp_voor and this is working fine (Tuinlamp_voor_OK.png)

The second one is called: Buitenlamp_voor and this one does not work at all. (Buitenlamp_voor_NOK.png)


Both scripts are exactly the same .
There is only 1 difference.
In the first script the end time is 23:59
and in the second script the endtime is 05:00

I can not figure out why the first one runs very good and why the second one does not even start and so does nothing at all

Can somebody help me with this ??

Thanks in advance,


Rick
Attachments
Buitenlamp_voor_NOK.png
Buitenlamp_voor_NOK.png (16.54 KiB) Viewed 942 times
Tuinlamp_voor_OK.png
Tuinlamp_voor_OK.png (12.19 KiB) Viewed 942 times
BoelShit
Posts: 10
Joined: Sunday 14 February 2016 11:18
Target OS: Windows
Domoticz version:
Contact:

Re: Why does one script not work while they are almost exactly the same??

Post by BoelShit »

If you look at the "Buitenlamp_voor" the sunset time is always after the 5:00 time as well. So it will turn on your light and immediately turn off due to the Else if. Your assumption is that the 5:00 is for the next day but it's also applicable for the same day ;)
jkimmel
Posts: 129
Joined: Monday 25 November 2013 17:51
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Mallorca
Contact:

Re: Why does one script not work while they are almost exactly the same??

Post by jkimmel »

Try
blocklya.JPG
blocklya.JPG (17.63 KiB) Viewed 935 times
because time after sunset is > 05:00

I was a bit late ;)
Rfxcom
Raspi 4
rick8245
Posts: 75
Joined: Wednesday 22 April 2020 15:59
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Why does one script not work while they are almost exactly the same??

Post by rick8245 »

Thanks guys,

I will try this.
And keep you updated
MikeF
Posts: 350
Joined: Sunday 19 April 2015 0:36
Target OS: Raspberry Pi / ODroid
Domoticz version: V2022.2
Location: UK
Contact:

Re: Why does one script not work while they are almost exactly the same??

Post by MikeF »

I think you mean:
Image
(or rather than and)
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Why does one script not work while they are almost exactly the same??

Post by waaren »

I guess you need both..

blockly.png
blockly.png (40.4 KiB) Viewed 919 times
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
rick8245
Posts: 75
Joined: Wednesday 22 April 2020 15:59
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Why does one script not work while they are almost exactly the same??

Post by rick8245 »

Guys,

thanks for the scripts.
I tried them both and the script of Waaren works exactly like I want.

Thanks also to Jkimmel and MikeF.

Regards,

Rick
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest