Change Switch State According to Current Month?


#1

NOOB ALERT!!!
I did a lot with both RuleMachine and CoRE, but new to webCoRE.

1) Give a description of the problem
The pistons I just created for this all told me that they won’t do anything, because they aren’t subscribed to any events.

2) What is the expected behavior?
I want them to pay attention to what month it is. If it’s month 1, 2, or 3, turn ON this switch, and turn these other switches OFF.

3) What is happening/not happening?
Given the nature of my scenario, I have no idea whether they will work or not, but since they say they won’t, I figured I better come here and check on how to make it work correctly.

Looking at the Actions, I am confident that they are configured correctly.
I’m just not sure how to get these pistons to trigger.

My first thought was maybe I need to create another piston to trigger these other pistons to ‘evaluate’ once a day or something, but I couldn’t figure that out. So, here I am. :slight_smile:

**4) Post a Green Snapshot of the piston![image|45x37]

5) Attach any logs (From ST IDE and by turning logging level to Full)
Probably -NA-

REMOVE BELOW AFTER READING


#2

For your IF statement, instead if selecting “is equal to”, scroll down until you see triggers. Select “changes to” and your piston will then subscribe to those and automatically run when the selected attribute (day, month, etc) change.


#3

Thank you very much for your response! :slight_smile:

First…this set of pistons (as with many others I will be creating in the next days and weeks) are ones that I already had working in CoRE which I am trying to duplicate the functionality of here in webCoRE in order to help facilitate my migration process over here and leave legacy CoRE behind.

I understand the concept you’re expressing, and I see how it would function. I did consider doing it that way, but it doesn’t fully meet the need in my case.

In your scenario, if I’m understanding it correctly (and this is why I did it differently in CoRE as well), the only times these pistons would be effective would be at the very moment that we go from one month to the next.

However, I’m wanting it to ‘monitor’ the month status on a continuous basis, and maintain the related set of switches to make sure they reflect the correct month state all the time (i.e. just in case I or some goofy thing I create messes with them, and accidentally or unintentionally gets one of them set to the wrong month state).

It doesn’t necessarily have to keep ‘monitoring’ every moment of the day, but whatever is reasonable would be acceptable for my purposes.

Ideas?


#4

You’re right on. You can get around it with some creative if statement or just by adding a timer to run once a day, week, or any interval that works for you. :slight_smile:


#5

Can I add the time into what I already have, or will I need to rewrite them from beginning?

EDIT: I think I figured it out. I added the timer (though at the end; does that matter?), and now it says it’s scheduled to trigger at the set time.


#6

That should do it! If you post a green snapshot of it I’ll take a look at it to see if there’s any reason it won’t do what you want it to.


#7

You can also use the Switch/Case statement to clean up multiple IF’s and make things more legible.


#8

Try This:


#9

Awesome! I made the changes. Thanks, guys. :slight_smile:
Now…is it OK to have multiple timers within a single piston?
If so, I could just have a single piston for this instead of a different one for each season.


#10

You could have multiple timers yes…


#11

OMG-OMG-OMG! I just did, in about 90 seconds, what would have taken me about 5-10 minutes in RuleMachine or CoRE.

This is SO GREAT!
Donation sent. :slight_smile: