Code not working (AI-LED)

djkms

Fish Freak
I have a virtual outlets for my LEDs and statements like this are not working properly.

If Sun 120/000 Then ON
If DoW -MTWTF- Then OFF
If Sun 240/000 Then ON

I want the outlet turn on 2 hours after the sunrise on weekends and 4 hours on the weekdays. It seemed to work ok on the weekday but the outlet still shows off on the weekends and its past 2 hours after sunrise.

Any ideas?
 
Last edited:
Your code looks right but my sense is the two "if sun" statements are conflicting. If you changed them to 'if time' statements, it would work. The 'if sun' statement has an implicit 'then off' and my guess is that's what's hosing you up.
 
Your code looks right but my sense is the two "if sun" statements are conflicting. If you changed them to 'if time' statements, it would work. The 'if sun' statement has an implicit 'then off' and my guess is that's what's hosing you up.

Kind of what I was thinking. I did have them as If Time before no problem. Any thoughts on how to work around this. I really want to follow the Sun table and have them come on in the morning 2 hours earlier on the weekends. I guess add more virtual outlets to make weekend ones?
 
Yea, virtual outlets is the only way to separate them. You really only need one, leave the first 'if sun' and the 'dow' statements there.
 
Yea, virtual outlets is the only way to separate them. You really only need one, leave the first 'if sun' and the 'dow' statements there.
I can't get Lunar cycle to work no matter what I try.
If Moon 000/000 Then (MoonInt) Which is the profile name. Ramp Up 1 min 0-1? I want to replicate the natural lunar cycle.What am I doing wrong?
joe
 
Back
Top