Combining node messages - Node Red

Maybe the webhook isn't working correctly. Do any device events come in?

If not, you could try changing/re-applying the webhook config.

Yah, I'm waiting it out. platform update is running. My hub always gets funky when there's an update waiting and I'm not sure why it does that. It's just about done, then I'll go click configure on maker and webhook, etc.

Ok - it's working again.

here's the debug of the lock. A LOT more information there.

image

OK. Now, if you're lucky the manual events will all be type physical - but who knows? If they are though, that could be a very valuable bit of data to use in deciding how to construct the alexa payload.

I have two legs that work. i'll go turn the lock and enter a code for the debug ... stand by

Well, you can also look in your device events on the hub. Whatever is reported in the type there is what will show up in the node-red event.

looks like you might be able to use that msg.payload.data field.... empty/null probably=manual, not null is code used?

Oh I think you're right. So would I wrap that nicely into a function? I've no idea how to write that one correctly.

And would I be able to combine all 3 locks into one flow?

my problem is the syntax of the message. Seems that if i start out with a node value it hates on me. I know it's user error.

I would think so. Name of the lock is in msg.payload.displayName so could use that in the message.

Something remotely like this:
"text": msg.payload.displayname + " is unlocked."

let me see if i can work this out. Stand by

Could I use description text?

Good idea!

Ok so ... If i use the node object lastcodename then the current value is the name of the last code entered. but doesn't trigger on a physical lock or unlock. Could I set up the flow to use all and pull the info i need when it locks or unlocks?

image

maybe not ... it reports everything, so it woudn't report the change I dont' think

Multiple flows is inherently harder, especially if the # of msgs is different in different scenarios (like when there is no lastcodename event).

Why do you need the lastcodename event at all if the code used is in the msg.payload.data field of the lock/unlock event?

It doesn't log it unless the node is set to last code name. Let me double check that.

gonna go twist my lcok a few times

I don't think so...

The event you posted earlier had the code on the unlocked event in msg.payload.data, for instance.

Here are both. unlocked physical and unlocked with a code. I only have the debug on the lock status node. locked or unlocked. Here is the output for both physical and code.

image

image

Exactly. Notice "data" is null when unlocked without code, and has a value when unlocked with a code.

So a switch node checking for null on msg.payload.data will separate manual vs code events.