Sunrise-sunset blocky not working

Moderator: leecollings

Post Reply
niclasc
Posts: 28
Joined: Wednesday 09 December 2015 17:04
Target OS: Linux
Domoticz version: 4.10854
Location: Sweden
Contact:

Sunrise-sunset blocky not working

Post by niclasc »

I have 2 blocky scripts for setting a dummy switch on or off depending on if sun is up or down.

But it never switches on or off

Can anyone tell me why its not working?


Screenshot from 2017-09-04 19-50-59.png
Screenshot from 2017-09-04 19-50-59.png (23 KiB) Viewed 5246 times
Screenshot from 2017-09-04 19-50-34.png
Screenshot from 2017-09-04 19-50-34.png (24.28 KiB) Viewed 5246 times
Andree
Posts: 74
Joined: Wednesday 07 June 2017 11:19
Target OS: Windows
Domoticz version:
Contact:

Sunrise-sunset blocky not working

Post by Andree »

Becouse you have to set "OR" instead of "AND".
Time > Sunset OR time < Sunrise
bldewit
Posts: 59
Joined: Tuesday 09 May 2017 23:31
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: NL
Contact:

Re: Sunrise-sunset blocky not working

Post by bldewit »

I think these scripts are cancelling each other. All items in the IF-section are triggers, so if the first script turns it on, the second script is triggerred and switches it off...

Maybe switching the blockly category from ALL to TIME will solve it, but I have found LUA to be much more accurate in controlling which switches are used for triggering and which for reference. Also you have the benefit of nested IF's in LUA, which also gives more control.

Looking at the date of this post I sincerely hope you have already solved this problem though 😁
-‐----------------------------------------------------------
Running on rPi 3b (main) and rPi 2b (somfy), both RFLink
IthoRemote, Xiaomi Gateway, KAKU
Prutsium
Posts: 92
Joined: Monday 18 June 2018 11:31
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Germany / Netherlands
Contact:

Re: Sunrise-sunset blocky not working

Post by Prutsium »

Had a similar issue check here: http://www.domoticz.com/forum/viewtopic ... 42#p188942

In my case it was If/Or issue.
bldewit
Posts: 59
Joined: Tuesday 09 May 2017 23:31
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: NL
Contact:

Re: Sunrise-sunset blocky not working

Post by bldewit »

Ok, maybe a tad late, but whatever.
Your first script will never become TRUE. It is fysically impossible to be earlier than sunrise AND later than sunset (on the same day). So, after the second script has turned your switch off, the first will never turn it on....

So, combining it to one blockly with 2 else-blocks might work:

If (before sunrise)
On
Elseif (between sunrise and sunset)
Off
Elseif (after sunset)
On
-‐----------------------------------------------------------
Running on rPi 3b (main) and rPi 2b (somfy), both RFLink
IthoRemote, Xiaomi Gateway, KAKU
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests