Node-RED nodes for hubitat

I dont think that will work for my use case. I have a four motion sensors in my office. All four report active when I walk in, but once I sit down, usually three of them report inactive, after differing time periods. After 2 minutes of no messages, the trigger node above would report false, which is what I am specifically trying to avoid. The fourth motion sensor in my office is still active; it doesnt continually resend active, it just doesnt send an inactive until there is no motion. For the problem I was trying to get around, I dont think it would work.
:grinning:

Can you use a 'AND' bool gate node, then feed that into a timer?


True will go to timer and False output will restart timer??
:man_shrugging:

Yes, that's exactly what I ended up doing yesterday. Works well!

1 Like

thats exactly what i do. I also only turn on motion with one of the motion sensors since the one on my desk points towards the door that opens into a hallway.

Can someone explain why my change node is not working like i think it should?


When the virtual switch is "not present" the change node is changing the value to "not Home" instead of away!!!
The 1st & 3rd debug entry is from the device node and the 2nd & 4th entry is off the change node??

Since "present" is part of the string "not present," it finds that instance of the word first, and changes "present" to "Home." After that change is made, the string "not present" no longer exists, so the next match fails.

If you just re-order the the two change entries, that might work.

4 Likes

Well "present" will be detected in either "present" or "not present" right?

You could go all JSONATA if you wanted.. something like this:

( payload.value = "present" ? "Home" : payload.value )

and

( payload.value = "not present" ? "Away" : payload.value )

Or nest things for extra debugging fun.. and just use one change entry...

( 
   payload.value = "present" ? "Home" :
         ( payload.value = "not present" ? "Away" : payload.value )
)

1 Like

Spot On!!!
Thanks, re-ordering the rules did the trick...

I must have spent a good half hour trying to figure this out...lol

Cheers

1 Like

Thanks
So many options!!!
I'll keep this in mind for other change nodes also
Cheers

Darn it - ninja'd AND with a more straightforward solution! :smile: (love it!)

2 Likes

Haha. I certainly don't always think of the simplest solution as my first! A pair of fresh eyes on a problem is often all that's needed.

2 Likes

See the first checkbox where it extends the delay? Your one active sensor will do that and you'll get exactly what you want.

No, he won't. because it only goes active once and then stays active. So it will extend the trigger timer 1 time, then still go off.

1 Like

Well it works here. Every motion sensor I've used has a re-trigger time which sends another "active" when that time expires which resets the delay. Try it, you'll like it. :smiley:

Well, there are many types that do NOT send new messages as long as motion remains active. I have a few myself.

For the other sensors, I completely agree that using the trigger node alone is a cool way to do it! I strongly prefer sensors that do the periodic reset/re-transmit, but not all of them do that.

Believe us, not all sensors re-send active events while they still sense motion. As a matter of fact, I don't think any of my sensors do that. I have Aeotec, Dome, Iris, Hue, and SmartThings sensors.

I have Iris v2 and both in/out Hue and they all re-trigger. The Hue sensors even have a settable re-trigger time. The Iris are at 30 sec, IIRC.

Though now removed from my system I also have both Aeotec and Inovelli Multis and I'm pretty sure they re-trigger as well though I don't recall the time or if it's settable.

YMMV

EDIT: The inactive messages also extend the timeout.

I think you might be mixing up what "re-trigger" means, or maybe the term is used differently by different devices/drivers. I can (and do) modify the re-trigger times on many of my sensors. Most of them are set to 30s, but if motion is detected within that 30s window, it's extended by another 30s before it will report inactive. Here are some event logs from 4 of my sensors (Aeotec MS6, Iris v2, SmartThings and Dome). You can see that they only ever report a single "active" event, and then a single "inactive" event, even though each of these examples shows more than 30s of activity.

(My Hue sensor isn't currently being used for sensing motion, so I can't get any useful info from my event logs for that one).

Then you can use it as a presence sensor instead of a motion sensor, right? There are a lot of users here who would love to have that. As I said, YMMV.

I'm not sure what you mean about using them as presence sensors. All of mine work perfectly as motion sensors, but I was just pointing out that none of mine would work with the flow example you provided. Hence why many of us have to do something different.