Node-RED nodes for hubitat

I did try removing it previously, but the light never turned on.. only seemed to work whe k added the final device node

Will give it another try!

Cheers

Something else was wrong on that occasion. Anyway, here's what I would use as a simple motion sequence. It uses a stoptimer node. So whenever motion is active the timer is stopped and it runs again when motion is inactive.

Screen Shot 2020-03-25 at 7.21.38 AM

Question about this sequence:

I can see how motion being active stops the mytimeout node. How does motion being inactive get it started again?

Thanks.
Plenty of options to try.

Next i want to incorporate modes into the sequence!
Off to learn the mode node!

When the Mytimeout Node gets a payload, it resets and immediately starts counting down again. It doesn't need to be told to start the countdown again. I only do action when sensor goes active and just keep the light on for 5 more minutes. The timer won't get reset until motion sensor goes inactive and then active again from additional motion sensed.

Does the Stop Timer behave differently? I don't have that installed.... yet.

If you are like me, you will create a flow that's working exactly like you want then someone on this thread will point out a cool new Node Palette they started using and now you are re-doing half your flows to be more efficient using this new Palette. Also, as you can see just from @aaiyar and myself, there are tons of different ways to accomplish basically the same task and you will just tweak so it performs exactly like YOU want it to.

1 Like

So i have removed the last device node and it worked - So not sure what happened last time

However, i get this is the debug panel (just before the delay timer ends):
msg : string[105]

"Unable to cast to dataType. Open an issue to report back the following output: VECTOR3: "[x:-6,y:-7,z:0]""

What node did that message come from, though? It should say at the top of the debug message.

That's how I do mine, too. As I have a few motion sensors that stay active continuously (and don't toggle from active/inactive/active) when there is continued movement, I need the timer to STOP while motion=active.

It came from the 1st one. Motion sensor device

Well, that's a new one. Never seen that before.

If you get time, export/post the flow and I'll import it and take a peek. (you can delete your hubitat connection IP and token before pasting the flow if you want).

Thanks
Is this what your after?
[{"id":"994a7bf5.258338","type":"tab","label":"Master Bed","disabled":false,"info":""},{"id":"60d934b5.e0ba9c","type":"hubitat device","z":"994a7bf5.258338","name":"MasterBed Motion sensor","server":"b0c51395.d586c","deviceId":"257","attribute":"motion","sendEvent":true,"x":170,"y":80,"wires":[["4183347c.0411bc"]]},{"id":"4183347c.0411bc","type":"switch","z":"994a7bf5.258338","name":"active/inactive","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"active","vt":"str"},{"t":"eq","v":"inactive","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":420,"y":80,"wires":[["1d67444f.9c2e9c","67731887.2d5268"],["4422fe45.896c6"]]},{"id":"1d67444f.9c2e9c","type":"hubitat command","z":"994a7bf5.258338","name":"MasterBed Switch ON","server":"b0c51395.d586c","deviceId":"393","command":"on","commandArgs":"","x":760,"y":40,"wires":[[]]},{"id":"a6677862.1c8c18","type":"hubitat command","z":"994a7bf5.258338","name":"MasterBed Switch OFF","server":"b0c51395.d586c","deviceId":"393","command":"off","commandArgs":"","x":1050,"y":200,"wires":[[]]},{"id":"67731887.2d5268","type":"change","z":"994a7bf5.258338","name":"active=stop","rules":[{"t":"set","p":"payload","pt":"msg","to":"active=stop","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":670,"y":120,"wires":[["4422fe45.896c6"]]},{"id":"4422fe45.896c6","type":"stoptimer","z":"994a7bf5.258338","duration":"30","units":"Second","payloadtype":"num","payloadval":"0","name":"30 sec timer","x":750,"y":260,"wires":[["a6677862.1c8c18"],[]]},{"id":"b0c51395.d586c","type":"hubitat config","z":"","name":"","usetls":false,"host":"192.168.1.202","port":"80","token":"DELETED TOKEN-caf0b958bc9d","appId":"545","nodeRedServer":"http://192.168.1.4:1880","webhookPath":"/hubitat/webhook"}]

Also, i know as is, the change node doesnt work, as im trying @aaiyar way with the stop timer, and no idea how to set it correctly!

Nothing obviously wrong with the flow - other than the change block, as you already mentioned. For that just set the "to" to "stop", not "active=stop".

From the node help, it specifically says the payload has to be "stop" or "STOP" - not "active=stop".
Screenshot 2020-03-25 at 8.30.18 AM

So back to the original error message... That is a curious error message you received. I wouldn't worry about it unless you get it more times. If it was a once and never see it again, just move on. If you keep getting it report it here to @fblackburn.

I seem to get that error each time!!!

And for the dummy here, is this the change node settings:

Is there a period after payload? Looks like there is to me...

1 Like

yes

remove it.

msg.payload is valid
msg.payload. is not valid

1 Like

sweet, Thanks
Now working....Cheers

As for the error.......seems every 2nd time it runs i get the error!!

@aaiyar & @JasonJoel Is the only difference that I have a timer running while active and your guys' only runs when an Inactive is received? That and my lights turn off X minutes after the last time motion is sensed and yours turn off X minutes after sensor goes inactive correct? Should both of ours check to see if light is already on before sending the on command? I am just trying to see if I should switch the Mytimeout Nodes for the Stop Timer node.

That is debatable. Sending an extra command to the hub isn't that big of a deal to me.

That said... Sometimes I check current status, sometimes I don't. More often for things like motion that can trigger repeatedly I use a trigger & block. But checking on/off status is actually easier and a better way to do it than a trigger & block.

If I'm using change blocks to specify command/attribute and a single command block, then a simple RBE node works well.

Trigger & block example:

Same logic but with switch status checking instead of trigger & block. A little cleaner, but not a huge difference (2 fewer nodes is all):