Jump to content
C4 Forums | Control4
  • 0

How do I create multiple and/or statements in Programming Controls


Bruce S

Question

I have four .mp3 files being used for my doorbell chime.  I want to play a different file for halloween, thanksgiving, christmas, and the rest of the year.  What I'm thinking I need to do is create multiple and/or statements to accomplish this, e.g If date does not = 10/29-10/31 Or date does not = 11/25-11/30 OR date does not equal 12/20-12/31 then play big-ben-doorbell-sound.mp3.  The problem I run into is that I cannot figure out to do this progammatically.c4programmingsnapshot.thumb.png.c6710896f1ad02975a128414518ce488.png

Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • 0
5 hours ago, RAV said:

Use scheduler to set a variable.
October 29 set to 2, Nov 1 set to 1, Nov 25 set to 3, Dec 1 set to 1, Dec 20 set to 4, Jan 1 set to 1

Then just 4 ifs when chime pressed.

That's one way.

6 hours ago, Bruce S said:

The problem I run into is that I cannot figure out to do this progammatically.

You do see the OR button at the top of your screen shot right?

 

That said you could all just keep it in one place/a single macro...

{put anything you want to ALWAYS happen here such as your push notification}
If date is between {set1}
	{do whatever you want}
	STOP
If date is between {set 2}
	{again whatever you like}
	STOP
IF {repeat as needed with that STOP at the end}
{Now do whatever chime you want to ring on all 'normal days}

The STOP option will prevent set 2 from firing if set 1 is fired, if set 1 was skipped, step 2 may be true and gets fired, then STOP will prevent it from going further...and so on and so forth untill any specified date ranges are 'checked' and if non of them are true the 'regular' chime fires.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.