Fade out after sunrise help

The Objective is too fade in for an hour starting from an hour before sunset, then fade out for an hour starting at sunrise.

Tried this little fella after having a bit of a look at nested conditionals:

$(#Dk#>=((#WRH#)+1))&&(#Dk#<=((#WSH#)-1))?0:$$(#Dk#==((#WSH#)-1))?(#Dm#(100/60)):$$(#Dk#==#WRH#)?(100-(#Dm#(100/60))):0$

Seems to return false? Or maybe just 0?

1 Like

Ok, fiddled for about 3h and ended up with this little puppy:

$(#DH#+1)<(#WSH#)&&(#DH#+1)>(#WRH#)?0:$$(#DH#+1)>=(#WSH#)&&(#DH#+1)<=(#WSH#)?((#Dm#)(100/60)):$$(#DH#+1)<=(#WRH#)&&(#DH#+1)>=(#WRH#)?(100-(#Dm#(100/60))):100$

This works perfectly for my purposes.

1 Like

Can you explain to the math impaired what is going on in your final equation? I am trying to get on every hour to fade into the next hour. So around 645 it starts fading into 700, 745 fades into 800, etc. Can you offer any assistance please?

I dont know if I am doing it right, but here is what ive been using:

Time Hr Night before sunrise
$#Dk#<#WSUNRISEH24#?100:0$
Time Hr Day
$#Dk#>=#WSUNRISEH24#&&#Dk#<=#WSUNSETH24#?100:0$
Time Hr Night sunset
$#Dk#>#WSUNSETH24#?100:0$

This will work but it‘s not a smooth fading effect.

Thanks, I noticed that also, but I am still learning - one thing at a time. I am also not totally woried about the transition yet!

1 Like