Page 1 of 1

Sunrise and Sunset

Posted: Saturday 27 June 2020 17:54
by ChrisVH1982
Hello,

I want to switch on the light for one minute using a PIR but only after sunset and before sunrise. How can I acconplish that?

Re: Sunrise and Sunset

Posted: Saturday 27 June 2020 18:33
by Treve
ChrisVH1982 wrote:Hello,

I want to switch on the light for one minute using a PIR but only after sunset and before sunrise. How can I acconplish that?
It’s quite simple to do with a blockly.

- make a variable ‘nighttime’
- make a blockly
“if time is sunset” “set Nighttime =on” and “if time is sunrise” “set Nightime =off”
If Pir is on and Nighttime is on set light=on for 1 minute

That’s all.

Re: Sunrise and Sunset

Posted: Tuesday 07 July 2020 22:57
by AllesVanZelf
If [Time > Sunset] or [Time < Sunrise] and [Light = Off] and [PIR = On]
Set [Light = On for [1] minutes.

I used a dummy switch instead of a variable as Treve wrote. This Dummy switch was switched by timer. But this is not necessary for what you want to accomplish now.

Re: Sunrise and Sunset

Posted: Wednesday 08 July 2020 11:26
by Treve
AllesVanZelf wrote:If [Time > Sunset] or [Time < Sunrise] and [Light = Off] and [PIR = On]
As far i know there are Time complications with calculations before 00:00 and after 00:00.
That’s the reason I made use of a variable.

Re: Sunrise and Sunset

Posted: Wednesday 08 July 2020 11:28
by AllesVanZelf
The complication you refer to is: If [Time > Sunset] and [Time < Sunrise]
That will never happen. That is why I used OR.
If [Time > Sunset] or [Time < Sunrise]
Then it is working.

Re: Sunrise and Sunset

Posted: Sunday 12 July 2020 7:01
by Treve
AllesVanZelf wrote:If [Time > Sunset] or [Time < Sunrise] and [Light = Off] and [PIR = On]
Set [Light = On for [1] minutes.
Produce this solution every minute a ‘on’ signal?