Repeat the Activity if Condition is true

I know there was another post about repeating an activity and it looks like the use of the “Interval” within the Condition may be the way to set this up, but I wanted to confirm since there is a comment that using the Interval based on a Condition being True is deprecated and the use of the Pulse Output is preferred.

I have 2 tablets that run ImperiHome and I would like to only have the tablets awake and displaying when there is motion detected by the nearby motion sensor(s) and the House Mode is Home. I have the conditions down and they work, sending the LUA http command to the tablet. However I want to have this http command sent every 4 minutes while the motion sensors are tripped. Two reasons to resend this command are 1) make sure the tablet is always on page 0 which displays the time (in case someone/something changes it to a different page. 2) The tablet screen will fall asleep at the 5 minute mark period. Re-sending the http string keeps the tablet screen alive.

Which is the best way to resend this http string? Via an Interval within the condition or using the Pulse output? I haven’t fully grasped the Output Control of Reactor just yet.

EDIT: I added a 4 minute Interval to each “Tablet Awake” group and this appears to trigger and resend the http string. However if the motion sensor is untripped and you trip it within the middle of the interval, the tablet will not wake up until the interval is met. I would like the table to wake up immediately upon sensing motion.

Use the pulse command instead of interval and pulse 4 times every 4 mins. As long as the condition remains true it will pulse 4 times, if it goes false during anytime the pulse will be cancelled.

1 Like

Like this?

And do I do it per group? Or should it be at the top covering the whole reactor? I want the tablet to come awake immediately upon motion being detected.

Yeah looks good! You can even shorten the ‘output goes true for’ to a few seconds, 4-5.

It didn’t keep the tablet awake. I’ve removed the maximum number of times and am playing with the Pulse for time variable right now. I’m also trying to have the Reactor show Tripped as well when either tablet is awake. These 2 ANDs keep going False which is untripping the Reactor.
image

When there is a pulse the condition will go true for the set period then go false until the next pulse occurs. Can you screenshot your activities section?

Hopefully I am just over thinking things here. The way I had it before was a native Vera scene that would run every 4 minutes when the House Mode was = Home. These scene would run a lua.wget HTTP string that would reset Imperihome to page 0. This obviously would keep the tablet screens on all the time, except when the house was NOT equal to Home, and would reset the screen should I or another trigger move it to a different page. (If it is hot outside and someone left a door/window open, it changes to my Door/Window Sensor page.)

What I am after is something similar. When there is motion in/near the room with the tablet, display page 0. If motion continues, reset the screen to page 0 every 4 minutes. Just in case a different page is displayed. If the motion stops, or the house is not = Home, let the tablet screen go to sleep until there is motion again.

Again, I haven’t fully grasped the Output control section of Reactor. During my testing with the below, I changed the tablet to page 1 and let the pulse timer run out. It did not reset to page 0. However I think after the pulse expired, it tried again 120 seconds later and the pulse timer started again.


The http string, not that it matters, is:
luup.inet.wget(“http://192.168.x.x:x/api/rest/dashboard/gotopage?pageIdx=0”)

I figured it out…


Based on the above, keep the condition TRUE for 240 seconds. At the end of that 240 seconds, wait 15 seconds, and Repeat the Activity, assuming there is still motion and someone is home.

Now if I put an “up to X times” value, it will repeat for X. However if there is still motion AND X has been met, it will not repeat (resend the Activity.) Correct?

1 Like

I don’t think it will resend the command. You could keep the limit to 0 so its unlimited to keep it waking up with motion but that may not be desirable

I don’t think so either. During the initial trial and error, it maxed out at 4 and had a comment 4 out of max 4 and never continued. I did set the “up to” as blank/unlimited. Looking at my condition, it’s pulsed 30 times already. Which makes sense since that tablet is in the family room and the kids are watching TV right now.
image

Thank you for the assistance @Pabla.

3 Likes