okay, so i setup the messages and flag. im now programming the rules but are the 3 rules you set 3 separate automation blocks? and if so, then i would do:
first automation block:
1.) add trigger: timed 8:01pm - tuesday
2.) add action: then garbage day TOGGLE
-----------------
second automation block:
1.) add trigger: WHEN garbage day ON
2.) add action: then show "garbage day"
-----------------
third automation block:
1.) add trigger: timed 11:01am wednesday
2.) add action: then clear "garbage day"
is this correct? if so, i guess it would seem to work from your experience but how exactly does it know to toggle every other week (twice a month).
thanks.
That looks correct (yes three blocks).
More detail.
The first line executes every week at 8:01 PM, every week.
That is where the toggle command comes in.
The "Toggle command" toggles the state of the flag OFF/ON. So if the flag is OFF, when the toggle command executes, it changes it to ON. When the flag is ON, it changes it to OFF. Like a toggle switch that operates a light.
So one week it will change it to ON, the next week it will change it to OFF.
The program only takes action when the change of state occurs from OFF to ON. Which occurs every 2 weeks.
The flag will "be" ON for a week at a time, but the controller only looks for changes.
It will do nothing while the flag remains ON. And will do nothing when it changes to OFF.
The complete cycle takes two weeks.
The third line, first of the second block, takes action, as I stated above, ONLY when the flag changes to ON.
So at 8:01 PM on every other Tuesday the flag turns ON, and this line executes.
Once that condition is met, it executes the "show" command.
Then at 11:01 AM on Wednesday the message is cleared.
Note this last block does NOTHING to affect the state of the flag. So it remains ON.
Also, this line will execute EVERY Wednesday at 11:01 AM, but since there is no message being displayed, it will appear as if nothing is happening.
So your alert will only begin at 8:01PM on Tuesday evening (you put the garbage out late! :horse: )
Then turn off the next morning.
The initial state of the flag is critical to get this to run correctly.
You can do it two ways.
One is to upload the program to the controller.
Then while still connected to the controller, go to the flags status page and set the value appropriately for the current week.
Use "1" for ON and "0" for OFF. You can use ANY non zero number for ON, but the binary 1/0 is the normal convention.
The other way is to add a programming block to automatically set the flag. By having these two lines in your code, if you ever lose power and the flags reset, or you edit you prrogram and reset the flags with a new upload, you can edit the date and state of the flag as appropriate for the week.
Simply add the next appropriate ON state's date.
If this coming Tuesday is your trash day, add these lines
TIMED 10/26 8:01 PM
THEN garbage day ON
You have to put that block below the toggle block that is listed up above, or the toggle command will change the state immediately to OFF after this block sets it to ON and you will be out of synch.
If this coming Tuesday is not your trash day, add these lines
TIMED 10/26 8:01 PM
THEN garbage day OFF
That block FORCES the flag to the proper state. From that point forward the toggle command just switches it back and forth.
You only need one or the other (whichever is appropriate)
Make sure you don't select the "Yearly" option.
If you do, the code will execute every year on October 26th and could cause an out of synch condition.
1.) add trigger: timed 8:01pm - tuesday
2.) add action: then garbage day TOGGLE
-----------------
second automation block:
1.) add trigger: timed 10/26 8:01pm
2.) add action: then garbage day ON
-----------------
third automation block:
1.) add trigger: WHEN garbage day ON
2.) add action: then show "garbage day"
-----------------
fourth automation block:
1.) add trigger: timed 11:01am wednesday
2.) add action: then clear "garbage day"
Hope I didn't confuse you too much.