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?
Sunrise-sunset blocky not working
Moderator: leecollings
Sunrise-sunset blocky not working
Becouse you have to set "OR" instead of "AND".
Time > Sunset OR time < Sunrise
Time > Sunset OR time < Sunrise
-
- 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
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
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
Running on rPi 3b (main) and rPi 2b (somfy), both RFLink
IthoRemote, Xiaomi Gateway, KAKU
-
- 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
Had a similar issue check here: http://www.domoticz.com/forum/viewtopic ... 42#p188942
In my case it was If/Or issue.
In my case it was If/Or issue.
-
- 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
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
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
Running on rPi 3b (main) and rPi 2b (somfy), both RFLink
IthoRemote, Xiaomi Gateway, KAKU
Who is online
Users browsing this forum: No registered users and 1 guest