Trying Dryer Alert Again


#2

I don’t understand the point of the empty if block. Whenever that is true, the other is not likely to be true so it will never do anything. Perhaps you would do better with something like this:

If acceleration stays inactive for 2 minutes        <-- trigger
then
   if contact is closed                                                   <--condition
       and
      acceleration was active for at least 10 minutes.   <--condition
   then
      clothes are dry
  else
      false alarm
  end if
end if

EDIT: FYI, you should have just kept this in the original thread vs starting a new one. Try to keep all discussion of the same topic together so future readers can see both what works and what doesn’t work. thanks.


#3

I apologize. Thank you for your help.


#4

The false alarm line. Is that a message to be sent if the piston triggers early?


#5

No, I just thew that in. It just means the piston was triggered but it didn’t count as end of dryer run. You can remove the else section.


#6

Got it


#7

Still ignoring the 10 minute condition and immediately scheduling the 2 minute trigger just by closing the dryer door.


#8

As it should. As soon as you close the door, acceleration stops (until you start the dryer up). When it has been two minutes of inactivity, It will check the other conditions to see if indeed the drying is done. If the acceleration hasn’t been active for 10 minutes, it will do nothing since it won’t meet the internal if requirements. Then the piston won’t reschedule again until there is some acceleration.


#9

Right, I just saw that it did count down but did not send the message. I’m going to run the dryer for more than 10 minutes now and see if it works. I really appreciate this help


#10

Didn’t send the text after a 20 minute run of the dryer
Here is the piston and the last log that ran


#11

Sorry, I’m still learning this stuff too. Once the acceleration has gone to inactive, you need to look at the previous value. For the last condition I think you need to calculate how long the dryer acceleration was active using:

(previousAge([contact sensor 1 : acceleration])-age([contact sensor 1 : acceleration]))/60000

By dividing by 60000, this will provide a value in minutes. So your final condition will need to use an expression like this:


#12

And here’s where I give up :grinning:


#13

So try this?


#14

No, the new condition was supposed to replace the ‘was active for 10 minutes’ so you need to delete that condition.


#15

Got it


#16

Still not sending the text message after the countdown.


#17


#18

Sorry. That is the limit of my knowledge/ability. I thought it should work. It did run 2 minutes after the dryer stopped, right? Not sure where to go from here. Perhaps there is someone else that has dealt with this on the forum.


#19

Ok. I really appreciate you trying. It did run when the dryer stopped after 18 minutes but canceled the text message. I do notice that it starts to run the 2 minute countdown multiple times during the dryer run but cancels them after about 30 seconds until the dryer stops and it does the full 2 minute countdown but fails to send the message.


#20

Perhaps the use of variables to track dryer on/off will work. You might look at this thread.


#21

I’ll take a look. Thanks again and have a good evening.