New to all of this. How do check status every so often?


#1

1) Give a description of the problem
I created a simple reminder to send me a message if a door is left open. I want to know if I forgot to close a door after 9pm or if it opens after 9pm and before 6am.

2) What is the expected behaviour?

Get a SMS message if the door is open at 9pm and continuely receive messages until it is closed. Or if the door is opened after 9pm.

3) What is happening/not happening?

It is working if the door is open at 9pm, but I want to have it check the status of the door every 30 minutes, so that I would get messages every 30 minutes until I close the door, or if the door were to open before 6am.

How do I repeat a check every 30 minutes?


#2

There are MANY ways to do this. I am a fan of task specific pistons. So I would do this with two pistons. Just be aware that your SMS limit per day is a total of 50 texts.
Piston #1

Every 30 minutes
  IF Time is NOT between 6 AM and 9 PM   (I prefer the NOT option when time spans midnight)
    Then
      IF Contact Sensor 1 is open
        Then
          SMS "The door is open"
      END IF
  END IF

Piston #2

IF Contact Sensor 1 Changes to open
and
Time is NOT between 6 AM and 9 PM   (Again, The NOT option when spanning midnight)
  Then
    SMS "The door has been opened"
END IF

Certainly you could modify the logic and combine these two pistons. I just think it is easier for new webcore users to debug simple, task specific pistons. Your mileage may vary…


#3

Thanks!

So, the two pistons don’t interact, its just simply breaking down the different pieces into simpler pistons each doing only one thing per piston, correct?

I think i am starting to get the idea of it


#4

Correct. The two pistons act independently. Some may argue that you could put it all into one piston. But when I started learning webcore and writing pistons, easy was better. You might want to read through Triggers and Conditions. Writing functional pistons hinges on understanding both of them and using them correctly.

IF Contact Sensor 1 Changes to open   <- Trigger
and
Time is NOT between 6 AM and 9 PM     <- Condition
  Then
    SMS "The door has been opened"
END IF