This object is in archive! 

What's wrong with my rule?

Willias Reis lemos shared this question 7 years ago
Need Answer

The purpose of this rule

Turn on the aquarium light at 8 o'clock and off 6:00 p.m. Leaving the light on 10 hours daily.

Replies (2)

photo
1

Try the TIME - BETWEEN - AND puzzle in the IF condition, please take a look at the attached screenshot.

Files: time.jpg
photo
1

Thank you for your help

photo
photo
1

I don't think your scheduler will work correctly, you have it so it repeats every 10 hours (since day is 24 hours) it will start defasing over the pass of the days. There are two approaches for this purpuse, for both you need two rules, choosing which would depend on how many different rules or events you want to trigger in the future.

1. First rule uses a scheduler that repeats daily at 8 am, this will be used to turn ON the light. Second rule with a different scheduler which also repeats daily at 6 pm and will be used to turn OFF the light. This way your light will always turn ON/OFF at those hours. Downside it is "hardcoded" and if for some reason you reboot or turn OFF your device at any of these two hours, these rules won't be triggered.

2. You can create an "hourly flasher" with a virtual switch or sensor. In the first rule you will use a scheduler that repeats every hour and it will turn ON the flasher, wait for a few seconds, then turn it back OFF. Second rule will be very much alike the one you created but instead of using the scheduler in the WHEN puzzle you will use

WHEN FLASHER ON

IF TIME OF NOW IS BETWEEN 8:00 AND 18:00 THEN

IF LIGHT IS OFF THEN TURN ON

ELSE

IF LIGHT IS ON TURN OFF

Hope this helps.

photo
1

Thank you for your help

photo
Leave a Comment
 
Attach a file