Webcore - turn Christmas tree on if not certain days of month

I should be able to do this, but I am struggling to find a solution. I want to turn on my bedroom Christmas tree daily, except on days 1,22,23,29. I attempted to make a variable (Not_These_Days) with a list of those days and put a condition of "NOT in Not_These_Days" and add that condition to the IF below.

Here's a quick snap of my X-mas piston

You can.
When you select happens daily at, you should also see all these options.

Or the "get out of trouble" one for the wife.
Tree has to be lit if she's in the house.
If she's home I look at the motions; if she's on the move the tree comes on. :rofl:

I was hoping that there is a solution where I don't have to list all of the days of the month that I DO want the tree on, and only list the days that I don't want it on.

Oh OK.
Didn't realise that's what you meant.

Such as

Not_These_Days : 1,22,23,28,29

If $day is NOT in Not_These_Days
then turn on.

Something like this?

Does this work for a list of numbers (days)?

I would think you can just change the weather device to $days and the hex numbers I have are really just a simple list you could change to 1,3,5,7 etc.

You could change $day to a string and then check if it is NOT any of your days.

I put it in a timer just to test it.

Edit: I was thinking you need a variable for day string, but you don't, so I removed it

3 Likes

That works. So simple. Just could not get the syntax correct. Thanks.

1 Like

What was was getting me at first was no option for "is not any of" for $day, then I realized the options given are based on the variable type, so if $day is a string those options come up.

1 Like

Yep, I just could not get past that. Thanks for the help.

1 Like