Node-RED nodes for hubitat

Yeah - that’s what I ended by doing. The downside is that I’m repeating some validation logic in multiple places...

1 Like

It shouldn't be that bad though right? Just a change node before the subflow call?

1 Like

Never really looked at subflows, till i saw these last few posts.
Makes sense to use them!

Guess, i dont have that many flows yet to fully utilise their benefit.

Once i build up more devices and flows, ill re-investigate

I’m using a function node as JavaScript makes more sense to me than JSONata for logic etc.... but it’s only one step so not bad.

1 Like

Jsonata is actually kind of nice.. xquery for JSON. You can do a ton of things like referencing variables $flowContext() / $globalContext() and environment variables $env().

Really spiffy is recursion....

And use it in a change node..

1 Like

Is there any way to enlarge the payload from about 256 characters (??). I'm scraping a website and the data that I want is beyond the message payload character count that is returned.

Maybe use a buffer?

http://www.steves-internet-guide.com/understanding-buffers-node-red/

or maybe an array in the payload itself? Is there a limit on that?

1 Like

Thanks, I got around it, with that help.

There is a 1000 character limit on debug nodes, but the whole msg.payload is still there in the flow even though it's not displayed via the debug node. I just needed to evaluate the rule as if it was there, and it all worked.

1 Like

Have been re-reading some posts and come across this, where you use virtual presence.
How are you controlling the virtual switch? Dashboard switch, voice, button??

I have a similar situation where the inlaws come over to babysit during the day, and have been plotting best way to control the virtual device

Cheers

@JasonJoel may do it differently, but I simply use a virtual switch for "babysitter" and then have my away routine check it before firing. So if babysitter is on it skips changing the house mode to away and arming the alarm, turning off all the lights, changing temps, blinds etc... When I come home as part of my arival routine it turns off the babysitter switch automatically if it's on.

I've got it as a switch on my dashboard, but I always use Alexa to trigger it since it drives my wife crazy when I do. "Alexa, turn on the babysitter". Our babysitter is the wife's sister... hehehe

EDIT: One way to do it automatically would be to assign them a static IP and ping the IP address of their phones. When their phones are present, they are present, babysitter switch turns on.

2 Likes

Hahaha. Turn on the babysitter must drive her crazy.
Our babysitter is my wife's mother or sister. Might do it that way just to get her reaction :grin::grin:

I have also thought to give both phones an IP since I already poll unifi for mine and my wife's phone.
Can't really do that With other guests tho - not that many would be at our house with one of us home anyway, come to think of it!

In my office, I have multiple motion sensors. I've got an issue where 3 of the sensors correctly report "inactive", but one sensor near my desk correctly reports active constantly, because I'm moving. The inactive's trigger the timer to start counting down, despite the fact that one of the sensors is still active.

Any thoughts as to how to fix? I just discovered the Count node, which is pretty cool. It might work. Count the number of actives, and also inactives?

Inactive starts the countdown timer, active resets the timer.

One solution would be to turn off the light only if all sensors are inactive, i.e. check the state of each sensor in sequence so that only all inactive permits the off command.

3 Likes

I currently handle this in a function node in my motion subflow, keeping track of each sensor's state, and then only registering as inactive when all sensors are inactive. I've been meaning to revisit this to see if I can do it just through the native nodes, but so far I've been happy with how my setup works.

1 Like

I’d feed the sensors into an ultimate Boolean and trigger off of the or output. Similar to this.

3 Likes

On HE you can use the "Zone Motion Controller" app.. and create a combo motion device..

1 Like

This is how I do it. Doesn't need specialty nodes, and is easy to read visually as the logic isn't "hidden" in some combo node.

But all of the other ways listed are valid, too. Depends on your preferences.

3 Likes

It's pretty simple this way

EDIT: Important distinction here: Node-RED nodes for hubitat

3 Likes

I've been using this too, because it is really simple and easy to understand.

2 Likes

That's sweet. Didn't see that approach before.

1 Like